diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-28 16:38:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-06 16:38:03 +0200 |
commit | d2bf8aecd35abc1bff11314b623b0a4b711871d1 (patch) | |
tree | 8f1b182c506eac5528608ebe3ebb473ce402d4de /libavcodec | |
parent | b02f073ad4926f3b8192ceae052688b85c2ee806 (diff) |
j2kdec: frame multithreading support
This allows comparing the 2 decoders with threads
Based on:commit 2e2d24667a2c5cc7af94cfa7b63bb9ec1c04224b
By: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/j2kdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c index 683062d76b..3e78b0b5f8 100644 --- a/libavcodec/j2kdec.c +++ b/libavcodec/j2kdec.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "bytestream.h" #include "internal.h" +#include "thread.h" #include "j2k.h" #include "libavutil/common.h" @@ -205,6 +206,7 @@ static int tag_tree_decode(J2kDecoderContext *s, J2kTgtNode *node, int threshold static int get_siz(J2kDecoderContext *s) { int i, ret; + ThreadFrame frame = { .f = s->picture }; if (bytestream2_get_bytes_left(&s->g) < 36) return AVERROR(EINVAL); @@ -282,7 +284,7 @@ static int get_siz(J2kDecoderContext *s) } - if ((ret = ff_get_buffer(s->avctx, s->picture, 0)) < 0) + if ((ret = ff_thread_get_buffer(s->avctx, &frame, 0)) < 0) return ret; s->picture->pict_type = AV_PICTURE_TYPE_I; @@ -1088,6 +1090,6 @@ AVCodec ff_j2k_decoder = { .priv_data_size = sizeof(J2kDecoderContext), .init = j2kdec_init, .decode = decode_frame, - .capabilities = CODEC_CAP_EXPERIMENTAL, + .capabilities = CODEC_CAP_EXPERIMENTAL | CODEC_CAP_FRAME_THREADS, .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), }; |