summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorpaulwilkins <paulwilkins@google.com>2017-08-16 13:34:49 +0100
committerpaulwilkins <paulwilkins@google.com>2017-08-16 14:33:59 +0100
commitb814e2d898a6d10019cf1419569ca221214641f5 (patch)
treea369c14babdc06c762d792ef563591c2aa5fc063 /vp9/encoder
parent48110d0f7904bb04b4f70000721e96ed64bc6fb2 (diff)
downloadlibvpx-b814e2d898a6d10019cf1419569ca221214641f5.tar
libvpx-b814e2d898a6d10019cf1419569ca221214641f5.tar.gz
libvpx-b814e2d898a6d10019cf1419569ca221214641f5.tar.bz2
libvpx-b814e2d898a6d10019cf1419569ca221214641f5.zip
Prevent parameters that can cause invalid ARF groups.
Having a very low "lag_in_frames" value could cause the encoder to create incorrect / corrupt ARF groups including displayed frames that update the ARF buffer and false overlay frames that are coded at low rate but are not actually overlays of a real ARF frame. This is linked to a reported unit test "slow down" where the chosen parameters (lag of 3 frames) gave rise to such "broken" ARF group(s). See also BUG=webm:1454 Change-Id: If52d0236243ed5552537d1ea9ed3fed8c867232c
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encoder.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index d4c7597c6..d735fe08b 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -867,9 +867,10 @@ static INLINE int denoise_svc(const struct VP9_COMP *const cpi) {
}
#endif
+#define MIN_LOOKAHEAD_FOR_ARFS 4
static INLINE int is_altref_enabled(const VP9_COMP *const cpi) {
return !(cpi->oxcf.mode == REALTIME && cpi->oxcf.rc_mode == VPX_CBR) &&
- cpi->oxcf.lag_in_frames > 0 &&
+ cpi->oxcf.lag_in_frames >= MIN_LOOKAHEAD_FOR_ARFS &&
(cpi->oxcf.enable_auto_arf &&
(!is_two_pass_svc(cpi) ||
cpi->oxcf.ss_enable_auto_arf[cpi->svc.spatial_layer_id]));