diff options
author | Paul Wilkins <paulwilkins@google.com> | 2014-07-16 11:21:27 +0100 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2014-07-16 13:58:47 +0100 |
commit | b691230deaa7a771c35a6de2fd75e093ea31ba75 (patch) | |
tree | 6ce568584a352d2a4617636f4956e648c9af4cb9 /vp9/encoder/vp9_encoder.c | |
parent | e3e6e06155e3bdefac9775b6b50d84aaf1aca06c (diff) | |
download | libvpx-b691230deaa7a771c35a6de2fd75e093ea31ba75.tar libvpx-b691230deaa7a771c35a6de2fd75e093ea31ba75.tar.gz libvpx-b691230deaa7a771c35a6de2fd75e093ea31ba75.tar.bz2 libvpx-b691230deaa7a771c35a6de2fd75e093ea31ba75.zip |
Changes to rd balance and multi-arf bug fix.
2 pass only change to calculation of rd mult based on Q.
Make a small adjustment based on frame type and also
replace adjustment based on iifactor with an one based
on the ambient GF/ARF boost level.
Also fix multi arf bug / issue.
Overall these change give an slight improvement in ssim
but hurt psnr a little.
Change-Id: I5e1751e3ff5390a26f543d7855059e6fbcce105e
Diffstat (limited to 'vp9/encoder/vp9_encoder.c')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 1c514bab0..d5bad949c 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -742,9 +742,6 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) { cm->current_video_frame = 0; - // Set reference frame sign bias for ALTREF frame to 1 (for now) - cm->ref_frame_sign_bias[ALTREF_FRAME] = 1; - cpi->gold_is_last = 0; cpi->alt_is_last = 0; cpi->gold_is_alt = 0; @@ -2061,6 +2058,22 @@ static void configure_skippable_frame(VP9_COMP *cpi) { twopass->stats_in->pcnt_inter - twopass->stats_in->pcnt_motion == 1); } +static void set_arf_sign_bias(VP9_COMP *cpi) { + VP9_COMMON *const cm = &cpi->common; + int arf_sign_bias; + + if ((cpi->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; +} + static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size, uint8_t *dest, @@ -2093,8 +2106,8 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, cpi->zbin_mode_boost = 0; cpi->zbin_mode_boost_enabled = 0; - // Current default encoder behavior for the altref sign bias. - cm->ref_frame_sign_bias[ALTREF_FRAME] = cpi->rc.source_alt_ref_active; + // Set the arf sign bias for this frame. + set_arf_sign_bias(cpi); // Set default state for segment based loop filter update flags. cm->lf.mode_ref_delta_update = 0; |