]> granicus.if.org Git - libvpx/commitdiff
Adjust rate allocation in non-RD coding mode
authorJingning Han <jingning@google.com>
Tue, 1 Apr 2014 19:55:20 +0000 (12:55 -0700)
committerJingning Han <jingning@google.com>
Wed, 2 Apr 2014 16:51:22 +0000 (09:51 -0700)
This commit reduces the frequency of frames using finer quantizer
in non-RD coding flow, and slightly tune up the quantizer resolution
when used. It provides 1.7% compression gains in speed -5 at no speed
difference.

Change-Id: I430249a51260a841a0402666e5ec1566e4f7d5a6

vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_ratectrl.c
vp9/encoder/vp9_speed_features.c
vp9/encoder/vp9_speed_features.h

index b517d6cfeec686764b65991ae1b62a68b436ca8c..099add730133353d5ff87270bac1b848450dabd1 100644 (file)
@@ -193,9 +193,8 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
   int var = cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride,
                                pd->dst.buf, pd->dst.stride, &sse);
 
-  vp9_model_rd_from_var_lapndz(var + sse, 1 << num_pels_log2_lookup[bs],
+  vp9_model_rd_from_var_lapndz(sse + var, 1 << num_pels_log2_lookup[bs],
                                pd->dequant[1] >> 3, &rate, &dist);
-
   *out_rate_sum = rate;
   *out_dist_sum = dist << 3;
 }
index 55a558122e796507479e4ab16544917eb3051c58..e39c18cd6f3eb0c511cc657332e00a30d3ec0471 100644 (file)
@@ -985,8 +985,8 @@ int vp9_rc_pick_q_and_bounds(const VP9_COMP *cpi,
       q /= 3;
     if (q == 0)
       q++;
-    if (cpi->sf.partition_check == 1)
-      q -= 10;
+    if (cpi->sf.force_ref_frame == 1)
+      q -= 15;
 
     if (q < *bottom_index)
       *bottom_index = q;
index f090350775f747b838979111aad0674717341367..6a5c4e998333182dda0056b087aa5e9b4c5a7c21 100644 (file)
@@ -251,6 +251,9 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
     sf->min_partition_size = BLOCK_8X8;
     sf->partition_check =
         (cm->current_video_frame % sf->last_partitioning_redo_frequency == 1);
+    sf->force_ref_frame =
+        (cm->current_video_frame %
+            (sf->last_partitioning_redo_frequency << 1) == 1);
     sf->partition_search_type = REFERENCE_PARTITION;
     sf->use_nonrd_pick_mode = 1;
     sf->search_method = FAST_DIAMOND;
@@ -303,6 +306,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
   sf->last_partitioning_redo_frequency = 4;
   sf->disable_split_mask = 0;
   sf->mode_search_skip_flags = 0;
+  sf->force_ref_frame = 0;
   sf->disable_split_var_thresh = 0;
   sf->disable_filter_search_var_thresh = 0;
   for (i = 0; i < TX_SIZES; i++) {
index 5091e2b06d6680953d2b7bd2c6ebca3f61f9dc4d..78bf40f45cad1745f8856ee0fe52948e271fe9b3 100644 (file)
@@ -252,6 +252,10 @@ typedef struct {
   // encoding process for RTC.
   int partition_check;
 
+  // Use finer quantizer in every other few frames that run variable block
+  // partition type search.
+  int force_ref_frame;
+
   // Implements various heuristics to skip searching modes
   // The heuristics selected are based on  flags
   // defined in the MODE_SEARCH_SKIP_HEURISTICS enum