blob: 2e6d7da2b6622c6e761ce2241e90493bfe260b90 [file] [log] [blame]
Kaido Kert72bde072021-03-12 15:55:15 -08001/*
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
11#ifndef VPX_VP9_ENCODER_VP9_QUANTIZE_H_
12#define VPX_VP9_ENCODER_VP9_QUANTIZE_H_
13
14#include "./vpx_config.h"
15#include "vp9/encoder/vp9_block.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef struct {
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]);
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 DECLARE_ALIGNED(16, int16_t, y_round_fp[QINDEX_RANGE][8]);
32 DECLARE_ALIGNED(16, int16_t, uv_round_fp[QINDEX_RANGE][8]);
33
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]);
38} QUANTS;
39
40void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
41 const int16_t *scan, const int16_t *iscan);
42
43struct VP9_COMP;
44struct VP9Common;
45
46void vp9_frame_init_quantizer(struct VP9_COMP *cpi);
47
48void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x);
49
50void vp9_init_quantizer(struct VP9_COMP *cpi);
51
52void vp9_set_quantizer(struct VP9_COMP *cm, int q);
53
54int vp9_quantizer_to_qindex(int quantizer);
55
56int vp9_qindex_to_quantizer(int qindex);
57
58#ifdef __cplusplus
59} // extern "C"
60#endif
61
62#endif // VPX_VP9_ENCODER_VP9_QUANTIZE_H_