summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2019-05-22 16:42:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-05-22 16:42:54 +0000
commitd17961f0fe28d23500398fc81b8407d14036f521 (patch)
tree9b91e7151f3d6a344e695005c5ec2575a7843c4f
parent197827edb87eb9387d946af999366c4ec5f0d88e (diff)
parent85493c1a0a0b450856a1304066602f5b36593c4d (diff)
downloadlibvpx-d17961f0fe28d23500398fc81b8407d14036f521.tar
libvpx-d17961f0fe28d23500398fc81b8407d14036f521.tar.gz
libvpx-d17961f0fe28d23500398fc81b8407d14036f521.tar.bz2
libvpx-d17961f0fe28d23500398fc81b8407d14036f521.zip
Merge "Clamp for min_frame_target"
-rw-r--r--vp9/encoder/vp9_ratectrl.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index c0d84f775..c16529b35 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -211,17 +211,15 @@ int vp9_rc_clamp_pframe_target_size(const VP9_COMP *const cpi, int target) {
const RATE_CONTROL *rc = &cpi->rc;
const VP9EncoderConfig *oxcf = &cpi->oxcf;
- if (cpi->oxcf.pass != 2) {
- const int min_frame_target =
- VPXMAX(rc->min_frame_bandwidth, rc->avg_frame_bandwidth >> 5);
- if (target < min_frame_target) target = min_frame_target;
- if (cpi->refresh_golden_frame && rc->is_src_frame_alt_ref) {
- // If there is an active ARF at this location use the minimum
- // bits on this frame even if it is a constructed arf.
- // The active maximum quantizer insures that an appropriate
- // number of bits will be spent if needed for constructed ARFs.
- target = min_frame_target;
- }
+ const int min_frame_target =
+ VPXMAX(rc->min_frame_bandwidth, rc->avg_frame_bandwidth >> 5);
+ if (target < min_frame_target) target = min_frame_target;
+ if (cpi->refresh_golden_frame && rc->is_src_frame_alt_ref) {
+ // If there is an active ARF at this location use the minimum
+ // bits on this frame even if it is a constructed arf.
+ // The active maximum quantizer insures that an appropriate
+ // number of bits will be spent if needed for constructed ARFs.
+ target = min_frame_target;
}
// Clip the frame target to the maximum allowed value.