Refactor vp10_xform_quant
1) Add facade to quantize b/fp/dc version so that their interface are the same. 2) Merge vp10_xform_quant b/fp/dc version to one function so that the code flow in encodemb.c is clear Change-Id: Ib62d6215438fc2d07f4e7e72393f964832d6746f
This commit is contained in:
@@ -12,12 +12,20 @@
|
||||
#define VP10_ENCODER_QUANTIZE_H_
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "vp10/common/scan.h"
|
||||
#include "vp10/encoder/block.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*VP10_QUANT_FACADE)(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
|
||||
typedef struct {
|
||||
DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
|
||||
DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
|
||||
@@ -38,7 +46,7 @@ typedef struct {
|
||||
} QUANTS;
|
||||
|
||||
void vp10_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
|
||||
const int16_t *scan, const int16_t *iscan);
|
||||
const int16_t *scan, const int16_t *iscan);
|
||||
|
||||
struct VP10_COMP;
|
||||
struct VP10Common;
|
||||
@@ -55,6 +63,81 @@ int vp10_quantizer_to_qindex(int quantizer);
|
||||
|
||||
int vp10_qindex_to_quantizer(int qindex);
|
||||
|
||||
void vp10_quantize_skip(intptr_t n_coeffs, tran_low_t *qcoeff_ptr,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr);
|
||||
|
||||
void vp10_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
|
||||
void vp10_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
|
||||
void vp10_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void vp10_highbd_quantize_fp_facade(
|
||||
const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr, const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const scan_order *sc);
|
||||
|
||||
void vp10_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
|
||||
void vp10_highbd_quantize_dc_facade(
|
||||
const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr, const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const scan_order *sc);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
void vp10_quantize_fp_32x32_facade(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
|
||||
void vp10_quantize_b_32x32_facade(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
|
||||
void vp10_quantize_dc_32x32_facade(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr,
|
||||
const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
|
||||
const scan_order *sc);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void vp10_highbd_quantize_fp_32x32_facade(
|
||||
const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr, const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const scan_order *sc);
|
||||
|
||||
void vp10_highbd_quantize_b_32x32_facade(
|
||||
const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr, const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const scan_order *sc);
|
||||
|
||||
void vp10_highbd_quantize_dc_32x32_facade(
|
||||
const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
|
||||
tran_low_t *qcoeff_ptr, const MACROBLOCKD_PLANE *pd,
|
||||
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const scan_order *sc);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user