summaryrefslogtreecommitdiff
path: root/vp8/encoder/onyx_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r--vp8/encoder/onyx_if.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 7461edca4..cbaab5fb0 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -2704,6 +2704,19 @@ static int pick_frame_size(VP8_COMP *cpi)
}
}
+ /* Apply limits on keyframe target.
+ *
+ * TODO: move this after consolidating
+ * vp8_calc_iframe_target_size() and vp8_calc_auto_iframe_target_size()
+ */
+ if (cm->frame_type == KEY_FRAME && cpi->oxcf.rc_max_intra_bitrate_pct)
+ {
+ unsigned int max_rate = cpi->av_per_frame_bandwidth
+ * cpi->oxcf.rc_max_intra_bitrate_pct / 100;
+
+ if (cpi->this_frame_target > max_rate)
+ cpi->this_frame_target = max_rate;
+ }
return 1;
}