shithub: libvpx

Download patch

ref: 2b3891d9daf9194bbf62dc246882e3ea9c5c4768
parent: 6cd63498969e57a7b8f0d98cbfc8c3ac9313be8f
author: Alex Converse <aconverse@google.com>
date: Thu Jan 16 06:38:45 EST 2014

Fix key frames for one pass.

Set this_key_frame_forced flag and don't use kf_boost when not set.

Change-Id: Ibe66a82fa9219e60db358ddeb43d6471816c8b50

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1965,7 +1965,10 @@
        cpi->rc.frames_to_key == 0 ||
        (cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) {
     cm->frame_type = KEY_FRAME;
+    cpi->rc.this_key_frame_forced = cm->current_video_frame != 0 &&
+                                    cpi->rc.frames_to_key == 0;
     cpi->rc.frames_to_key = cpi->key_frame_frequency;
+    cpi->rc.kf_boost = 300;
   } else {
     cm->frame_type = INTER_FRAME;
   }
@@ -1982,7 +1985,10 @@
       cpi->rc.frames_to_key == 0 ||
       (cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) {
     cm->frame_type = KEY_FRAME;
+    cpi->rc.this_key_frame_forced = cm->current_video_frame != 0 &&
+                                    cpi->rc.frames_to_key == 0;
     cpi->rc.frames_to_key = cpi->key_frame_frequency;
+    cpi->rc.kf_boost = 300;
   } else {
     cm->frame_type = INTER_FRAME;
   }
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -602,7 +602,7 @@
                                             (last_boosted_q * 0.75));
       active_best_quality = MAX(qindex + delta_qindex, rc->best_quality);
     } else if (!(cpi->pass == 0 && cm->current_video_frame == 0)) {
-      // not first frame of one pass
+      // not first frame of one pass and kf_boost is set
       double q_adj_factor = 1.0;
       double q_val;
 
--