2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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.
11 #ifndef VP9_ENCODER_VP9_QUANTIZE_H_
12 #define VP9_ENCODER_VP9_QUANTIZE_H_
14 #include "./vpx_config.h"
15 #include "vp9/encoder/vp9_block.h"
22 DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
23 DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
24 DECLARE_ALIGNED(16, int16_t, y_zbin[QINDEX_RANGE][8]);
25 DECLARE_ALIGNED(16, int16_t, y_round[QINDEX_RANGE][8]);
27 // TODO(jingning): in progress of re-working the quantization. will decide
28 // if we want to deprecate the current use of y_quant.
29 DECLARE_ALIGNED(16, int16_t, y_quant_fp[QINDEX_RANGE][8]);
30 DECLARE_ALIGNED(16, int16_t, uv_quant_fp[QINDEX_RANGE][8]);
31 DECLARE_ALIGNED(16, int16_t, y_round_fp[QINDEX_RANGE][8]);
32 DECLARE_ALIGNED(16, int16_t, uv_round_fp[QINDEX_RANGE][8]);
34 DECLARE_ALIGNED(16, int16_t, uv_quant[QINDEX_RANGE][8]);
35 DECLARE_ALIGNED(16, int16_t, uv_quant_shift[QINDEX_RANGE][8]);
36 DECLARE_ALIGNED(16, int16_t, uv_zbin[QINDEX_RANGE][8]);
37 DECLARE_ALIGNED(16, int16_t, uv_round[QINDEX_RANGE][8]);
40 void vp9_quantize_dc(const tran_low_t *coeff_ptr,
41 int n_coeffs, int skip_block,
42 const int16_t *round_ptr, const int16_t quant_ptr,
43 tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
44 const int16_t dequant_ptr, uint16_t *eob_ptr);
45 void vp9_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block,
46 const int16_t *round_ptr, const int16_t quant_ptr,
47 tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
48 const int16_t dequant_ptr, uint16_t *eob_ptr);
49 void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
50 const int16_t *scan, const int16_t *iscan);
52 #if CONFIG_VP9_HIGHBITDEPTH
53 void vp9_highbd_quantize_dc(const tran_low_t *coeff_ptr,
54 int n_coeffs, int skip_block,
55 const int16_t *round_ptr, const int16_t quant_ptr,
56 tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
57 const int16_t dequant_ptr, uint16_t *eob_ptr);
58 void vp9_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr,
60 const int16_t *round_ptr,
61 const int16_t quant_ptr,
62 tran_low_t *qcoeff_ptr,
63 tran_low_t *dqcoeff_ptr,
64 const int16_t dequant_ptr,
71 void vp9_frame_init_quantizer(struct VP9_COMP *cpi);
73 void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x);
75 void vp9_init_quantizer(struct VP9_COMP *cpi);
77 void vp9_set_quantizer(struct VP9Common *cm, int q);
79 int vp9_quantizer_to_qindex(int quantizer);
81 int vp9_qindex_to_quantizer(int qindex);
87 #endif // VP9_ENCODER_VP9_QUANTIZE_H_