shithub: libvpx

Download patch

ref: d99e89084080c1d8060f926c0ccf28c9e6a3fdcb
parent: 949194db3b6b7733b15fbc6826ceb4969c242afe
author: Paul Wilkins <paulwilkins@google.com>
date: Thu Dec 19 10:27:44 EST 2013

Remove unused code and data structure.

Remove modified_error_used and adjust_active_maxq().

Change-Id: I8915007128dc1a17e11693104cfb008a6d64e6a2

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1157,7 +1157,6 @@
     start_pos = cpi->twopass.stats_in;  // Note starting "file" position
 
     cpi->twopass.modified_error_total = 0.0;
-    cpi->twopass.modified_error_used = 0.0;
 
     while (input_stats(cpi, &this_frame) != EOF) {
       cpi->twopass.modified_error_total +=
@@ -1855,9 +1854,6 @@
   // Reset the file position
   reset_fpf_position(cpi, start_pos);
 
-  // Update the record of error used so far (only done once per gf group)
-  cpi->twopass.modified_error_used += gf_group_err;
-
   // Assign  bits to the arf or gf.
   for (i = 0;
       i <= (cpi->rc.source_alt_ref_pending &&
@@ -2041,26 +2037,6 @@
 
   // Per frame bit target for this frame.
   cpi->rc.per_frame_bandwidth = target_frame_size;
-}
-
-// Make a damped adjustment to the active max q.
-static int adjust_active_maxq(int old_maxqi, int new_maxqi) {
-  int i;
-  const double old_q = vp9_convert_qindex_to_q(old_maxqi);
-  const double new_q = vp9_convert_qindex_to_q(new_maxqi);
-  const double target_q = ((old_q * 7.0) + new_q) / 8.0;
-
-  if (target_q > old_q) {
-    for (i = old_maxqi; i <= new_maxqi; i++)
-      if (vp9_convert_qindex_to_q(i) >= target_q)
-        return i;
-  } else {
-    for (i = old_maxqi; i >= new_maxqi; i--)
-      if (vp9_convert_qindex_to_q(i) <= target_q)
-        return i;
-  }
-
-  return new_maxqi;
 }
 
 void vp9_second_pass(VP9_COMP *cpi) {
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -533,7 +533,6 @@
     int64_t clip_bits_total;
     double avg_iiratio;
     double modified_error_total;
-    double modified_error_used;
     double modified_error_left;
     double kf_intra_err_min;
     double gf_intra_err_min;