diff options
author | paulwilkins <paulwilkins@google.com> | 2017-08-16 13:34:49 +0100 |
---|---|---|
committer | paulwilkins <paulwilkins@google.com> | 2017-08-16 14:33:59 +0100 |
commit | b814e2d898a6d10019cf1419569ca221214641f5 (patch) | |
tree | a369c14babdc06c762d792ef563591c2aa5fc063 /vp9/vp9_cx_iface.c | |
parent | 48110d0f7904bb04b4f70000721e96ed64bc6fb2 (diff) | |
download | libvpx-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/vp9_cx_iface.c')
-rw-r--r-- | vp9/vp9_cx_iface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index 876aef3e6..7b6aa4bf5 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -191,6 +191,13 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, (MAX_LAG_BUFFERS - 1)); } + // For formation of valid ARF groups lag_in _frames should be 0 or greater + // than the max_gf_interval + 2 + if (cfg->g_lag_in_frames > 0 && extra_cfg->max_gf_interval > 0 && + cfg->g_lag_in_frames < extra_cfg->max_gf_interval + 2) { + ERROR("Set lag in frames to 0 (low delay) or >= (max-gf-interval + 2)"); + } + if (cfg->rc_resize_allowed == 1) { RANGE_CHECK(cfg, rc_scaled_width, 0, cfg->g_w); RANGE_CHECK(cfg, rc_scaled_height, 0, cfg->g_h); |