j2kdec: move ff_j2k_init_tier1_luts() to j2kdec_init()
authorPaul B Mahol <onemda@gmail.com>
Tue, 27 Mar 2012 14:06:53 +0000 (14:06 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Mar 2012 17:51:19 +0000 (19:51 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/j2kdec.c

index 6a4b2b6..59ae869 100644 (file)
@@ -1021,8 +1021,6 @@ static int decode_frame(AVCodecContext *avctx,
     bytestream2_init(&s->g, avpkt->data, avpkt->size);
     s->curtileno = -1;
 
-    ff_j2k_init_tier1_luts();
-
     if (bytestream2_get_bytes_left(&s->g) < 2) {
         ret = AVERROR(EINVAL);
         goto err_out;
@@ -1072,6 +1070,9 @@ static av_cold int j2kdec_init(AVCodecContext *avctx)
 
     avcodec_get_frame_defaults((AVFrame*)&s->picture);
     avctx->coded_frame = (AVFrame*)&s->picture;
+
+    ff_j2k_init_tier1_luts();
+
     return 0;
 }