shithub: libvpx

Download patch

ref: e4eb48f1bcd5f897c54f1a6e22396164ae2d1573
parent: 62830c53a644f5feaa49431b39c85093d2e387fc
parent: 8bb92e382de7d527f1f788cb0618aec485ffcee8
author: Urvang Joshi <[email protected]>
date: Wed Oct 17 16:25:02 EDT 2018

Merge "For keyframe-only coding do not boost in q mode"

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1216,10 +1216,16 @@
   ASSIGN_MINQ_TABLE(cm->bit_depth, inter_minq);
 
   if (frame_is_intra_only(cm)) {
-    // Handle the special case for key frames forced when we have reached
-    // the maximum key frame interval. Here force the Q to a range
-    // based on the ambient Q to reduce the risk of popping.
-    if (rc->this_key_frame_forced) {
+    if (rc->frames_to_key == 1 && oxcf->rc_mode == VPX_Q) {
+      // If the next frame is also a key frame or the current frame is the
+      // only frame in the sequence in AOM_Q mode, just use the cq_level
+      // as q.
+      active_best_quality = cq_level;
+      active_worst_quality = cq_level;
+    } else if (rc->this_key_frame_forced) {
+      // Handle the special case for key frames forced when we have reached
+      // the maximum key frame interval. Here force the Q to a range
+      // based on the ambient Q to reduce the risk of popping.
       double last_boosted_q;
       int delta_qindex;
       int qindex;