]> granicus.if.org Git - libvpx/commitdiff
1 pass VBR mode bug fix.
authorpaulwilkins <paulwilkins@google.com>
Tue, 15 Dec 2015 14:53:44 +0000 (14:53 +0000)
committerpaulwilkins <paulwilkins@google.com>
Tue, 15 Dec 2015 15:02:40 +0000 (15:02 +0000)
(copied from VP9)

The one pass VBR mode selects a Q range based on a
moving average of recent Q values. This calculation
should have been excluding arf overlay frames as these
are usually coded at the highest allowed value. Their
inclusion skews the average and can cause it to drift
upwards even when the clip as a whole is undershooting.

As such it can undermine correct adaptation of the allowed
Q range especially for easy content.

Change-Id: I9e12da84e12917e836b6e53ca4dfe4f150b9efb1

vp10/encoder/ratectrl.c

index 3ff24768db717050bfee542d73de92dc2d5b1f54..64244166cc3e2043b8cea9592df77b759137ae4c 100644 (file)
@@ -1254,7 +1254,7 @@ void vp10_rc_postencode_update(VP10_COMP *cpi, uint64_t bytes_used) {
     rc->avg_frame_qindex[KEY_FRAME] =
         ROUND_POWER_OF_TWO(3 * rc->avg_frame_qindex[KEY_FRAME] + qindex, 2);
   } else {
-    if (rc->is_src_frame_alt_ref ||
+    if (!rc->is_src_frame_alt_ref &&
         !(cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
       rc->last_q[INTER_FRAME] = qindex;
       rc->avg_frame_qindex[INTER_FRAME] =