X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh263data.c;h=604a0425e1a1957915f583e8c11e853eff7de312;hb=dc8e15ef15d060a9ca118905c770710ce43a0723;hp=f649d58f4e682d8c5cc24bce1e08b06d46a76291;hpb=fb4a12cda4033f2f3d3d1039739f6e0e6f9afb82;p=ffmpeg diff --git a/libavcodec/h263data.c b/libavcodec/h263data.c index f649d58f4e6..604a0425e1a 100644 --- a/libavcodec/h263data.c +++ b/libavcodec/h263data.c @@ -25,11 +25,11 @@ #include +#include "libavutil/thread.h" + #include "h263data.h" #include "mpegvideo.h" -uint8_t ff_h263_static_rl_table_store[2][2][2 * MAX_RUN + MAX_LEVEL + 3]; - /* intra MCBPC, mb_type = (intra), then (intraq) */ const uint8_t ff_h263_intra_MCBPC_code[9] = { 1, 1, 2, 3, 1, 1, 2, 3, 1 }; const uint8_t ff_h263_intra_MCBPC_bits[9] = { 1, 3, 3, 3, 4, 6, 6, 6, 9 }; @@ -290,3 +290,15 @@ const AVRational ff_h263_pixel_aspect[16] = { { 0, 1 }, { 0, 1 }, }; + +static av_cold void h263_init_rl_inter(void) +{ + static uint8_t h263_rl_inter_table[2][2 * MAX_RUN + MAX_LEVEL + 3]; + ff_rl_init(&ff_h263_rl_inter, h263_rl_inter_table); +} + +av_cold void ff_h263_init_rl_inter(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, h263_init_rl_inter); +}