jpeg2000dec: initialize static data just once
This commit is contained in:
parent
45a1694fde
commit
70f9661542
@ -1264,8 +1264,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);
|
||||||
|
|
||||||
@ -1308,6 +1306,11 @@ end:
|
|||||||
return ret ? ret : s->buf - s->buf_start;
|
return ret ? ret : s->buf - s->buf_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
@ -1340,6 +1343,7 @@ AVCodec ff_jpeg2000_decoder = {
|
|||||||
.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),
|
||||||
|
.init_static_data = jpeg2000_init_static_data,
|
||||||
.decode = jpeg2000_decode_frame,
|
.decode = jpeg2000_decode_frame,
|
||||||
.priv_class = &class,
|
.priv_class = &class,
|
||||||
.pix_fmts = (enum PixelFormat[]) { AV_PIX_FMT_XYZ12,
|
.pix_fmts = (enum PixelFormat[]) { AV_PIX_FMT_XYZ12,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user