]> granicus.if.org Git - libvpx/commitdiff
QRange experiements.
authorPaul Wilkins <paulwilkins@google.com>
Thu, 15 Dec 2011 18:22:42 +0000 (18:22 +0000)
committerPaul Wilkins <paulwilkins@google.com>
Mon, 19 Dec 2011 09:35:10 +0000 (09:35 +0000)
High Q end extended a little.
Some clean up.

Slightly better on SSIM, Slightly worse on PSNR over derf set.

Change-Id: I3dceea8a39e11c26e1a389a40e40b86efc76d28c

vp8/common/quant_common.c
vp8/encoder/firstpass.c
vp8/encoder/onyx_if.c

index 2b5488a497c2521cd8917cca8305a1581eeecf66..6c81607cccb85f0140c1c9832891734149a72627 100644 (file)
@@ -38,30 +38,6 @@ static const int ac_qlookup[QINDEX_RANGE] =
 };
 #else
 /*static int dc_qlookup[QINDEX_RANGE] =
-{
-      4,    5,    6,    7,    8,    9,   10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
-     20,   22,   24,   26,   28,   30,   32,   34,   36,   38,   40,   38,   40,   42,   44,   47,
-     50,   53,   56,   59,   62,   65,   68,   68,   72,   76,   80,   80,   84,   84,   86,   90,
-     91,   96,   98,  102,  107,  112,  118,  124,  130,  136,  142,  148,  150,  156,  162,  168,
-    174,  180,  182,  188,  196,  200,  204,  208,  212,  216,  220,  224,  228,  232,  236,  240,
-    244,  249,  255,  260,  264,  269,  276,  281,  288,  293,  300,  303,  307,  312,  317,  323,
-    328,  331,  338,  344,  347,  354,  366,  378,  386,  398,  401,  411,  422,  432,  441,  451,
-    464,  483,  496,  507,  520,  529,  540,  551,  570,  585,  604,  624,  645,  667,  692,  718,
-
-};
-static int ac_qlookup[QINDEX_RANGE] =
-{
-    4,    5,    6,    7,    8,    9,    10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
-    20,   22,   24,   26,   28,   30,   32,   34,   36,   38,   40,   42,   44,   46,   48,   51,
-    54,   57,   60,   63,   66,   69,   72,   76,   80,   84,   88,   92,   96,   100,  105,  110,
-    115,  120,  125,  130,  135,  140,  146,  152,  158,  164,  170,  176,  182,  188,  194,  200,
-    206,  212,  218,  224,  232,  240,  248,  256,  264,  272,  280,  288,  296,  304,  312,  320,
-    330,  340,  350,  360,  370,  380,  392,  404,  416,  428,  440,  454,  468,  482,  496,  510,
-    524,  540,  556,  572,  588,  604,  622,  640,  658,  676,  696,  716,  736,  756,  776,  796,
-    820,  844,  868,  892,  916,  944,  972,  1000, 1032, 1064, 1096, 1128, 1168, 1208, 1252, 1300
-};*/
-
-static int dc_qlookup[QINDEX_RANGE] =
 {
     4,    5,    6,    7,    8,    9,    10,   10,   11,   12,   13,   14,   15,   16,   17,   17,
     18,   19,   20,   20,   21,   21,   22,   22,   23,   23,   24,   25,   25,   26,   27,   28,
@@ -83,10 +59,10 @@ static int ac_qlookup[QINDEX_RANGE] =
     110,  112,  114,  116,  119,  122,  125,  128,  131,  134,  137,  140,  143,  146,  149,  152,
     155,  158,  161,  164,  167,  170,  173,  177,  181,  185,  189,  193,  197,  201,  205,  209,
     213,  217,  221,  225,  229,  234,  239,  245,  249,  254,  259,  264,  269,  274,  279,  284,
-};
+};*/
 
-//static int dc_qlookup[QINDEX_RANGE];
-//static int ac_qlookup[QINDEX_RANGE];
+static int dc_qlookup[QINDEX_RANGE];
+static int ac_qlookup[QINDEX_RANGE];
 
 #endif
 
@@ -95,25 +71,25 @@ static int ac_qlookup[QINDEX_RANGE] =
 void vp8_init_quant_tables()
 {
     int i;
-    int current_val = 4;
-    int last_val = 4;
+    int current_val = 16;
+    int last_val = 16;
     int ac_val;
     int dc_max;
 
-    for ( i = 0; i < QINDEX_RANGE; i++ )
+    /*for ( i = 0; i < QINDEX_RANGE; i++ )
     {
         ac_qlookup[i] = ac_qlookup[i] << 2;
         dc_qlookup[i] = dc_qlookup[i] << 2;
     }
 
     // Not active by default for now.
-    return;
+    return;*/
 
     for ( i = 0; i < QINDEX_RANGE; i++ )
     {
         ac_qlookup[i] = current_val;
-        current_val = (int)((double)current_val * 1.042);
-        //current_val = (int)((double)current_val * 1.01765);
+        //current_val = (int)((double)current_val * 1.045);
+        current_val = (int)((double)current_val * 1.04);
         if ( current_val == last_val )
             current_val++;
         last_val = current_val;
index b35b89450d21c11a61052b31a9bbf2b82f5536cb..901404617edd886be83461bf2c20352958c45b61 100644 (file)
@@ -951,7 +951,7 @@ static double adjust_maxq_qrange(VP8_COMP *cpi)
             break;
     }
 }
-
+#define ERR_DEVISOR   150.0
 static int estimate_max_q(VP8_COMP *cpi,
                           FIRSTPASS_STATS * fpstats,
                           int section_target_bandwitdh,
@@ -1025,7 +1025,7 @@ static int estimate_max_q(VP8_COMP *cpi,
 
         // Error per MB based correction factor
         err_correction_factor =
-            calc_correction_factor(err_per_mb, 150.0, 0.36, 0.90, Q);
+            calc_correction_factor(err_per_mb, ERR_DEVISOR, 0.36, 0.90, Q);
 
         bits_per_mb_at_this_q =
             vp8_bits_per_mb(INTER_FRAME, Q) + overhead_bits_per_mb;
@@ -1188,7 +1188,7 @@ static int estimate_q(VP8_COMP *cpi, double section_err, int section_target_band
 
         // Error per MB based correction factor
         err_correction_factor =
-            calc_correction_factor(err_per_mb, 150.0, 0.36, 0.90, Q);
+            calc_correction_factor(err_per_mb, ERR_DEVISOR, 0.36, 0.90, Q);
 
         bits_per_mb_at_this_q =
             (int)( .5 + ( err_correction_factor *
@@ -1262,7 +1262,7 @@ static int estimate_kf_group_q(VP8_COMP *cpi, double section_err, int section_ta
     {
         // Error per MB based correction factor
         err_correction_factor =
-            calc_correction_factor(err_per_mb, 150.0, pow_lowq, pow_highq, Q);
+            calc_correction_factor(err_per_mb, ERR_DEVISOR, pow_lowq, pow_highq, Q);
 
         bits_per_mb_at_this_q =
             (int)(.5 + ( err_correction_factor *
index 4b97ed4fea75e4144a4d659ae8e41b068fcc1ef7..9a5ce38a629fbff59aa10880fc2df9cde25b5f0b 100644 (file)
@@ -159,30 +159,6 @@ extern void (*vp8_short_fdct8x4)(short *input, short *output, int pitch);
 
 extern void vp8cx_init_quantizer(VP8_COMP *cpi);
 
-/*#if CONFIG_EXTEND_QRANGE
-int vp8cx_base_skip_false_prob[QINDEX_RANGE];
-#else
-int vp8cx_base_skip_false_prob[QINDEX_RANGE] =
-{
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    251, 248, 244, 240, 236, 232, 229, 225,
-    221, 217, 213, 208, 204, 199, 194, 190,
-    187, 183, 179, 175, 172, 168, 164, 160,
-    157, 153, 149, 145, 142, 138, 134, 130,
-    127, 124, 120, 117, 114, 110, 107, 104,
-    101, 98,  95,  92,  89,  86,  83, 80,
-    77,  74,  71,  68,  65,  62,  59, 56,
-    53,  50,  47,  44,  41,  38,  35, 32,
-    30,  28,  26,  24,  22,  20,  18, 16,
-
-};
-#endif*/
 int vp8cx_base_skip_false_prob[QINDEX_RANGE];
 
 // Tables relating active max Q to active min Q