diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2021-11-26 15:20:15 +0300 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2021-12-09 04:10:35 +0300 |
commit | d39f667da155054307e143dc23b225ca88a59dc9 (patch) | |
tree | 7d9eb481115b4deb2a0ef1555717eab8964c7013 /libavcodec | |
parent | 17b434f1ce0bb1687460ee5539fa8038bbc9018c (diff) |
avcodec/bitpacked_dec: support for frame thread decode
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/bitpacked_dec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/bitpacked_dec.c b/libavcodec/bitpacked_dec.c index a2edccc43c..69fea9c366 100644 --- a/libavcodec/bitpacked_dec.c +++ b/libavcodec/bitpacked_dec.c @@ -30,6 +30,7 @@ #include "internal.h" #include "get_bits.h" #include "libavutil/imgutils.h" +#include "thread.h" struct BitpackedContext { int (*decode)(AVCodecContext *avctx, AVFrame *frame, @@ -64,11 +65,12 @@ static int bitpacked_decode_yuv422p10(AVCodecContext *avctx, AVFrame *frame, { uint64_t frame_size = (uint64_t)avctx->width * (uint64_t)avctx->height * 20; uint64_t packet_size = (uint64_t)avpkt->size * 8; + ThreadFrame tframe = { .f = frame }; GetBitContext bc; uint16_t *y, *u, *v; int ret, i, j; - ret = ff_get_buffer(avctx, frame, 0); + ret = ff_thread_get_buffer(avctx, &tframe, 0); if (ret < 0) return ret; @@ -149,6 +151,7 @@ const AVCodec ff_bitpacked_decoder = { .priv_data_size = sizeof(struct BitpackedContext), .init = bitpacked_init_decoder, .decode = bitpacked_decode, + .capabilities = AV_CODEC_CAP_FRAME_THREADS, .codec_tags = (const uint32_t []){ MKTAG('U', 'Y', 'V', 'Y'), FF_CODEC_TAGS_END, |