diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 4f6a539ad8..91ba80ebd3 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -155,8 +155,6 @@ static const uint8_t unscaled_quant_matrix[64] = { 27, 29, 35, 38, 46, 56, 69, 83 }; -static uint8_t speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; - static VLC dc_lum_vlc_le; static VLC dc_chroma_vlc_le; static VLC dc_alpha_run_vlc_le; @@ -648,7 +646,6 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_code, 2, 2, INIT_VLC_OUTPUT_LE, 514); - ff_rl_init(&ff_rl_speedhq, speedhq_static_rl_table_store); INIT_2D_VLC_RL(ff_rl_speedhq, 674, INIT_VLC_LE); compute_alpha_vlcs(); @@ -733,5 +730,6 @@ const AVCodec ff_speedhq_decoder = { .init = speedhq_decode_init, .decode = speedhq_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif /* CONFIG_SPEEDHQ_DECODER */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 6ff7b447a0..529df4f5b6 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -298,7 +298,7 @@ const AVCodec ff_speedhq_encoder = { .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE