Commit 1bad40ef authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '70f96615'

* commit '70f96615':
  jpeg2000dec: initialize static data just once
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents aecb3421 70f96615
...@@ -1265,8 +1265,6 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1265,8 +1265,6 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
// reduction factor, i.e number of resolution levels to skip // reduction factor, i.e number of resolution levels to skip
s->reduction_factor = s->lowres; s->reduction_factor = s->lowres;
ff_jpeg2000_init_tier1_luts();
if (s->buf_end - s->buf < 2) if (s->buf_end - s->buf < 2)
return AVERROR(EINVAL); return AVERROR(EINVAL);
...@@ -1313,6 +1311,11 @@ end: ...@@ -1313,6 +1311,11 @@ end:
return ret; return ret;
} }
static void jpeg2000_init_static_data(AVCodec *codec)
{
ff_jpeg2000_init_tier1_luts();
}
#define OFFSET(x) offsetof(Jpeg2000DecoderContext, x) #define OFFSET(x) offsetof(Jpeg2000DecoderContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
...@@ -1339,16 +1342,17 @@ static const AVClass class = { ...@@ -1339,16 +1342,17 @@ static const AVClass class = {
}; };
AVCodec ff_jpeg2000_decoder = { AVCodec ff_jpeg2000_decoder = {
.name = "jpeg2000", .name = "jpeg2000",
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_JPEG2000, .id = AV_CODEC_ID_JPEG2000,
.capabilities = CODEC_CAP_FRAME_THREADS, .capabilities = CODEC_CAP_FRAME_THREADS,
.priv_data_size = sizeof(Jpeg2000DecoderContext), .priv_data_size = sizeof(Jpeg2000DecoderContext),
.decode = jpeg2000_decode_frame, .init_static_data = jpeg2000_init_static_data,
.priv_class = &class, .decode = jpeg2000_decode_frame,
.pix_fmts = (enum PixelFormat[]) { AV_PIX_FMT_XYZ12, .priv_class = &class,
AV_PIX_FMT_GRAY8, .pix_fmts = (enum PixelFormat[]) { AV_PIX_FMT_XYZ12,
-1 }, AV_PIX_FMT_GRAY8,
.profiles = NULL_IF_CONFIG_SMALL(profiles) -1 },
.profiles = NULL_IF_CONFIG_SMALL(profiles)
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment