[libav-commits] mpegvideo: make ff_release_unused_pictures() static

Anton Khirnov git at libav.org
Thu Dec 5 13:45:52 CET 2013


Module: libav
Branch: master
Commit: 282c6a1a0ef3e8c8e180c15b39cfe5b89704d848

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Sat Nov 30 18:07:06 2013 +0100

mpegvideo: make ff_release_unused_pictures() static

It is only called from one place in mpegvideo.c now. Also remove the
remove_current parameter, which is always 1.

---

 libavcodec/mpegvideo.c |    8 +++-----
 libavcodec/mpegvideo.h |    1 -
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 5648b82..4abf223 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -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) {
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index b6fc1bb..2b2bd88 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -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);



More information about the libav-commits mailing list