quantize.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef QUANTIZE_H
  2. #define QUANTIZE_H
  3. #include "codec_common.h"
  4. #include "codec_common_interface.h"
  5. /****************************************************************************
  6. * Structures
  7. *****************************************************************************
  8. */
  9. typedef struct
  10. {
  11. UINT32 FrameQIndex; // Quality specified as a table index
  12. UINT32 ThisFrameQuantizerValue; // Quality value for this frame
  13. short round[8];
  14. short mult[8];
  15. short zbin[8];
  16. UINT32 LastQuantizerValue; // Quality value for this frame
  17. UINT32 QThreshTable[Q_TABLE_SIZE]; // ac quantizer scale values
  18. UINT32 *transIndex; // array to reorder zig zag to idct's ordering
  19. UINT8 quant_index[64]; // array to reorder from raster to zig zag
  20. // used by the dequantizer
  21. Q_LIST_ENTRY * dequant_coeffs[2]; // pointer to current dequantization tables
  22. Q_LIST_ENTRY * dequant_coeffsAlloc[2]; // alloc so we can keep alligned
  23. INT32 QuantCoeffs[2][64]; // Quantizer values table
  24. INT32 QuantRound[2][64]; // Quantizer rounding table
  25. INT32 ZeroBinSize[2][64]; // Quantizer zero bin table
  26. } QUANTIZER;
  27. /****************************************************************************
  28. * Functions
  29. *****************************************************************************
  30. */
  31. extern void VP5_InitQTables
  32. (
  33. QUANTIZER *pbi,
  34. UINT8 Vp3VersionNo
  35. );
  36. extern void VP5_UpdateQ
  37. (
  38. QUANTIZER *pbi,
  39. UINT8 Vp3VersionNo
  40. );
  41. extern void VP5_UpdateQC
  42. (
  43. QUANTIZER *pbi,
  44. UINT8 Vp3VersionNo
  45. );
  46. extern void VP5_init_quantizer
  47. (
  48. QUANTIZER *pbi,
  49. UINT8 Vp3VersionNo
  50. );
  51. extern void (*VP5_quantize)
  52. (
  53. QUANTIZER *pbi,
  54. INT16 * DCT_block,
  55. Q_LIST_ENTRY * quantized_list,
  56. UINT8 bp
  57. );
  58. extern void VP5_init_dequantizer
  59. (
  60. QUANTIZER *pbi,
  61. UINT8 Vp3VersionNo
  62. );
  63. extern QUANTIZER * VP5_CreateQuantizer
  64. (
  65. void
  66. );
  67. extern void VP5_DeleteQuantizer
  68. (
  69. QUANTIZER **pbi
  70. );
  71. extern UINT8 QTableSelect[6];
  72. #endif