]> granicus.if.org Git - libvpx/commitdiff
Reduced y_dequant, uv_dequant size
authorScott LaVarnway <slavarnway@google.com>
Wed, 1 May 2013 20:25:10 +0000 (16:25 -0400)
committerScott LaVarnway <slavarnway@google.com>
Wed, 1 May 2013 20:25:10 +0000 (16:25 -0400)
Currently, only two values are used.  Removed the unused
values.

Change-Id: Idc5b8be354d84ffc68df39ea3e45f9f50d977b35

vp9/common/vp9_onyxc_int.h
vp9/decoder/vp9_decodframe.c
vp9/encoder/vp9_quantize.c

index 96ceca26a37d11eedc43cb9ed46d21d8abbe139f..c8dd6ebf7423b902c31a59c00a22b4288c9cfee3 100644 (file)
@@ -174,8 +174,8 @@ typedef enum {
 typedef struct VP9Common {
   struct vpx_internal_error_info  error;
 
-  DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][16]);
-  DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][16]);
+  DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][2]);
+  DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][2]);
 
   int width;
   int height;
index f561c48501f56d831956eb529b5af457e18a54e2..522ea9f5ba124849fc2fd7ed90a6a9074aee8691 100644 (file)
@@ -164,7 +164,7 @@ static vp9_prob read_prob_diff_update(vp9_reader *r, int oldp) {
 }
 
 void vp9_init_dequantizer(VP9_COMMON *pc) {
-  int q, i;
+  int q;
 
   for (q = 0; q < QINDEX_RANGE; q++) {
     // DC value
@@ -172,12 +172,8 @@ void vp9_init_dequantizer(VP9_COMMON *pc) {
     pc->uv_dequant[q][0] = vp9_dc_quant(q, pc->uv_dc_delta_q);
 
     // AC values
-    for (i = 1; i < 16; i++) {
-      const int rc = vp9_default_zig_zag1d_4x4[i];
-
-      pc->y_dequant[q][rc] = vp9_ac_quant(q, 0);
-      pc->uv_dequant[q][rc] = vp9_ac_quant(q, pc->uv_ac_delta_q);
-    }
+    pc->y_dequant[q][1] = vp9_ac_quant(q, 0);
+    pc->uv_dequant[q][1] = vp9_ac_quant(q, pc->uv_ac_delta_q);
   }
 }
 
index b36a4bc34923cc8db41486b6612104887d2df08d..5b401d7f348577368cea83530b2008b3ec8b85ce 100644 (file)
@@ -266,6 +266,7 @@ static void invert_quant(int16_t *quant, uint8_t *shift, int d) {
 void vp9_init_quantizer(VP9_COMP *cpi) {
   int i;
   int quant_val;
+  int quant_uv_val;
   int q;
 
   static const int zbin_boost[16] = { 0,  0,  0,  8,  8,  8, 10, 12,
@@ -293,25 +294,26 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
     cpi->common.uv_dequant[q][0] = quant_val;
     cpi->zrun_zbin_boost_uv[q][0] = (quant_val * zbin_boost[0]) >> 7;
 
+    quant_val = vp9_ac_quant(q, 0);
+    cpi->common.y_dequant[q][1] = quant_val;
+    quant_uv_val = vp9_ac_quant(q, cpi->common.uv_ac_delta_q);
+    cpi->common.uv_dequant[q][1] = quant_uv_val;
     // all the 4x4 ac values =;
     for (i = 1; i < 16; i++) {
       int rc = vp9_default_zig_zag1d_4x4[i];
 
-      quant_val = vp9_ac_quant(q, 0);
       invert_quant(cpi->Y1quant[q] + rc, cpi->Y1quant_shift[q] + rc, quant_val);
       cpi->Y1zbin[q][rc] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
       cpi->Y1round[q][rc] = (qrounding_factor * quant_val) >> 7;
-      cpi->common.y_dequant[q][rc] = quant_val;
       cpi->zrun_zbin_boost_y1[q][i] =
           ROUND_POWER_OF_TWO(quant_val * zbin_boost[i], 7);
 
-      quant_val = vp9_ac_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;
-      cpi->common.uv_dequant[q][rc] = quant_val;
+      invert_quant(cpi->UVquant[q] + rc, cpi->UVquant_shift[q] + rc,
+        quant_uv_val);
+      cpi->UVzbin[q][rc] = ROUND_POWER_OF_TWO(qzbin_factor * quant_uv_val, 7);
+      cpi->UVround[q][rc] = (qrounding_factor * quant_uv_val) >> 7;
       cpi->zrun_zbin_boost_uv[q][i] =
-          ROUND_POWER_OF_TWO(quant_val * zbin_boost[i], 7);
+          ROUND_POWER_OF_TWO(quant_uv_val * zbin_boost[i], 7);
     }
   }
 }