]> granicus.if.org Git - libvpx/commitdiff
Extend to 256 Q steps.
authorPaul Wilkins <paulwilkins@google.com>
Fri, 16 Dec 2011 10:23:01 +0000 (10:23 +0000)
committerPaul Wilkins <paulwilkins@google.com>
Mon, 19 Dec 2011 09:36:19 +0000 (09:36 +0000)
This commit extends the number of Q steps to 256 from 128.
The q_trans[] array has been altered to distribute available Q index values
(using the current 64 steps available as input parameters) evenly across the
available range. This is coupled with the fact that each Q step where possible
now equates to a fixed % change in the quantizer. This may want refinement
later especially in terms of the granularity at the high quality end but is a
reasonable starting point.

Change-Id: I2aaa6874fa10ce05c958dd182947ce39f6f1eecb

vp8/common/onyxc_int.h
vp8/common/quant_common.c
vp8/encoder/onyx_if.c

index 64c305a8d43c9ddf3a1d0b1526d928800988c95d..0e078ebb880ead29e498b2562c4996fe9c37e0a3 100644 (file)
@@ -33,13 +33,13 @@ void vp8_initialize_common(void);
 
 #define MINQ 0
 
-/*#if CONFIG_EXTEND_QRANGE
+#if CONFIG_EXTEND_QRANGE
 #define MAXQ 255
 #define QINDEX_BITS 8
-#else*/
+#else
 #define MAXQ 127
 #define QINDEX_BITS 7
-//#endif
+#endif
 
 
 #define QINDEX_RANGE (MAXQ + 1)
index 6c81607cccb85f0140c1c9832891734149a72627..f3569f962751ec30e54f4cdd2285ff237fac95c9 100644 (file)
@@ -89,7 +89,8 @@ void vp8_init_quant_tables()
     {
         ac_qlookup[i] = current_val;
         //current_val = (int)((double)current_val * 1.045);
-        current_val = (int)((double)current_val * 1.04);
+        //current_val = (int)((double)current_val * 1.04);
+        current_val = (int)((double)current_val * 1.018);
         if ( current_val == last_val )
             current_val++;
         last_val = current_val;
@@ -99,8 +100,8 @@ void vp8_init_quant_tables()
         dc_qlookup[i] = (0.000000305 * ac_val * ac_val * ac_val) +
                         (-0.00065 * ac_val * ac_val) +
                         (0.9 * ac_val) + 0.5;
-        if ( dc_qlookup[i] > dc_max )
-            dc_qlookup[i] = dc_max;
+        //if ( dc_qlookup[i] > dc_max )
+        //    dc_qlookup[i] = dc_max;
         if ( dc_qlookup[i] < ACDC_MIN )
             dc_qlookup[i] = ACDC_MIN;
     }
index 9a5ce38a629fbff59aa10880fc2df9cde25b5f0b..fe8f1ab7857037dbe496c0575735e324fa062e2b 100644 (file)
@@ -1857,7 +1857,7 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
 //
 // Table that converts 0-63 Q range values passed in outside to the Qindex
 // range used internally.
-/*#if CONFIG_EXTEND_QRANGE
+#if CONFIG_EXTEND_QRANGE
 static const int q_trans[] =
 {
      0,    4,   8,  12,  16,  20,  24,  28,
@@ -1869,7 +1869,7 @@ static const int q_trans[] =
     192, 196, 200, 204, 208, 212, 216, 220,
     224, 228, 232, 236, 240, 244, 249, 255,
 };
-#else*/
+#else
 static const int q_trans[] =
 {
     0,   1,  2,  3,  4,  5,  7,  8,
@@ -1881,7 +1881,7 @@ static const int q_trans[] =
     82,  85, 88, 91, 94, 97, 100, 103,
     106, 109, 112, 115, 118, 121, 124, 127,
 };
-//#endif
+#endif
 
 int vp8_reverse_trans(int x)
 {