vp9_quantize.h 2 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5 6
 *  that can be found in the LICENSE file in the root of the source
 *  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.
John Koleszar's avatar
John Koleszar committed
9 10
 */

11 12
#ifndef VP9_ENCODER_VP9_QUANTIZE_H_
#define VP9_ENCODER_VP9_QUANTIZE_H_
John Koleszar's avatar
John Koleszar committed
13

14
#include "./vpx_config.h"
15
#include "vp9/encoder/vp9_block.h"
John Koleszar's avatar
John Koleszar committed
16

17 18 19 20
#ifdef __cplusplus
extern "C" {
#endif

21 22 23 24 25 26
typedef struct {
  DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, y_zbin[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, y_round[QINDEX_RANGE][8]);

27 28 29 30
  // TODO(jingning): in progress of re-working the quantization. will decide
  // if we want to deprecate the current use of y_quant.
  DECLARE_ALIGNED(16, int16_t, y_quant_fp[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, uv_quant_fp[QINDEX_RANGE][8]);
31 32
  DECLARE_ALIGNED(16, int16_t, y_round_fp[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, uv_round_fp[QINDEX_RANGE][8]);
33

34 35 36 37 38 39
  DECLARE_ALIGNED(16, int16_t, uv_quant[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, uv_quant_shift[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, uv_zbin[QINDEX_RANGE][8]);
  DECLARE_ALIGNED(16, int16_t, uv_round[QINDEX_RANGE][8]);
} QUANTS;

Alex Converse's avatar
Alex Converse committed
40
void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
41 42
                                const int16_t *scan, const int16_t *iscan);

43
struct VP9_COMP;
44
struct VP9Common;
45

46
void vp9_frame_init_quantizer(struct VP9_COMP *cpi);
47

48
void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x);
49

50
void vp9_init_quantizer(struct VP9_COMP *cpi);
51

52 53
void vp9_set_quantizer(struct VP9Common *cm, int q);

54 55 56 57
int vp9_quantizer_to_qindex(int quantizer);

int vp9_qindex_to_quantizer(int qindex);

58 59 60 61
#ifdef __cplusplus
}  // extern "C"
#endif

62
#endif  // VP9_ENCODER_VP9_QUANTIZE_H_