From 1ad7c1f2504bf6d7487e36ca099e0ea38e72285e Mon Sep 17 00:00:00 2001
From: Dmitry Kovalev <dkovalev@google.com>
Date: Tue, 16 Apr 2013 15:05:52 -0700
Subject: [PATCH] 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
---
 vp9/common/vp9_onyxc_int.h    |  6 +++---
 vp9/decoder/vp9_decodframe.c  | 12 ++++++------
 vp9/encoder/vp9_bitstream.c   |  6 +++---
 vp9/encoder/vp9_encodeframe.c |  8 ++++----
 vp9/encoder/vp9_firstpass.c   |  2 +-
 vp9/encoder/vp9_quantize.c    | 12 ++++++------
 vp9/encoder/vp9_rdopt.c       |  2 +-
 7 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index 71a4303410..b8dec09e2f 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -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;
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index 6e32198d84..97112c0ce2 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -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
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 406bfd219e..e47f543de2 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -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) {
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index b76baf5880..b98e5eddac 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -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) {
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 8ddcc9da74..f6525c5196 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -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
diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c
index 1401bd64e5..80d9849653 100644
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -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.
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 4b59fa17e1..e8b1b49011 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -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];
 
-- 
GitLab