Commit 7b3ca7ae authored by Michael Niedermayer's avatar Michael Niedermayer

mpegvideo/h264: drop period_since_free

This should not be needed anymore
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4c587b4f
...@@ -196,7 +196,6 @@ static void unref_picture(H264Context *h, Picture *pic) ...@@ -196,7 +196,6 @@ static void unref_picture(H264Context *h, Picture *pic)
if (!pic->f.data[0]) if (!pic->f.data[0])
return; return;
pic->period_since_free = 0;
ff_thread_release_buffer(h->avctx, &pic->tf); ff_thread_release_buffer(h->avctx, &pic->tf);
av_buffer_unref(&pic->hwaccel_priv_buf); av_buffer_unref(&pic->hwaccel_priv_buf);
...@@ -276,7 +275,6 @@ static int ref_picture(H264Context *h, Picture *dst, Picture *src) ...@@ -276,7 +275,6 @@ static int ref_picture(H264Context *h, Picture *dst, Picture *src)
dst->needs_realloc = src->needs_realloc; dst->needs_realloc = src->needs_realloc;
dst->reference = src->reference; dst->reference = src->reference;
dst->sync = src->sync; dst->sync = src->sync;
dst->period_since_free = src->period_since_free;
return 0; return 0;
fail: fail:
...@@ -395,10 +393,6 @@ fail: ...@@ -395,10 +393,6 @@ fail:
static inline int pic_is_unused(H264Context *h, Picture *pic) 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) if (pic->f.data[0] == NULL)
return 1; return 1;
if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF)) if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
...@@ -1727,7 +1721,6 @@ static int decode_update_thread_context(AVCodecContext *dst, ...@@ -1727,7 +1721,6 @@ static int decode_update_thread_context(AVCodecContext *dst,
h->low_delay = h1->low_delay; h->low_delay = h1->low_delay;
for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) { for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
h->DPB[i].period_since_free ++;
unref_picture(h, &h->DPB[i]); unref_picture(h, &h->DPB[i]);
if (h1->DPB[i].f.data[0] && if (h1->DPB[i].f.data[0] &&
(ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0) (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
......
...@@ -435,7 +435,6 @@ fail: ...@@ -435,7 +435,6 @@ fail:
void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic) void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)
{ {
int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean); int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean);
pic->period_since_free = 0;
pic->tf.f = &pic->f; pic->tf.f = &pic->f;
/* WM Image / Screen codecs allocate internal buffers with different /* WM Image / Screen codecs allocate internal buffers with different
...@@ -701,7 +700,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, ...@@ -701,7 +700,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
if (s1->picture[i].f.data[0] && if (s1->picture[i].f.data[0] &&
(ret = ff_mpeg_ref_picture(s, &s->picture[i], &s1->picture[i])) < 0) (ret = ff_mpeg_ref_picture(s, &s->picture[i], &s1->picture[i])) < 0)
return ret; return ret;
s->picture[i].period_since_free ++;
} }
#define UPDATE_PICTURE(pic)\ #define UPDATE_PICTURE(pic)\
...@@ -1400,10 +1398,6 @@ void ff_release_unused_pictures(MpegEncContext*s, int remove_current) ...@@ -1400,10 +1398,6 @@ void ff_release_unused_pictures(MpegEncContext*s, int remove_current)
static inline int pic_is_unused(MpegEncContext *s, Picture *pic) 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) if (pic == s->last_picture_ptr)
return 0; return 0;
if (pic->f.data[0] == NULL) if (pic->f.data[0] == NULL)
......
...@@ -171,7 +171,6 @@ typedef struct Picture{ ...@@ -171,7 +171,6 @@ typedef struct Picture{
int b_frame_score; /* */ int b_frame_score; /* */
int needs_realloc; ///< Picture needs to be reallocated (eg due to a frame size change) 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 reference;
int shared; int shared;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment