mpegvideo: make ff_release_unused_pictures() static
authorAnton Khirnov <anton@khirnov.net>
Sat, 30 Nov 2013 17:07:06 +0000 (18:07 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 5 Dec 2013 12:26:50 +0000 (13:26 +0100)
It is only called from one place in mpegvideo.c now. Also remove the
remove_current parameter, which is always 1.

libavcodec/mpegvideo.c
libavcodec/mpegvideo.h

index 5648b82..4abf223 100644 (file)
@@ -1348,16 +1348,14 @@ av_cold void ff_init_vlc_rl(RLTable *rl)
     }
 }
 
-void ff_release_unused_pictures(MpegEncContext*s, int remove_current)
+static void release_unused_pictures(MpegEncContext *s)
 {
     int i;
 
     /* release non reference frames */
     for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        if (!s->picture[i].reference &&
-            (remove_current || &s->picture[i] !=  s->current_picture_ptr)) {
+        if (!s->picture[i].reference)
             ff_mpeg_unref_picture(s, &s->picture[i]);
-        }
     }
 }
 
@@ -1460,7 +1458,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
     ff_mpeg_unref_picture(s, &s->current_picture);
 
     if (!s->encoding) {
-        ff_release_unused_pictures(s, 1);
+        release_unused_pictures(s);
 
         if (s->current_picture_ptr &&
             s->current_picture_ptr->f.buf[0] == NULL) {
index b6fc1bb..2b2bd88 100644 (file)
@@ -795,7 +795,6 @@ void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
 void ff_mpeg_flush(AVCodecContext *avctx);
 void ff_print_debug_info(MpegEncContext *s, Picture *p);
 void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
-void ff_release_unused_pictures(MpegEncContext *s, int remove_current);
 int ff_find_unused_picture(MpegEncContext *s, int shared);
 void ff_denoise_dct(MpegEncContext *s, int16_t *block);
 int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);