X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh261dec.c;h=80ec1c8814ae022cd7dab2b9cfb08782af89c3d6;hb=e5af9203098a889f36b759652615046254d45102;hp=5c25aa9cb39a59c1f6000b727da2cbbf64a2df8f;hpb=7f1207cb79e79785ac837a9cd9f9ab6f0ba3462f;p=ffmpeg diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 5c25aa9cb39..80ec1c8814a 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -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, };