shithub: libvpx

Download patch

ref: 5a657908140f58fe9d5672cd6acd1666c71490fb
parent: 9b4d0e81a29dcc64392b3c75a117cff635375015
parent: ed30c8eff2dec9b065d00dc7a9d639eba251a9b7
author: Yaowu Xu <[email protected]>
date: Wed May 7 13:04:49 EDT 2014

Merge "Remove separate arf and gf minq tables."

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -45,11 +45,9 @@
 // Tables relating active max Q to active min Q
 static int kf_low_motion_minq[QINDEX_RANGE];
 static int kf_high_motion_minq[QINDEX_RANGE];
-static int gf_low_motion_minq[QINDEX_RANGE];
-static int gf_high_motion_minq[QINDEX_RANGE];
+static int arfgf_low_motion_minq[QINDEX_RANGE];
+static int arfgf_high_motion_minq[QINDEX_RANGE];
 static int inter_minq[QINDEX_RANGE];
-static int afq_low_motion_minq[QINDEX_RANGE];
-static int afq_high_motion_minq[QINDEX_RANGE];
 static int gf_high = 2000;
 static int gf_low = 400;
 static int kf_high = 5000;
@@ -83,10 +81,8 @@
     const double maxq = vp9_convert_qindex_to_q(i);
     kf_low_motion_minq[i] = get_minq_index(maxq, 0.000001, -0.0004, 0.125);
     kf_high_motion_minq[i] = get_minq_index(maxq, 0.000002, -0.0012, 0.50);
-    gf_low_motion_minq[i] = get_minq_index(maxq, 0.0000015, -0.0009, 0.30);
-    gf_high_motion_minq[i] = get_minq_index(maxq, 0.0000021, -0.00125, 0.50);
-    afq_low_motion_minq[i] = get_minq_index(maxq, 0.0000015, -0.0009, 0.30);
-    afq_high_motion_minq[i] = get_minq_index(maxq, 0.0000021, -0.00125, 0.55);
+    arfgf_low_motion_minq[i] = get_minq_index(maxq, 0.0000015, -0.0009, 0.30);
+    arfgf_high_motion_minq[i] = get_minq_index(maxq, 0.0000021, -0.00125, 0.50);
     inter_minq[i] = get_minq_index(maxq, 0.00000271, -0.00113, 0.90);
   }
 }
@@ -548,7 +544,7 @@
     }
     active_best_quality = get_active_quality(
         q, rc->gfu_boost, gf_low, gf_high,
-        gf_low_motion_minq, gf_high_motion_minq);
+        arfgf_low_motion_minq, arfgf_high_motion_minq);
   } else {
     // Use the lower of active_worst_quality and recent/average Q.
     if (cm->current_video_frame > 1) {
@@ -676,17 +672,12 @@
     if (oxcf->rc_mode == RC_MODE_CONSTRAINED_QUALITY) {
       if (q < cq_level)
         q = cq_level;
-      if (rc->frames_since_key > 1) {
-        active_best_quality = get_active_quality(q, rc->gfu_boost,
-                                                 gf_low, gf_high,
-                                                 afq_low_motion_minq,
-                                                 afq_high_motion_minq);
-      } else {
-        active_best_quality = get_active_quality(q, rc->gfu_boost,
-                                                 gf_low, gf_high,
-                                                 gf_low_motion_minq,
-                                                 gf_high_motion_minq);
-      }
+
+      active_best_quality = get_active_quality(q, rc->gfu_boost,
+                                               gf_low, gf_high,
+                                               arfgf_low_motion_minq,
+                                               arfgf_high_motion_minq);
+
       // Constrained quality use slightly lower active best.
       active_best_quality = active_best_quality * 15 / 16;
 
@@ -694,20 +685,14 @@
       if (!cpi->refresh_alt_ref_frame) {
         active_best_quality = cq_level;
       } else {
-        if (rc->frames_since_key > 1) {
-          active_best_quality = get_active_quality(
-              q, rc->gfu_boost, gf_low, gf_high,
-              afq_low_motion_minq, afq_high_motion_minq);
-        } else {
-          active_best_quality = get_active_quality(
-              q, rc->gfu_boost, gf_low, gf_high,
-              gf_low_motion_minq, gf_high_motion_minq);
-        }
+        active_best_quality = get_active_quality(
+            q, rc->gfu_boost, gf_low, gf_high,
+            arfgf_low_motion_minq, arfgf_high_motion_minq);
       }
     } else {
       active_best_quality = get_active_quality(
           q, rc->gfu_boost, gf_low, gf_high,
-          gf_low_motion_minq, gf_high_motion_minq);
+          arfgf_low_motion_minq, arfgf_high_motion_minq);
     }
   } else {
     if (oxcf->rc_mode == RC_MODE_CONSTANT_QUALITY) {
@@ -867,17 +852,12 @@
     if (oxcf->rc_mode == RC_MODE_CONSTRAINED_QUALITY) {
       if (q < cq_level)
         q = cq_level;
-      if (rc->frames_since_key > 1) {
-        active_best_quality = get_active_quality(q, rc->gfu_boost,
-                                                 gf_low, gf_high,
-                                                 afq_low_motion_minq,
-                                                 afq_high_motion_minq);
-      } else {
-        active_best_quality = get_active_quality(q, rc->gfu_boost,
-                                                 gf_low, gf_high,
-                                                 gf_low_motion_minq,
-                                                 gf_high_motion_minq);
-      }
+
+      active_best_quality = get_active_quality(q, rc->gfu_boost,
+                                               gf_low, gf_high,
+                                               arfgf_low_motion_minq,
+                                               arfgf_high_motion_minq);
+
       // Constrained quality use slightly lower active best.
       active_best_quality = active_best_quality * 15 / 16;
 
@@ -885,20 +865,14 @@
       if (!cpi->refresh_alt_ref_frame) {
         active_best_quality = cq_level;
       } else {
-        if (rc->frames_since_key > 1) {
-          active_best_quality = get_active_quality(
-              q, rc->gfu_boost, gf_low, gf_high,
-              afq_low_motion_minq, afq_high_motion_minq);
-        } else {
-          active_best_quality = get_active_quality(
-              q, rc->gfu_boost, gf_low, gf_high,
-              gf_low_motion_minq, gf_high_motion_minq);
-        }
+        active_best_quality = get_active_quality(
+            q, rc->gfu_boost, gf_low, gf_high,
+            arfgf_low_motion_minq, arfgf_high_motion_minq);
       }
     } else {
       active_best_quality = get_active_quality(
           q, rc->gfu_boost, gf_low, gf_high,
-          gf_low_motion_minq, gf_high_motion_minq);
+          arfgf_low_motion_minq, arfgf_high_motion_minq);
     }
   } else {
     if (oxcf->rc_mode == RC_MODE_CONSTANT_QUALITY) {