]> granicus.if.org Git - libvpx/commitdiff
Update for key frame target size setting.
authorMarco Paniconi <marpan@google.com>
Mon, 12 Mar 2012 23:23:08 +0000 (16:23 -0700)
committerMarco Paniconi <marpan@google.com>
Mon, 12 Mar 2012 23:23:08 +0000 (16:23 -0700)
Set an iniital/minimun boost level for the frame rate
factor of key frame target size setting.

Change-Id: If2586f4ac76a1fa89378aa652a58607356a1f426

vp8/encoder/ratectrl.c

index f4ed30026e77ef5bec20f845a35a5e2b915d1f29..fc340ee235f1ab8269604dfb388ef7567b5dbc1e 100644 (file)
@@ -392,13 +392,14 @@ static void calc_iframe_target_size(VP8_COMP *cpi)
         int Q = (cpi->common.frame_flags & FRAMEFLAGS_KEY)
                 ? cpi->avg_frame_qindex : cpi->ni_av_qi;
 
+        int initial_boost = 24; // Corresponds to: |2.5 * per_frame_bandwidth|
         // Boost depends somewhat on frame rate: only used for 1 layer case.
         if (cpi->oxcf.number_of_layers == 1) {
-          kf_boost = (int)(2 * cpi->output_frame_rate - 16);
+          kf_boost = MAX(initial_boost, (int)(2 * cpi->output_frame_rate - 16));
         }
         else {
           // Initial factor: set target size to: |2.5 * per_frame_bandwidth|.
-          kf_boost = 24;
+          kf_boost = initial_boost;
         }
 
         // adjustment up based on q: this factor ranges from ~1.2 to 2.2.