diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-24 09:55:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-24 09:55:59 +0200 |
commit | 03b81df9e6734f405ab833b587337f9f602d15ae (patch) | |
tree | e29891b72733bdd2add929192c8f04fabc44a8da | |
parent | fc6903337188a8f09aae24471d2c1e0eeaf396c0 (diff) | |
parent | 2e2d24667a2c5cc7af94cfa7b63bb9ec1c04224b (diff) | |
download | ffmpeg-03b81df9e6734f405ab833b587337f9f602d15ae.tar.gz |
Merge commit '2e2d24667a2c5cc7af94cfa7b63bb9ec1c04224b'
* commit '2e2d24667a2c5cc7af94cfa7b63bb9ec1c04224b':
jpeg2000: Add mutlti-threading support to decoder
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/jpeg2000dec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index a7b0a7bbd0..20e5c9cc93 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "bytestream.h" #include "internal.h" +#include "thread.h" #include "jpeg2000.h" #define JP2_SIG_TYPE 0x6A502020 @@ -1242,6 +1243,7 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { Jpeg2000DecoderContext *s = avctx->priv_data; + ThreadFrame frame = { .f = data }; AVFrame *picture = data; int tileno, ret; @@ -1277,8 +1279,8 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data, return ret; /* get picture buffer */ - if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "ff_get_buffer() failed\n"); + if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) { + av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed.\n"); return ret; } picture->pict_type = AV_PICTURE_TYPE_I; @@ -1326,6 +1328,7 @@ AVCodec ff_jpeg2000_decoder = { .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_JPEG2000, + .capabilities = CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(Jpeg2000DecoderContext), .decode = jpeg2000_decode_frame, .priv_class = &class, |