]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h261dec.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / h261dec.c
index 5c25aa9cb39a59c1f6000b727da2cbbf64a2df8f..80ec1c8814ae022cd7dab2b9cfb08782af89c3d6 100644 (file)
@@ -79,6 +79,7 @@ static av_cold int h261_decode_init(AVCodecContext *avctx)
     avctx->pix_fmt = AV_PIX_FMT_YUV420P;
 
     h->gob_start_code_skipped = 0;
+    ff_mpv_idct_init(s);
 
     ff_thread_once(&init_static_once, h261_decode_init_static);
 
@@ -595,10 +596,6 @@ static int h261_decode_frame(AVCodecContext *avctx, void *data,
 retry:
     init_get_bits(&s->gb, buf, buf_size * 8);
 
-    if (!s->context_initialized)
-        // we need the IDCT permutation for reading a custom matrix
-        ff_mpv_idct_init(s);
-
     ret = h261_decode_picture_header(h);
 
     /* skip if the header was thrashed */
@@ -668,7 +665,7 @@ static av_cold int h261_decode_end(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_h261_decoder = {
+const AVCodec ff_h261_decoder = {
     .name           = "h261",
     .long_name      = NULL_IF_CONFIG_SMALL("H.261"),
     .type           = AVMEDIA_TYPE_VIDEO,
@@ -678,6 +675,6 @@ AVCodec ff_h261_decoder = {
     .close          = h261_decode_end,
     .decode         = h261_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
-    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
     .max_lowres     = 3,
 };