diff options
author | paulwilkins <paulwilkins@google.com> | 2017-12-04 13:41:44 +0000 |
---|---|---|
committer | paulwilkins <paulwilkins@google.com> | 2017-12-08 10:05:36 +0000 |
commit | f1ce050f44c7f91ee941155c7e080e6640b12781 (patch) | |
tree | 7a54409c61441a2738e8f1994cf3f1d65598c273 | |
parent | 8099220e6c5e2cc8c857f85e1429d857c87a6f2a (diff) | |
download | libvpx-f1ce050f44c7f91ee941155c7e080e6640b12781.tar libvpx-f1ce050f44c7f91ee941155c7e080e6640b12781.tar.gz libvpx-f1ce050f44c7f91ee941155c7e080e6640b12781.tar.bz2 libvpx-f1ce050f44c7f91ee941155c7e080e6640b12781.zip |
Bug fix for second reference stats.
Immediately following a key frame the trailing second reference
error in the first pass stats will be based on a reference frame from
the prior key frame group and will thus usually be much larger.
This fix eliminates that effect (which typically triggers a short arf
group immediately after a key frame). It also changes the accounting
for the first frame in each new arf group.
This change gives large gains on a couple of clips that contain mid
sequence key frames (e.g. 6% on 1080P tennis). Overall there was
a net gain in PSNR and PSNR-HVS ~(0.05- 0.4%) and mixed results for
SSIM (+/- 0.2%).
Change-Id: I8e00538ac2c0b5c2e7e637903cac329ce5c2a375
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index b4c46014c..eefbdff51 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2543,8 +2543,11 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { // Update the accumulator for second ref error difference. // This is intended to give an indication of how much the coded error is // increasing over time. - sr_accumulator += (next_frame.sr_coded_error - next_frame.coded_error); - sr_accumulator = VPXMAX(0.0, sr_accumulator); + if (i == 1) { + sr_accumulator += next_frame.coded_error; + } else { + sr_accumulator += (next_frame.sr_coded_error - next_frame.coded_error); + } } // Break out conditions. |