diff options
author | Jingning Han <jingning@google.com> | 2018-08-20 17:03:07 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2018-08-20 17:07:59 -0700 |
commit | 0de8be5a777a76b39d5c201c1b807fae81c9ea9d (patch) | |
tree | d79b980b60316c218f3bdb355234cbb0d4e1fb26 /vp9/encoder | |
parent | ba1a52b9cb81b4dbeccdfbcfca6a821846c61758 (diff) | |
download | libvpx-0de8be5a777a76b39d5c201c1b807fae81c9ea9d.tar libvpx-0de8be5a777a76b39d5c201c1b807fae81c9ea9d.tar.gz libvpx-0de8be5a777a76b39d5c201c1b807fae81c9ea9d.tar.bz2 libvpx-0de8be5a777a76b39d5c201c1b807fae81c9ea9d.zip |
Unify set_arf_sign_bias function
Determine if an ARF is on the future side by checking if its
offset meets the gop frame length. This unifies the support to
single- and multiple-layer ARF cases.
Change-Id: I5ab26f54311c345a9b574ffca5ff0a8dbcf4c031
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index ff147a8e6..98da31956 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4517,18 +4517,14 @@ YV12_BUFFER_CONFIG *vp9_scale_if_required( static void set_arf_sign_bias(VP9_COMP *cpi) { VP9_COMMON *const cm = &cpi->common; - int arf_sign_bias; - - if ((cpi->oxcf.pass == 2) && cpi->multi_arf_allowed) { - const GF_GROUP *const gf_group = &cpi->twopass.gf_group; - arf_sign_bias = cpi->rc.source_alt_ref_active && - (!cpi->refresh_alt_ref_frame || - (gf_group->rf_level[gf_group->index] == GF_ARF_LOW)); - } else { - arf_sign_bias = - (cpi->rc.source_alt_ref_active && !cpi->refresh_alt_ref_frame); - } - cm->ref_frame_sign_bias[ALTREF_FRAME] = arf_sign_bias; + const GF_GROUP *const gf_group = &cpi->twopass.gf_group; + const int gfg_index = gf_group->index; + + // If arf_src_offset is less than the GOP length, its arf is on the direction + // 1 side. + cm->ref_frame_sign_bias[ALTREF_FRAME] = + cpi->rc.source_alt_ref_active && + gf_group->arf_src_offset[gfg_index] < cpi->rc.baseline_gf_interval - 1; } static int setup_interp_filter_search_mask(VP9_COMP *cpi) { |