mdct.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /************************************************************************
  2. * Copyright (C) 2002-2009, Xiph.org Foundation
  3. * Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above
  13. * copyright notice, this list of conditions and the following disclaimer
  14. * in the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the names of the Xiph.org Foundation nor Pinknoise
  17. * Productions Ltd nor the names of its contributors may be used to
  18. * endorse or promote products derived from this software without
  19. * specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ************************************************************************
  33. function: modified discrete cosine transform prototypes
  34. ************************************************************************/
  35. #ifndef _OGG_mdct_H_
  36. #define _OGG_mdct_H_
  37. #include "ivorbiscodec.h"
  38. #include "misc.h"
  39. #define DATA_TYPE ogg_int32_t
  40. #define REG_TYPE register ogg_int32_t
  41. #ifdef _LOW_ACCURACY_
  42. #define cPI3_8 (0x0062)
  43. #define cPI2_8 (0x00b5)
  44. #define cPI1_8 (0x00ed)
  45. #else
  46. #define cPI3_8 (0x30fbc54d)
  47. #define cPI2_8 (0x5a82799a)
  48. #define cPI1_8 (0x7641af3d)
  49. #endif
  50. extern void mdct_backward(int n, DATA_TYPE *in);
  51. extern void mdct_shift_right(int n, DATA_TYPE *in, DATA_TYPE *right);
  52. extern void mdct_unroll_lap(int n0,int n1,
  53. int lW,int W,
  54. DATA_TYPE *in,DATA_TYPE *right,
  55. LOOKUP_T *w0,LOOKUP_T *w1,
  56. ogg_int16_t *out,
  57. int step,
  58. int start,int end /* samples, this frame */);
  59. #endif