]> granicus.if.org Git - libvpx/commitdiff
Removing lookup_next_frame_stats().
authorDmitry Kovalev <dkovalev@google.com>
Fri, 22 Aug 2014 00:14:45 +0000 (17:14 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Fri, 22 Aug 2014 00:14:45 +0000 (17:14 -0700)
Change-Id: Ib6b51b3d106de38a9ccbcd4a835025db185877e9

vp9/encoder/vp9_firstpass.c

index 94bbe9c697de8b9f749559aa7e934543257d02d9..308acb4f30c994146a66934b1e4ba4894c5446fa 100644 (file)
@@ -76,16 +76,6 @@ static void reset_fpf_position(TWO_PASS *p,
   p->stats_in = position;
 }
 
-static int lookup_next_frame_stats(const TWO_PASS *p,
-                                   FIRSTPASS_STATS *next_frame) {
-  if (p->stats_in >= p->stats_in_end)
-    return EOF;
-
-  *next_frame = *p->stats_in;
-  return 1;
-}
-
-
 // Read frame stats at an offset from the current position.
 static const FIRSTPASS_STATS *read_frame_stats(const TWO_PASS *p, int offset) {
   if ((offset >= 0 && p->stats_in + offset >= p->stats_in_end) ||
@@ -1874,16 +1864,17 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
     input_stats(twopass, this_frame);
 
     // Provided that we are not at the end of the file...
-    if (cpi->oxcf.auto_key &&
-        lookup_next_frame_stats(twopass, &next_frame) != EOF) {
+    if (cpi->oxcf.auto_key && twopass->stats_in < twopass->stats_in_end) {
       double loop_decay_rate;
 
       // Check for a scene cut.
-      if (test_candidate_kf(twopass, &last_frame, this_frame, &next_frame))
+      if (test_candidate_kf(twopass, &last_frame, this_frame,
+                            twopass->stats_in))
         break;
 
       // How fast is the prediction quality decaying?
-      loop_decay_rate = get_prediction_decay_rate(&cpi->common, &next_frame);
+      loop_decay_rate = get_prediction_decay_rate(&cpi->common,
+                                                  twopass->stats_in);
 
       // We want to know something about the recent past... rather than
       // as used elsewhere where we are concerned with decay in prediction