]> granicus.if.org Git - libvpx/commitdiff
Correct rq_model_update when recode_count == 1
authorangiebird <angiebird@google.com>
Wed, 5 Aug 2020 19:16:50 +0000 (12:16 -0700)
committerangiebird <angiebird@google.com>
Thu, 6 Aug 2020 22:35:21 +0000 (15:35 -0700)
This will reduce the avg recode times per frame form
3.19 to 2.81 when targeting 15% error margin for
target bitrate per frame.

Change-Id: I28c9ec09a1b1318c09fe5229ccb7e51b32b9dfb9

vp9/encoder/vp9_encoder.c

index 458c2ae4bb3fa604a5f5b2a7523a5375be55e56f..7985e18d806e33fd647c5c016d3aea62669892bd 100644 (file)
@@ -4324,7 +4324,7 @@ static void rq_model_update(const RATE_QINDEX_HISTORY *rq_history,
       const double prev_q_step = vp9_convert_qindex_to_q(prev_q, VPX_BITS_8);
       const int actual_bits = rq_history->rate_history[recode_count - 1];
       rq_model->ratio =
-          rq_model->ratio - (target_bits - actual_bits) / log2(prev_q_step);
+          rq_model->ratio + (target_bits - actual_bits) / log2(prev_q_step);
     }
   }
 }