shithub: libvpx

Download patch

ref: 67e3972faf1557f0aa06b89af5c1afa2386dbf7a
parent: 17f2474ea4da381d78fa52a1b3ffd664aecf9094
author: Johann <[email protected]>
date: Mon Nov 4 11:45:56 EST 2019

remove unused cpi parameters from firstpass.c

BUG=webm:1612

Change-Id: I77db5f9f2cb8244cca831b76c00926112c3e0dfe

--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -113,11 +113,9 @@
   return 1;
 }
 
-static void output_stats(const VP8_COMP *cpi,
-                         struct vpx_codec_pkt_list *pktlist,
+static void output_stats(struct vpx_codec_pkt_list *pktlist,
                          FIRSTPASS_STATS *stats) {
   struct vpx_codec_cx_pkt pkt;
-  (void)cpi;
   pkt.kind = VPX_CODEC_STATS_PKT;
   pkt.data.twopass_stats.buf = stats;
   pkt.data.twopass_stats.sz = sizeof(FIRSTPASS_STATS);
@@ -371,11 +369,10 @@
 }
 
 void vp8_end_first_pass(VP8_COMP *cpi) {
-  output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.total_stats);
+  output_stats(cpi->output_pkt_list, &cpi->twopass.total_stats);
 }
 
-static void zz_motion_search(VP8_COMP *cpi, MACROBLOCK *x,
-                             YV12_BUFFER_CONFIG *raw_buffer,
+static void zz_motion_search(MACROBLOCK *x, YV12_BUFFER_CONFIG *raw_buffer,
                              int *raw_motion_err,
                              YV12_BUFFER_CONFIG *recon_buffer,
                              int *best_motion_err, int recon_yoffset) {
@@ -389,7 +386,6 @@
   int raw_stride = raw_buffer->y_stride;
   unsigned char *ref_ptr;
   int ref_stride = x->e_mbd.pre.y_stride;
-  (void)cpi;
 
   /* Set up pointers for this macro block raw buffer */
   raw_ptr = (unsigned char *)(raw_buffer->y_buffer + recon_yoffset + d->offset);
@@ -603,9 +599,8 @@
         int raw_motion_error = INT_MAX;
 
         /* Simple 0,0 motion with no mv overhead */
-        zz_motion_search(cpi, x, cpi->last_frame_unscaled_source,
-                         &raw_motion_error, lst_yv12, &motion_error,
-                         recon_yoffset);
+        zz_motion_search(x, cpi->last_frame_unscaled_source, &raw_motion_error,
+                         lst_yv12, &motion_error, recon_yoffset);
         d->bmi.mv.as_mv.row = 0;
         d->bmi.mv.as_mv.col = 0;
 
@@ -798,7 +793,7 @@
 
     /* don't want to do output stats with a stack variable! */
     memcpy(&cpi->twopass.this_frame_stats, &fps, sizeof(FIRSTPASS_STATS));
-    output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.this_frame_stats);
+    output_stats(cpi->output_pkt_list, &cpi->twopass.this_frame_stats);
     accumulate_stats(&cpi->twopass.total_stats, &fps);
   }
 
@@ -1337,12 +1332,10 @@
 /* This function gives and estimate of how badly we believe the prediction
  * quality is decaying from frame to frame.
  */
-static double get_prediction_decay_rate(VP8_COMP *cpi,
-                                        FIRSTPASS_STATS *next_frame) {
+static double get_prediction_decay_rate(FIRSTPASS_STATS *next_frame) {
   double prediction_decay_rate;
   double motion_decay;
   double motion_pct = next_frame->pcnt_motion;
-  (void)cpi;
 
   /* Initial basis is the % mbs inter coded */
   prediction_decay_rate = next_frame->pcnt_inter;
@@ -1399,7 +1392,7 @@
     for (j = 0; j < still_interval; ++j) {
       if (EOF == input_stats(cpi, &tmp_next_frame)) break;
 
-      decay_rate = get_prediction_decay_rate(cpi, &tmp_next_frame);
+      decay_rate = get_prediction_decay_rate(&tmp_next_frame);
       if (decay_rate < 0.999) break;
     }
     /* Reset file position */
@@ -1450,8 +1443,7 @@
 }
 
 /* Update the motion related elements to the GF arf boost calculation */
-static void accumulate_frame_motion_stats(VP8_COMP *cpi,
-                                          FIRSTPASS_STATS *this_frame,
+static void accumulate_frame_motion_stats(FIRSTPASS_STATS *this_frame,
                                           double *this_frame_mv_in_out,
                                           double *mv_in_out_accumulator,
                                           double *abs_mv_in_out_accumulator,
@@ -1459,7 +1451,6 @@
   double this_frame_mvr_ratio;
   double this_frame_mvc_ratio;
   double motion_pct;
-  (void)cpi;
 
   /* Accumulate motion stats. */
   motion_pct = this_frame->pcnt_motion;
@@ -1542,7 +1533,7 @@
 
     /* Update the motion related elements to the boost calculation */
     accumulate_frame_motion_stats(
-        cpi, &this_frame, &this_frame_mv_in_out, &mv_in_out_accumulator,
+        &this_frame, &this_frame_mv_in_out, &mv_in_out_accumulator,
         &abs_mv_in_out_accumulator, &mv_ratio_accumulator);
 
     /* Calculate the baseline boost number for this frame */
@@ -1557,7 +1548,7 @@
     /* Cumulative effect of prediction quality decay */
     if (!flash_detected) {
       decay_accumulator =
-          decay_accumulator * get_prediction_decay_rate(cpi, &this_frame);
+          decay_accumulator * get_prediction_decay_rate(&this_frame);
       decay_accumulator = decay_accumulator < 0.1 ? 0.1 : decay_accumulator;
     }
     boost_score += (decay_accumulator * r);
@@ -1586,7 +1577,7 @@
 
     /* Update the motion related elements to the boost calculation */
     accumulate_frame_motion_stats(
-        cpi, &this_frame, &this_frame_mv_in_out, &mv_in_out_accumulator,
+        &this_frame, &this_frame_mv_in_out, &mv_in_out_accumulator,
         &abs_mv_in_out_accumulator, &mv_ratio_accumulator);
 
     /* Calculate the baseline boost number for this frame */
@@ -1601,7 +1592,7 @@
     /* Cumulative effect of prediction quality decay */
     if (!flash_detected) {
       decay_accumulator =
-          decay_accumulator * get_prediction_decay_rate(cpi, &this_frame);
+          decay_accumulator * get_prediction_decay_rate(&this_frame);
       decay_accumulator = decay_accumulator < 0.1 ? 0.1 : decay_accumulator;
     }
 
@@ -1703,7 +1694,7 @@
 
     /* Update the motion related elements to the boost calculation */
     accumulate_frame_motion_stats(
-        cpi, &next_frame, &this_frame_mv_in_out, &mv_in_out_accumulator,
+        &next_frame, &this_frame_mv_in_out, &mv_in_out_accumulator,
         &abs_mv_in_out_accumulator, &mv_ratio_accumulator);
 
     /* Calculate a baseline boost number for this frame */
@@ -1711,7 +1702,7 @@
 
     /* Cumulative effect of prediction quality decay */
     if (!flash_detected) {
-      loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame);
+      loop_decay_rate = get_prediction_decay_rate(&next_frame);
       decay_accumulator = decay_accumulator * loop_decay_rate;
       decay_accumulator = decay_accumulator < 0.1 ? 0.1 : decay_accumulator;
     }
@@ -2599,7 +2590,7 @@
       }
 
       /* How fast is prediction quality decaying */
-      loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame);
+      loop_decay_rate = get_prediction_decay_rate(&next_frame);
 
       /* We want to know something about the recent past... rather than
        * as used elsewhere where we are concened with decay in prediction
@@ -2781,7 +2772,7 @@
     if (r > RMAX) r = RMAX;
 
     /* How fast is prediction quality decaying */
-    loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame);
+    loop_decay_rate = get_prediction_decay_rate(&next_frame);
 
     decay_accumulator = decay_accumulator * loop_decay_rate;
     decay_accumulator = decay_accumulator < 0.1 ? 0.1 : decay_accumulator;