dct.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /****************************************************************************
  2. *
  3. * Module Title : dct.h
  4. *
  5. * Description : DCT header file.
  6. *
  7. ****************************************************************************/
  8. #ifndef __INC_DCT_H
  9. #define __INC_DCT_H
  10. /****************************************************************************
  11. * Header files
  12. ****************************************************************************/
  13. #include "type_aliases.h"
  14. /****************************************************************************
  15. * Macros
  16. ****************************************************************************/
  17. #define COEFF_MAX 32768 // Max magnitude of DCT coefficient
  18. // Extra bits of precision added to the fdct that have to be stripped off during the quantize
  19. #define FDCT_PRECISION_BITS 1
  20. #define FDCT_PRECISION_NEG_ADJ ((INT16) (1<<FDCT_PRECISION_BITS)-1)
  21. #if 0 // AWG not required any more!!!
  22. /* Cos and Sin constant multipliers used during DCT and IDCT */
  23. extern const double C1S7;
  24. extern const double C2S6;
  25. extern const double C3S5;
  26. extern const double C4S4;
  27. extern const double C5S3;
  28. extern const double C6S2;
  29. extern const double C7S1;
  30. // DCT lookup tables and pointers
  31. extern INT32 * C4S4_TablePtr;
  32. extern INT32 C4S4_Table[(COEFF_MAX * 4) + 1];
  33. extern INT32 * C6S2_TablePtr;
  34. extern INT32 C6S2_Table[(COEFF_MAX * 2) + 1];
  35. extern INT32 * C2S6_TablePtr;
  36. extern INT32 C2S6_Table[(COEFF_MAX * 2) + 1];
  37. extern INT32 * C1S7_TablePtr;
  38. extern INT32 C1S7_Table[(COEFF_MAX * 2) + 1];
  39. extern INT32 * C7S1_TablePtr;
  40. extern INT32 C7S1_Table[(COEFF_MAX * 2) + 1];
  41. extern INT32 * C3S5_TablePtr;
  42. extern INT32 C3S5_Table[(COEFF_MAX * 2) + 1];
  43. extern INT32 * C5S3_TablePtr;
  44. extern INT32 C5S3_Table[(COEFF_MAX * 2) + 1];
  45. #endif
  46. /****************************************************************************
  47. * Exports
  48. ****************************************************************************/
  49. #ifdef COMPDLL
  50. // Forward Transform
  51. extern void fdct_slow ( INT32 *InputData, double *OutputData );
  52. #endif
  53. // Reverse Transform
  54. extern void IDctSlow( INT16 *InputData, INT16 *QuantMatrix, INT16 *OutputData );
  55. extern void IDct10 ( INT16 *InputData, INT16 *QuantMatrix, INT16 *OutputData );
  56. extern void IDct1 ( INT16 *InputData, INT16 *QuantMatrix, INT16 *OutputData );
  57. #endif