Renaming y1dc_delta_q, uvdc_delta_q, uvac_delta_q fields from VP9Common.
authorDmitry Kovalev <dkovalev@google.com>
Tue, 16 Apr 2013 22:05:52 +0000 (15:05 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 16 Apr 2013 22:05:52 +0000 (15:05 -0700)
New names are y_dc_delta_q, uv_dc_delta_q, uv_ac_delta_q.

Change-Id: I4acae1fc23a4697ce2c5a5becb8dc28ef0a4b552

vp9/common/vp9_onyxc_int.h
vp9/decoder/vp9_decodframe.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_firstpass.c
vp9/encoder/vp9_quantize.c
vp9/encoder/vp9_rdopt.c

index 71a4303..b8dec09 100644 (file)
@@ -228,9 +228,9 @@ typedef struct VP9Common {
   int base_qindex;
   int last_kf_gf_q;  /* Q used on the last GF or KF */
 
-  int y1dc_delta_q;
-  int uvdc_delta_q;
-  int uvac_delta_q;
+  int y_dc_delta_q;
+  int uv_dc_delta_q;
+  int uv_ac_delta_q;
 
   unsigned int frames_since_golden;
   unsigned int frames_till_alt_ref_frame;
index 6e32198..97112c0 100644 (file)
@@ -102,15 +102,15 @@ void vp9_init_de_quantizer(VP9D_COMP *pbi) {
   VP9_COMMON *const pc = &pbi->common;
 
   for (q = 0; q < QINDEX_RANGE; q++) {
-    pc->y_dequant[q][0] = (int16_t)vp9_dc_quant(q, pc->y1dc_delta_q);
-    pc->uv_dequant[q][0] = (int16_t)vp9_dc_uv_quant(q, pc->uvdc_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->uv_dc_delta_q);
 
     /* all the ac values =; */
     for (i = 1; i < 16; i++) {
       const int rc = vp9_default_zig_zag1d_4x4[i];
 
       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) {
   VP9_COMMON *const pc = &pbi->common;
 
   pc->base_qindex = vp9_read_literal(r, QINDEX_BITS);
-  if (get_delta_q(r, &pc->y1dc_delta_q) |
-      get_delta_q(r, &pc->uvdc_delta_q) |
-      get_delta_q(r, &pc->uvac_delta_q))
+  if (get_delta_q(r, &pc->y_dc_delta_q) |
+      get_delta_q(r, &pc->uv_dc_delta_q) |
+      get_delta_q(r, &pc->uv_ac_delta_q))
     vp9_init_de_quantizer(pbi);
 
   mb_init_dequantizer(pbi, &pbi->mb);  // MB level dequantizer setup
index 406bfd2..e47f543 100644 (file)
@@ -2602,9 +2602,9 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest,
   vp9_write_literal(&header_bc, pc->base_qindex, QINDEX_BITS);
 
   // Transmit Dc, Second order and Uv quantizer delta information
-  put_delta_q(&header_bc, pc->y1dc_delta_q);
-  put_delta_q(&header_bc, pc->uvdc_delta_q);
-  put_delta_q(&header_bc, pc->uvac_delta_q);
+  put_delta_q(&header_bc, pc->y_dc_delta_q);
+  put_delta_q(&header_bc, pc->uv_dc_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
   if (pc->frame_type != KEY_FRAME) {
index b76baf5..b98e5ed 100644 (file)
@@ -1227,14 +1227,14 @@ static void encode_frame_internal(VP9_COMP *cpi) {
 #endif
 
   cpi->mb.e_mbd.lossless = (cm->base_qindex == 0 &&
-                            cm->y1dc_delta_q == 0 &&
-                            cm->uvdc_delta_q == 0 &&
-                            cm->uvac_delta_q == 0);
+                            cm->y_dc_delta_q == 0 &&
+                            cm->uv_dc_delta_q == 0 &&
+                            cm->uv_ac_delta_q == 0);
   switch_lossless_mode(cpi, cpi->mb.e_mbd.lossless);
 
   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);
 
   if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
index 8ddcc9d..f6525c5 100644 (file)
@@ -505,7 +505,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
   // if ( 0 )
   {
     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
index 1401bd6..80d9849 100644 (file)
@@ -542,14 +542,14 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
       qrounding_factor = 64;
     }
     // 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);
     cpi->Y1zbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
     cpi->Y1round[q][0] = (qrounding_factor * quant_val) >> 7;
     cpi->common.y_dequant[q][0] = quant_val;
     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);
     cpi->UVzbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
     cpi->UVround[q][0] = (qrounding_factor * quant_val) >> 7;
@@ -568,7 +568,7 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
       cpi->zrun_zbin_boost_y1[q][i] =
           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);
       cpi->UVzbin[q][rc] = ROUND_POWER_OF_TWO(qzbin_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) {
 
   // if any of the delta_q values are changing update flag will
   // have to be set.
-  cm->y1dc_delta_q = 0;
-  cm->uvdc_delta_q = 0;
-  cm->uvac_delta_q = 0;
+  cm->y_dc_delta_q = 0;
+  cm->uv_dc_delta_q = 0;
+  cm->uv_ac_delta_q = 0;
 
   // quantizer has to be reinitialized if any delta_q changes.
   // As there are not any here for now this is inactive code.
index 4b59fa1..e8b1b49 100644 (file)
@@ -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 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];