]> granicus.if.org Git - libvpx/commitdiff
Remove rate correction factor.
authorPaul Wilkins <paulwilkins@google.com>
Fri, 6 Dec 2013 13:17:34 +0000 (13:17 +0000)
committerPaul Wilkins <paulwilkins@google.com>
Fri, 6 Dec 2013 16:57:16 +0000 (16:57 +0000)
Removed an adaptive rate correction factor that was having
a negative impact on quality in many clips. This factor
was influencing the Q range available to each frame
independently of the bits allocated to each.

Average results with DISABLE_RC_LONG_TERM_MEM.

derf +0.199, -0.059.
yt +3.957, +3.798
std hd +1.577, +2.140
yt hd +4.127, +4.513

Average results without  DISABLE_RC_LONG_TERM_MEM

derf -0.628, -0.665
yt +3.432, +3.015
std hd -0.105, +0.153
yt hd +3.432, +3.015

Change-Id: I45bab6b606f49a442e7b27a6d631f3ffd843bbce

vp9/encoder/vp9_firstpass.c
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_onyx_int.h

index 60830d00c0886c40fcece1fee8fcf32c5542b16d..3f194b221ce37ed40a52d8a754f4ccc1e1060ca2 100644 (file)
@@ -1030,22 +1030,6 @@ static int estimate_max_q(VP9_COMP *cpi,
     sr_correction = 0.75;
   }
 
-  // Calculate a corrective factor based on a rolling ratio of bits spent
-  // vs target bits
-  if (cpi->rc.rolling_target_bits > 0 &&
-      cpi->rc.active_worst_quality < cpi->rc.worst_quality) {
-    double rolling_ratio = (double)cpi->rc.rolling_actual_bits /
-                               (double)cpi->rc.rolling_target_bits;
-
-    if (rolling_ratio < 0.95)
-      cpi->twopass.est_max_qcorrection_factor -= 0.005;
-    else if (rolling_ratio > 1.05)
-      cpi->twopass.est_max_qcorrection_factor += 0.005;
-
-    cpi->twopass.est_max_qcorrection_factor = fclamp(
-        cpi->twopass.est_max_qcorrection_factor, 0.1, 10.0);
-  }
-
   // Corrections for higher compression speed settings
   // (reduced compression expected)
   // FIXME(jimbankoski): Once we settle on vp9 speed features we need to
@@ -1062,8 +1046,7 @@ static int estimate_max_q(VP9_COMP *cpi,
 
     err_correction_factor = calc_correction_factor(err_per_mb,
                                                    ERR_DIVISOR, 0.4, 0.90, q) *
-                                sr_correction * speed_correction *
-                                cpi->twopass.est_max_qcorrection_factor;
+                                sr_correction * speed_correction;
 
     bits_per_mb_at_this_q = vp9_rc_bits_per_mb(INTER_FRAME, q,
                                                err_correction_factor);
@@ -2168,7 +2151,6 @@ void vp9_second_pass(VP9_COMP *cpi) {
     if (cpi->common.current_video_frame == 0) {
       int section_target_bandwidth =
           (int)(cpi->twopass.bits_left / frames_left);
-      cpi->twopass.est_max_qcorrection_factor = 1.0;
 
       // guess at maxq needed in 2nd pass
       cpi->twopass.maxq_max_limit = cpi->rc.worst_quality;
index d40fc66737c66938af22c6aa396c727a818f0f70..f476ae970d1682b69881d40bb6b4cc63f0db0a3a 100644 (file)
@@ -1632,7 +1632,6 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
   cpi->rc.rate_correction_factor         = 1.0;
   cpi->rc.key_frame_rate_correction_factor = 1.0;
   cpi->rc.gf_rate_correction_factor  = 1.0;
-  cpi->twopass.est_max_qcorrection_factor  = 1.0;
 
   cal_nmvjointsadcost(cpi->mb.nmvjointsadcost);
   cpi->mb.nmvcost[0] = &cpi->mb.nmvcosts[0][MV_MAX];
@@ -2617,7 +2616,7 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
   if (cpi->twopass.total_left_stats.coded_error != 0.0)
     fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %10d"
         "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f"
-        "%6d %6d %5d %5d %5d %8.2f %10d %10.3f"
+        "%6d %6d %5d %5d %5d %10d %10.3f"
         "%10.3f %8d %10d %10d %10d\n",
         cpi->common.current_video_frame, cpi->rc.this_frame_target,
         cpi->rc.projected_frame_size, 0,
@@ -2632,7 +2631,7 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
         vp9_convert_qindex_to_q(cpi->cq_target_quality),
         cpi->refresh_last_frame, cpi->refresh_golden_frame,
         cpi->refresh_alt_ref_frame, cm->frame_type, cpi->rc.gfu_boost,
-        cpi->twopass.est_max_qcorrection_factor, (int)cpi->twopass.bits_left,
+        (int)cpi->twopass.bits_left,
         cpi->twopass.total_left_stats.coded_error,
         (double)cpi->twopass.bits_left /
             (1 + cpi->twopass.total_left_stats.coded_error),
index c6315653eb85475809caeb2d005ffc4beb1dd6b7..526192215b55b4e0d46815f8429e0f10286c3146 100644 (file)
@@ -569,7 +569,6 @@ typedef struct VP9_COMP {
     int alt_extra_bits;
 
     int sr_update_lag;
-    double est_max_qcorrection_factor;
   } twopass;
 
   YV12_BUFFER_CONFIG alt_ref_buffer;