diff options
author | Anton Khirnov <anton@khirnov.net> | 2017-01-09 18:04:42 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-04-10 15:24:54 +0200 |
commit | 1f4cf92cfbd3accbae582ac63126ed5570ddfd37 (patch) | |
tree | 0d08c281a748689d53350a929fb0df022dc6ef2c /libavcodec/rv34.c | |
parent | 665e5b0fba41a8bae2269d9ce8929a24002e5907 (diff) | |
download | ffmpeg-1f4cf92cfbd3accbae582ac63126ed5570ddfd37.tar.gz |
pthread_frame: merge the functionality for normal decoder init and init_thread_copy
The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
other threads
- a "fixup" function is called for all the other threads to e.g.
allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r-- | libavcodec/rv34.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index f877258db6..ec0cd27916 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -1529,34 +1529,6 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) return 0; } -int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx) -{ - int err; - RV34DecContext *r = avctx->priv_data; - - r->s.avctx = avctx; - - if (avctx->internal->is_copy) { - r->tmp_b_block_base = NULL; - r->cbp_chroma = NULL; - r->cbp_luma = NULL; - r->deblock_coefs = NULL; - r->intra_types_hist = NULL; - r->mb_type = NULL; - - ff_mpv_idct_init(&r->s); - - if ((err = ff_mpv_common_init(&r->s)) < 0) - return err; - if ((err = rv34_decoder_alloc(r)) < 0) { - ff_mpv_common_end(&r->s); - return err; - } - } - - return 0; -} - int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { RV34DecContext *r = dst->priv_data, *r1 = src->priv_data; |