X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Frl.h;h=26e0b32a907a1baa2e1b369aeab7bb3600c67ca4;hb=e5af9203098a889f36b759652615046254d45102;hp=9a767bc5fd88ceed441680ad1df642c609f64664;hpb=ace96d2e693d804a0ed16aebc1b1027cfff2c527;p=ffmpeg diff --git a/libavcodec/rl.h b/libavcodec/rl.h index 9a767bc5fd8..26e0b32a907 100644 --- a/libavcodec/rl.h +++ b/libavcodec/rl.h @@ -49,17 +49,12 @@ typedef struct RLTable { } RLTable; /** - * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold - * the level and run tables, if this is NULL av_malloc() will be used + * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] + * to hold the level and run tables. */ -int ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); +void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); void ff_rl_init_vlc(RLTable *rl, unsigned static_size); -/** - * Free the contents of a dynamically allocated table. - */ -void ff_rl_free(RLTable *rl); - #define INIT_VLC_RL(rl, static_size)\ {\ int q;\ @@ -73,6 +68,14 @@ void ff_rl_free(RLTable *rl); }\ } +#define INIT_FIRST_VLC_RL(rl, static_size) \ +do { \ + static RL_VLC_ELEM rl_vlc_table[static_size]; \ + \ + rl.rl_vlc[0] = rl_vlc_table; \ + ff_rl_init_vlc(&rl, static_size); \ +} while (0) + static inline int get_rl_index(const RLTable *rl, int last, int run, int level) { int index;