mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/vp9: Remove vp9_free_entries()
Now that the mutexes and conditions are only initialized and destroyed once, said function only had one purpose: free the entries array. Given that vp9_alloc_entries() already does this if the array is already allocated it is unnecessary to call vp9_free_entries() anywhere except when closing. And then one can just inline the one free into vp9_decode_free(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
b0ee627ef9
commit
95b681eafd
@ -45,14 +45,6 @@ DEFINE_OFFSET_ARRAY(VP9Context, vp9_context, pthread_init_cnt,
|
|||||||
(offsetof(VP9Context, progress_mutex)),
|
(offsetof(VP9Context, progress_mutex)),
|
||||||
(offsetof(VP9Context, progress_cond)));
|
(offsetof(VP9Context, progress_cond)));
|
||||||
|
|
||||||
static void vp9_free_entries(AVCodecContext *avctx) {
|
|
||||||
VP9Context *s = avctx->priv_data;
|
|
||||||
|
|
||||||
if (avctx->active_thread_type & FF_THREAD_SLICE) {
|
|
||||||
av_freep(&s->entries);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vp9_alloc_entries(AVCodecContext *avctx, int n) {
|
static int vp9_alloc_entries(AVCodecContext *avctx, int n) {
|
||||||
VP9Context *s = avctx->priv_data;
|
VP9Context *s = avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
@ -88,7 +80,6 @@ static void vp9_await_tile_progress(VP9Context *s, int field, int n) {
|
|||||||
pthread_mutex_unlock(&s->progress_mutex);
|
pthread_mutex_unlock(&s->progress_mutex);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static void vp9_free_entries(AVCodecContext *avctx) {}
|
|
||||||
static int vp9_alloc_entries(AVCodecContext *avctx, int n) { return 0; }
|
static int vp9_alloc_entries(AVCodecContext *avctx, int n) { return 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -794,7 +785,6 @@ static int decode_frame_header(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
s->s.h.tiling.tile_cols = 1 << s->s.h.tiling.log2_tile_cols;
|
s->s.h.tiling.tile_cols = 1 << s->s.h.tiling.log2_tile_cols;
|
||||||
vp9_free_entries(avctx);
|
|
||||||
s->active_tile_cols = avctx->active_thread_type == FF_THREAD_SLICE ?
|
s->active_tile_cols = avctx->active_thread_type == FF_THREAD_SLICE ?
|
||||||
s->s.h.tiling.tile_cols : 1;
|
s->s.h.tiling.tile_cols : 1;
|
||||||
vp9_alloc_entries(avctx, s->sb_rows);
|
vp9_alloc_entries(avctx, s->sb_rows);
|
||||||
@ -1249,8 +1239,8 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free_buffers(s);
|
free_buffers(s);
|
||||||
vp9_free_entries(avctx);
|
|
||||||
#if HAVE_THREADS
|
#if HAVE_THREADS
|
||||||
|
av_freep(&s->entries);
|
||||||
ff_pthread_free(s, vp9_context_offsets);
|
ff_pthread_free(s, vp9_context_offsets);
|
||||||
#endif
|
#endif
|
||||||
av_freep(&s->td);
|
av_freep(&s->td);
|
||||||
|
Loading…
Reference in New Issue
Block a user