OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef VP9_ENCODER_VP9_QUANTIZE_H_ | 11 #ifndef VP9_ENCODER_VP9_QUANTIZE_H_ |
12 #define VP9_ENCODER_VP9_QUANTIZE_H_ | 12 #define VP9_ENCODER_VP9_QUANTIZE_H_ |
13 | 13 |
14 #include "./vpx_config.h" | 14 #include "./vpx_config.h" |
15 #include "vp9/encoder/vp9_block.h" | 15 #include "vp9/encoder/vp9_block.h" |
16 | 16 |
17 #ifdef __cplusplus | 17 #ifdef __cplusplus |
18 extern "C" { | 18 extern "C" { |
19 #endif | 19 #endif |
20 | 20 |
21 typedef struct { | 21 typedef struct { |
22 DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]); | 22 DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]); |
23 DECLARE_ALIGNED(16, int16_t, y_quant_shift[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]); | 24 DECLARE_ALIGNED(16, int16_t, y_zbin[QINDEX_RANGE][8]); |
25 DECLARE_ALIGNED(16, int16_t, y_round[QINDEX_RANGE][8]); | 25 DECLARE_ALIGNED(16, int16_t, y_round[QINDEX_RANGE][8]); |
26 | 26 |
| 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 |
27 DECLARE_ALIGNED(16, int16_t, uv_quant[QINDEX_RANGE][8]); | 32 DECLARE_ALIGNED(16, int16_t, uv_quant[QINDEX_RANGE][8]); |
28 DECLARE_ALIGNED(16, int16_t, uv_quant_shift[QINDEX_RANGE][8]); | 33 DECLARE_ALIGNED(16, int16_t, uv_quant_shift[QINDEX_RANGE][8]); |
29 DECLARE_ALIGNED(16, int16_t, uv_zbin[QINDEX_RANGE][8]); | 34 DECLARE_ALIGNED(16, int16_t, uv_zbin[QINDEX_RANGE][8]); |
30 DECLARE_ALIGNED(16, int16_t, uv_round[QINDEX_RANGE][8]); | 35 DECLARE_ALIGNED(16, int16_t, uv_round[QINDEX_RANGE][8]); |
31 | 36 |
32 #if CONFIG_ALPHA | 37 #if CONFIG_ALPHA |
33 DECLARE_ALIGNED(16, int16_t, a_quant[QINDEX_RANGE][8]); | 38 DECLARE_ALIGNED(16, int16_t, a_quant[QINDEX_RANGE][8]); |
34 DECLARE_ALIGNED(16, int16_t, a_quant_shift[QINDEX_RANGE][8]); | 39 DECLARE_ALIGNED(16, int16_t, a_quant_shift[QINDEX_RANGE][8]); |
35 DECLARE_ALIGNED(16, int16_t, a_zbin[QINDEX_RANGE][8]); | 40 DECLARE_ALIGNED(16, int16_t, a_zbin[QINDEX_RANGE][8]); |
36 DECLARE_ALIGNED(16, int16_t, a_round[QINDEX_RANGE][8]); | 41 DECLARE_ALIGNED(16, int16_t, a_round[QINDEX_RANGE][8]); |
37 #endif | 42 #endif |
38 } QUANTS; | 43 } QUANTS; |
39 | 44 |
| 45 void vp9_quantize_dc(const int16_t *coeff_ptr, int skip_block, |
| 46 const int16_t *round_ptr, const int16_t quant_ptr, |
| 47 int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, |
| 48 const int16_t dequant_ptr, uint16_t *eob_ptr); |
| 49 void vp9_quantize_dc_32x32(const int16_t *coeff_ptr, int skip_block, |
| 50 const int16_t *round_ptr, const int16_t quant_ptr, |
| 51 int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, |
| 52 const int16_t dequant_ptr, uint16_t *eob_ptr); |
40 void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, | 53 void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, |
41 const int16_t *scan, const int16_t *iscan); | 54 const int16_t *scan, const int16_t *iscan); |
42 | 55 |
43 struct VP9_COMP; | 56 struct VP9_COMP; |
44 struct VP9Common; | 57 struct VP9Common; |
45 | 58 |
46 void vp9_frame_init_quantizer(struct VP9_COMP *cpi); | 59 void vp9_frame_init_quantizer(struct VP9_COMP *cpi); |
47 | 60 |
48 void vp9_update_zbin_extra(struct VP9_COMP *cpi, MACROBLOCK *x); | 61 void vp9_update_zbin_extra(struct VP9_COMP *cpi, MACROBLOCK *x); |
49 | 62 |
50 void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x); | 63 void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x); |
51 | 64 |
52 void vp9_init_quantizer(struct VP9_COMP *cpi); | 65 void vp9_init_quantizer(struct VP9_COMP *cpi); |
53 | 66 |
54 void vp9_set_quantizer(struct VP9Common *cm, int q); | 67 void vp9_set_quantizer(struct VP9Common *cm, int q); |
55 | 68 |
56 int vp9_quantizer_to_qindex(int quantizer); | 69 int vp9_quantizer_to_qindex(int quantizer); |
57 | 70 |
58 int vp9_qindex_to_quantizer(int qindex); | 71 int vp9_qindex_to_quantizer(int qindex); |
59 | 72 |
60 #ifdef __cplusplus | 73 #ifdef __cplusplus |
61 } // extern "C" | 74 } // extern "C" |
62 #endif | 75 #endif |
63 | 76 |
64 #endif // VP9_ENCODER_VP9_QUANTIZE_H_ | 77 #endif // VP9_ENCODER_VP9_QUANTIZE_H_ |
OLD | NEW |