]> granicus.if.org Git - libvpx/commitdiff
Only allow allow_exhaustive_searches for FC_GRAPHICS_ANIMATION content
authorYunqing Wang <yunqingwang@google.com>
Wed, 19 Apr 2017 23:32:59 +0000 (16:32 -0700)
committerYunqing Wang <yunqingwang@google.com>
Thu, 20 Apr 2017 00:03:27 +0000 (00:03 +0000)
The allow_exhaustive_searches feature improves the encoding quality
of FC_GRAPHICS_ANIMATION content a lot. For non-FC_GRAPHICS_ANIMATION
content, the quality test result is almost neutral. This patch makes
this feature to be used only for FC_GRAPHICS_ANIMATION content.

The motivation of doing that is to make this feature no longer adaptive,
which will be implemented in the following patch.

Change-Id: Ic911df6dd757402b6480789cc247801e99840369

vp9/encoder/vp9_speed_features.c

index f74b6b0e9e3db899a3087749a8ca83f9af56b3e6..609fcdbced6cec69551e38e419b3b26a0a09a7eb 100644 (file)
@@ -720,32 +720,30 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
   cpi->full_search_sad = vp9_full_search_sad;
   cpi->diamond_search_sad = vp9_diamond_search_sad;
 
-  sf->allow_exhaustive_searches = 1;
-  if (oxcf->mode == BEST) {
-    if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION)
+  if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) {
+    sf->allow_exhaustive_searches = 1;
+    if (oxcf->mode == BEST) {
       sf->exhaustive_searches_thresh = (1 << 20);
-    else
-      sf->exhaustive_searches_thresh = (1 << 21);
-    sf->max_exaustive_pct = 100;
-    for (i = 0; i < MAX_MESH_STEP; ++i) {
-      sf->mesh_patterns[i].range = best_quality_mesh_pattern[i].range;
-      sf->mesh_patterns[i].interval = best_quality_mesh_pattern[i].interval;
-    }
-  } else {
-    int speed = (oxcf->speed > MAX_MESH_SPEED) ? MAX_MESH_SPEED : oxcf->speed;
-    if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION)
+      sf->max_exaustive_pct = 100;
+      for (i = 0; i < MAX_MESH_STEP; ++i) {
+        sf->mesh_patterns[i].range = best_quality_mesh_pattern[i].range;
+        sf->mesh_patterns[i].interval = best_quality_mesh_pattern[i].interval;
+      }
+    } else {
+      int speed = (oxcf->speed > MAX_MESH_SPEED) ? MAX_MESH_SPEED : oxcf->speed;
       sf->exhaustive_searches_thresh = (1 << 22);
-    else
-      sf->exhaustive_searches_thresh = (1 << 23);
-    sf->max_exaustive_pct = good_quality_max_mesh_pct[speed];
-    if (speed > 0)
-      sf->exhaustive_searches_thresh = sf->exhaustive_searches_thresh << 1;
-
-    for (i = 0; i < MAX_MESH_STEP; ++i) {
-      sf->mesh_patterns[i].range = good_quality_mesh_patterns[speed][i].range;
-      sf->mesh_patterns[i].interval =
-          good_quality_mesh_patterns[speed][i].interval;
+      sf->max_exaustive_pct = good_quality_max_mesh_pct[speed];
+      if (speed > 0)
+        sf->exhaustive_searches_thresh = sf->exhaustive_searches_thresh << 1;
+
+      for (i = 0; i < MAX_MESH_STEP; ++i) {
+        sf->mesh_patterns[i].range = good_quality_mesh_patterns[speed][i].range;
+        sf->mesh_patterns[i].interval =
+            good_quality_mesh_patterns[speed][i].interval;
+      }
     }
+  } else {
+    sf->allow_exhaustive_searches = 0;
   }
 
   // Slow quant, dct and trellis not worthwhile for first pass