summaryrefslogtreecommitdiff
path: root/vp8/encoder
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2012-02-22 14:39:17 -0800
committerMarco Paniconi <marpan@google.com>2012-02-22 15:25:32 -0800
commit507ee87e3e24db80322944d8a2481d3db8b6beeb (patch)
tree345da33f8c13cc45e1c3595f0270433b7b5805ba /vp8/encoder
parent2b0aee4b5def280d4e27c11d1b95ecd8545eed34 (diff)
downloadlibvpx-507ee87e3e24db80322944d8a2481d3db8b6beeb.tar
libvpx-507ee87e3e24db80322944d8a2481d3db8b6beeb.tar.gz
libvpx-507ee87e3e24db80322944d8a2481d3db8b6beeb.tar.bz2
libvpx-507ee87e3e24db80322944d8a2481d3db8b6beeb.zip
Remove the frame rate factor for key frame size.
When temporal layers is used (i.e., number_of_layers > 1), we don't use the frame rate boost for setting the key frame target size. The factor was forcing the target size to be always at its minimum (2* per_frame_bandwidth) for low frame rates (i.e., base layer frame rate). Generally we should modify or remove this frame rate factor; for now we turn if off for number_of_layers > 1. Change-Id: Ia5acf406c9b2f634d30ac2473adc7b9bf2e7e6c6
Diffstat (limited to 'vp8/encoder')
-rw-r--r--vp8/encoder/ratectrl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index 1c43c1171..f4ed30026 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -392,10 +392,16 @@ 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;
- // Boost depends somewhat on frame rate
- kf_boost = (int)(2 * cpi->output_frame_rate - 16);
+ // 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);
+ }
+ else {
+ // Initial factor: set target size to: |2.5 * per_frame_bandwidth|.
+ kf_boost = 24;
+ }
- // adjustment up based on q
+ // adjustment up based on q: this factor ranges from ~1.2 to 2.2.
kf_boost = kf_boost * kf_boost_qadjustment[Q] / 100;
// frame separation adjustment ( down)
@@ -403,6 +409,7 @@ static void calc_iframe_target_size(VP8_COMP *cpi)
kf_boost = (int)(kf_boost
* cpi->frames_since_key / (cpi->output_frame_rate / 2));
+ // Minimal target size is |2* per_frame_bandwidth|.
if (kf_boost < 16)
kf_boost = 16;