rl.h: Use on-stack temporary VLC tables instead of having them static.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
Reimar Döffinger
2014-08-31 20:07:40 +02:00
parent 2ca78936c7
commit e48cd2de98
3 changed files with 19 additions and 20 deletions

View File

@@ -53,22 +53,18 @@ typedef struct RLTable {
* the level and run tables, if this is NULL av_malloc() will be used
*/
void ff_init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]);
void ff_init_vlc_rl(RLTable *rl, const VLC *vlc);
void ff_init_vlc_rl(RLTable *rl, unsigned static_size);
#define INIT_VLC_RL(rl, static_size)\
{\
int q;\
static RL_VLC_ELEM rl_vlc_table[32][static_size];\
VLC tmp_vlc;\
INIT_VLC_STATIC(&tmp_vlc, 9, rl.n + 1,\
&rl.table_vlc[0][1], 4, 2,\
&rl.table_vlc[0][0], 4, 2, static_size);\
\
if(!rl.rl_vlc[0]){\
for(q=0; q<32; q++)\
rl.rl_vlc[q]= rl_vlc_table[q];\
\
ff_init_vlc_rl(&rl, &tmp_vlc);\
ff_init_vlc_rl(&rl, static_size);\
}\
}