[FFmpeg-cvslog] mpegvideo/h264: drop period_since_free

Michael Niedermayer git at videolan.org
Tue Mar 26 20:37:42 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 26 19:27:32 2013 +0100| [7b3ca7ae8b514bca290f97e996c5f189e60a7a74] | committer: Michael Niedermayer

mpegvideo/h264: drop period_since_free

This should not be needed anymore

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b3ca7ae8b514bca290f97e996c5f189e60a7a74
---

 libavcodec/h264.c      |    7 -------
 libavcodec/mpegvideo.c |    6 ------
 libavcodec/mpegvideo.h |    1 -
 3 files changed, 14 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 51f34c5..8a8653e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -196,7 +196,6 @@ static void unref_picture(H264Context *h, Picture *pic)
     if (!pic->f.data[0])
         return;
 
-    pic->period_since_free = 0;
     ff_thread_release_buffer(h->avctx, &pic->tf);
     av_buffer_unref(&pic->hwaccel_priv_buf);
 
@@ -276,7 +275,6 @@ static int ref_picture(H264Context *h, Picture *dst, Picture *src)
     dst->needs_realloc           = src->needs_realloc;
     dst->reference               = src->reference;
     dst->sync                    = src->sync;
-    dst->period_since_free       = src->period_since_free;
 
     return 0;
 fail:
@@ -395,10 +393,6 @@ fail:
 
 static inline int pic_is_unused(H264Context *h, Picture *pic)
 {
-    if (   (h->avctx->active_thread_type & FF_THREAD_FRAME)
-        && pic->f.qscale_table //check if the frame has anything allocated
-        && pic->period_since_free < h->avctx->thread_count)
-        return 0;
     if (pic->f.data[0] == NULL)
         return 1;
     if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
@@ -1727,7 +1721,6 @@ static int decode_update_thread_context(AVCodecContext *dst,
     h->low_delay            = h1->low_delay;
 
     for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
-        h->DPB[i].period_since_free ++;
         unref_picture(h, &h->DPB[i]);
         if (h1->DPB[i].f.data[0] &&
             (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index fdec4c6..2e37ef1 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -435,7 +435,6 @@ fail:
 void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)
 {
     int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean);
-    pic->period_since_free = 0;
 
     pic->tf.f = &pic->f;
     /* WM Image / Screen codecs allocate internal buffers with different
@@ -701,7 +700,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
         if (s1->picture[i].f.data[0] &&
             (ret = ff_mpeg_ref_picture(s, &s->picture[i], &s1->picture[i])) < 0)
             return ret;
-        s->picture[i].period_since_free ++;
     }
 
 #define UPDATE_PICTURE(pic)\
@@ -1400,10 +1398,6 @@ void ff_release_unused_pictures(MpegEncContext*s, int remove_current)
 
 static inline int pic_is_unused(MpegEncContext *s, Picture *pic)
 {
-    if (   (s->avctx->active_thread_type & FF_THREAD_FRAME)
-        && pic->f.qscale_table //check if the frame has anything allocated
-        && pic->period_since_free < s->avctx->thread_count)
-        return 0;
     if (pic == s->last_picture_ptr)
         return 0;
     if (pic->f.data[0] == NULL)
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 3ffab0a..46470df 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -171,7 +171,6 @@ typedef struct Picture{
 
     int b_frame_score;          /* */
     int needs_realloc;          ///< Picture needs to be reallocated (eg due to a frame size change)
-    int period_since_free;      ///< "cycles" since this Picture has been freed
 
     int reference;
     int shared;



More information about the ffmpeg-cvslog mailing list