Commit 1ad7c1f2 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Renaming y1dc_delta_q, uvdc_delta_q, uvac_delta_q fields from VP9Common.

New names are y_dc_delta_q, uv_dc_delta_q, uv_ac_delta_q.

Change-Id: I4acae1fc23a4697ce2c5a5becb8dc28ef0a4b552
parent 07cde4fd
...@@ -228,9 +228,9 @@ typedef struct VP9Common { ...@@ -228,9 +228,9 @@ typedef struct VP9Common {
int base_qindex; int base_qindex;
int last_kf_gf_q; /* Q used on the last GF or KF */ int last_kf_gf_q; /* Q used on the last GF or KF */
int y1dc_delta_q; int y_dc_delta_q;
int uvdc_delta_q; int uv_dc_delta_q;
int uvac_delta_q; int uv_ac_delta_q;
unsigned int frames_since_golden; unsigned int frames_since_golden;
unsigned int frames_till_alt_ref_frame; unsigned int frames_till_alt_ref_frame;
......
...@@ -102,15 +102,15 @@ void vp9_init_de_quantizer(VP9D_COMP *pbi) { ...@@ -102,15 +102,15 @@ void vp9_init_de_quantizer(VP9D_COMP *pbi) {
VP9_COMMON *const pc = &pbi->common; VP9_COMMON *const pc = &pbi->common;
for (q = 0; q < QINDEX_RANGE; q++) { for (q = 0; q < QINDEX_RANGE; q++) {
pc->y_dequant[q][0] = (int16_t)vp9_dc_quant(q, pc->y1dc_delta_q); pc->y_dequant[q][0] = (int16_t)vp9_dc_quant(q, pc->y_dc_delta_q);
pc->uv_dequant[q][0] = (int16_t)vp9_dc_uv_quant(q, pc->uvdc_delta_q); pc->uv_dequant[q][0] = (int16_t)vp9_dc_uv_quant(q, pc->uv_dc_delta_q);
/* all the ac values =; */ /* all the ac values =; */
for (i = 1; i < 16; i++) { for (i = 1; i < 16; i++) {
const int rc = vp9_default_zig_zag1d_4x4[i]; const int rc = vp9_default_zig_zag1d_4x4[i];
pc->y_dequant[q][rc] = (int16_t)vp9_ac_yquant(q); pc->y_dequant[q][rc] = (int16_t)vp9_ac_yquant(q);
pc->uv_dequant[q][rc] = (int16_t)vp9_ac_uv_quant(q, pc->uvac_delta_q); pc->uv_dequant[q][rc] = (int16_t)vp9_ac_uv_quant(q, pc->uv_ac_delta_q);
} }
} }
} }
...@@ -1202,9 +1202,9 @@ static void setup_quantization(VP9D_COMP *pbi, vp9_reader *r) { ...@@ -1202,9 +1202,9 @@ static void setup_quantization(VP9D_COMP *pbi, vp9_reader *r) {
VP9_COMMON *const pc = &pbi->common; VP9_COMMON *const pc = &pbi->common;
pc->base_qindex = vp9_read_literal(r, QINDEX_BITS); pc->base_qindex = vp9_read_literal(r, QINDEX_BITS);
if (get_delta_q(r, &pc->y1dc_delta_q) | if (get_delta_q(r, &pc->y_dc_delta_q) |
get_delta_q(r, &pc->uvdc_delta_q) | get_delta_q(r, &pc->uv_dc_delta_q) |
get_delta_q(r, &pc->uvac_delta_q)) get_delta_q(r, &pc->uv_ac_delta_q))
vp9_init_de_quantizer(pbi); vp9_init_de_quantizer(pbi);
mb_init_dequantizer(pbi, &pbi->mb); // MB level dequantizer setup mb_init_dequantizer(pbi, &pbi->mb); // MB level dequantizer setup
......
...@@ -2602,9 +2602,9 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, ...@@ -2602,9 +2602,9 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest,
vp9_write_literal(&header_bc, pc->base_qindex, QINDEX_BITS); vp9_write_literal(&header_bc, pc->base_qindex, QINDEX_BITS);
// Transmit Dc, Second order and Uv quantizer delta information // Transmit Dc, Second order and Uv quantizer delta information
put_delta_q(&header_bc, pc->y1dc_delta_q); put_delta_q(&header_bc, pc->y_dc_delta_q);
put_delta_q(&header_bc, pc->uvdc_delta_q); put_delta_q(&header_bc, pc->uv_dc_delta_q);
put_delta_q(&header_bc, pc->uvac_delta_q); put_delta_q(&header_bc, pc->uv_ac_delta_q);
// When there is a key frame all reference buffers are updated using the new key frame // When there is a key frame all reference buffers are updated using the new key frame
if (pc->frame_type != KEY_FRAME) { if (pc->frame_type != KEY_FRAME) {
......
...@@ -1227,14 +1227,14 @@ static void encode_frame_internal(VP9_COMP *cpi) { ...@@ -1227,14 +1227,14 @@ static void encode_frame_internal(VP9_COMP *cpi) {
#endif #endif
cpi->mb.e_mbd.lossless = (cm->base_qindex == 0 && cpi->mb.e_mbd.lossless = (cm->base_qindex == 0 &&
cm->y1dc_delta_q == 0 && cm->y_dc_delta_q == 0 &&
cm->uvdc_delta_q == 0 && cm->uv_dc_delta_q == 0 &&
cm->uvac_delta_q == 0); cm->uv_ac_delta_q == 0);
switch_lossless_mode(cpi, cpi->mb.e_mbd.lossless); switch_lossless_mode(cpi, cpi->mb.e_mbd.lossless);
vp9_frame_init_quantizer(cpi); vp9_frame_init_quantizer(cpi);
vp9_initialize_rd_consts(cpi, cm->base_qindex + cm->y1dc_delta_q); vp9_initialize_rd_consts(cpi, cm->base_qindex + cm->y_dc_delta_q);
vp9_initialize_me_consts(cpi, cm->base_qindex); vp9_initialize_me_consts(cpi, cm->base_qindex);
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) { if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
......
...@@ -505,7 +505,7 @@ void vp9_first_pass(VP9_COMP *cpi) { ...@@ -505,7 +505,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
// if ( 0 ) // if ( 0 )
{ {
vp9_init_mv_probs(cm); vp9_init_mv_probs(cm);
vp9_initialize_rd_consts(cpi, cm->base_qindex + cm->y1dc_delta_q); vp9_initialize_rd_consts(cpi, cm->base_qindex + cm->y_dc_delta_q);
} }
// for each macroblock row in image // for each macroblock row in image
......
...@@ -542,14 +542,14 @@ void vp9_init_quantizer(VP9_COMP *cpi) { ...@@ -542,14 +542,14 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
qrounding_factor = 64; qrounding_factor = 64;
} }
// dc values // dc values
quant_val = vp9_dc_quant(q, cpi->common.y1dc_delta_q); quant_val = vp9_dc_quant(q, cpi->common.y_dc_delta_q);
invert_quant(cpi->Y1quant[q] + 0, cpi->Y1quant_shift[q] + 0, quant_val); invert_quant(cpi->Y1quant[q] + 0, cpi->Y1quant_shift[q] + 0, quant_val);
cpi->Y1zbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7); cpi->Y1zbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
cpi->Y1round[q][0] = (qrounding_factor * quant_val) >> 7; cpi->Y1round[q][0] = (qrounding_factor * quant_val) >> 7;
cpi->common.y_dequant[q][0] = quant_val; cpi->common.y_dequant[q][0] = quant_val;
cpi->zrun_zbin_boost_y1[q][0] = (quant_val * zbin_boost[0]) >> 7; cpi->zrun_zbin_boost_y1[q][0] = (quant_val * zbin_boost[0]) >> 7;
quant_val = vp9_dc_uv_quant(q, cpi->common.uvdc_delta_q); quant_val = vp9_dc_uv_quant(q, cpi->common.uv_dc_delta_q);
invert_quant(cpi->UVquant[q] + 0, cpi->UVquant_shift[q] + 0, quant_val); invert_quant(cpi->UVquant[q] + 0, cpi->UVquant_shift[q] + 0, quant_val);
cpi->UVzbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7); cpi->UVzbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
cpi->UVround[q][0] = (qrounding_factor * quant_val) >> 7; cpi->UVround[q][0] = (qrounding_factor * quant_val) >> 7;
...@@ -568,7 +568,7 @@ void vp9_init_quantizer(VP9_COMP *cpi) { ...@@ -568,7 +568,7 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
cpi->zrun_zbin_boost_y1[q][i] = cpi->zrun_zbin_boost_y1[q][i] =
ROUND_POWER_OF_TWO(quant_val * zbin_boost[i], 7); ROUND_POWER_OF_TWO(quant_val * zbin_boost[i], 7);
quant_val = vp9_ac_uv_quant(q, cpi->common.uvac_delta_q); quant_val = vp9_ac_uv_quant(q, cpi->common.uv_ac_delta_q);
invert_quant(cpi->UVquant[q] + rc, cpi->UVquant_shift[q] + rc, quant_val); invert_quant(cpi->UVquant[q] + rc, cpi->UVquant_shift[q] + rc, quant_val);
cpi->UVzbin[q][rc] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7); cpi->UVzbin[q][rc] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
cpi->UVround[q][rc] = (qrounding_factor * quant_val) >> 7; cpi->UVround[q][rc] = (qrounding_factor * quant_val) >> 7;
...@@ -677,9 +677,9 @@ void vp9_set_quantizer(struct VP9_COMP *cpi, int Q) { ...@@ -677,9 +677,9 @@ void vp9_set_quantizer(struct VP9_COMP *cpi, int Q) {
// if any of the delta_q values are changing update flag will // if any of the delta_q values are changing update flag will
// have to be set. // have to be set.
cm->y1dc_delta_q = 0; cm->y_dc_delta_q = 0;
cm->uvdc_delta_q = 0; cm->uv_dc_delta_q = 0;
cm->uvac_delta_q = 0; cm->uv_ac_delta_q = 0;
// quantizer has to be reinitialized if any delta_q changes. // quantizer has to be reinitialized if any delta_q changes.
// As there are not any here for now this is inactive code. // As there are not any here for now this is inactive code.
......
...@@ -3383,7 +3383,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -3383,7 +3383,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int_mv seg_mvs[NB_PARTITIONINGS][16 /* n_blocks */][MAX_REF_FRAMES - 1]; int_mv seg_mvs[NB_PARTITIONINGS][16 /* n_blocks */][MAX_REF_FRAMES - 1];
int intra_cost_penalty = 20 * vp9_dc_quant(cpi->common.base_qindex, int intra_cost_penalty = 20 * vp9_dc_quant(cpi->common.base_qindex,
cpi->common.y1dc_delta_q); cpi->common.y_dc_delta_q);
struct scale_factors scale_factor[4]; struct scale_factors scale_factor[4];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment