vp9_quantize.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VP9_ENCODER_VP9_QUANTIZE_H_
  11. #define VPX_VP9_ENCODER_VP9_QUANTIZE_H_
  12. #include "./vpx_config.h"
  13. #include "vp9/encoder/vp9_block.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef struct {
  18. DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
  19. DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
  20. DECLARE_ALIGNED(16, int16_t, y_zbin[QINDEX_RANGE][8]);
  21. DECLARE_ALIGNED(16, int16_t, y_round[QINDEX_RANGE][8]);
  22. // TODO(jingning): in progress of re-working the quantization. will decide
  23. // if we want to deprecate the current use of y_quant.
  24. DECLARE_ALIGNED(16, int16_t, y_quant_fp[QINDEX_RANGE][8]);
  25. DECLARE_ALIGNED(16, int16_t, uv_quant_fp[QINDEX_RANGE][8]);
  26. DECLARE_ALIGNED(16, int16_t, y_round_fp[QINDEX_RANGE][8]);
  27. DECLARE_ALIGNED(16, int16_t, uv_round_fp[QINDEX_RANGE][8]);
  28. DECLARE_ALIGNED(16, int16_t, uv_quant[QINDEX_RANGE][8]);
  29. DECLARE_ALIGNED(16, int16_t, uv_quant_shift[QINDEX_RANGE][8]);
  30. DECLARE_ALIGNED(16, int16_t, uv_zbin[QINDEX_RANGE][8]);
  31. DECLARE_ALIGNED(16, int16_t, uv_round[QINDEX_RANGE][8]);
  32. } QUANTS;
  33. void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
  34. const int16_t *scan, const int16_t *iscan);
  35. struct VP9_COMP;
  36. struct VP9Common;
  37. void vp9_frame_init_quantizer(struct VP9_COMP *cpi);
  38. void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x);
  39. void vp9_init_quantizer(struct VP9_COMP *cpi);
  40. void vp9_set_quantizer(struct VP9Common *cm, int q);
  41. int vp9_quantizer_to_qindex(int quantizer);
  42. int vp9_qindex_to_quantizer(int qindex);
  43. #ifdef __cplusplus
  44. } // extern "C"
  45. #endif
  46. #endif // VPX_VP9_ENCODER_VP9_QUANTIZE_H_