# HG changeset patch # User michael # Date 1212181721 0 # Node ID 778ecab25dd83e04564b563f2b2972ceb848c578 # Parent 213852a363708a010a017d9ecc13b990a3bcd0f7 Change init_vlc_rl() so it does not use *alloc_static() anymore. diff -r 213852a36370 -r 778ecab25dd8 h261dec.c --- a/h261dec.c Fri May 30 21:06:40 2008 +0000 +++ b/h261dec.c Fri May 30 21:08:41 2008 +0000 @@ -66,7 +66,7 @@ &h261_cbp_tab[0][1], 2, 1, &h261_cbp_tab[0][0], 2, 1, 1); init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store); - init_vlc_rl(&h261_rl_tcoeff, 1); + INIT_VLC_RL(h261_rl_tcoeff, 552); } } diff -r 213852a36370 -r 778ecab25dd8 h263.c --- a/h263.c Fri May 30 21:06:40 2008 +0000 +++ b/h263.c Fri May 30 21:08:41 2008 +0000 @@ -2924,11 +2924,11 @@ init_rl(&rvlc_rl_inter, static_rl_table_store[3]); init_rl(&rvlc_rl_intra, static_rl_table_store[4]); init_rl(&rl_intra_aic, static_rl_table_store[2]); - init_vlc_rl(&rl_inter, 1); - init_vlc_rl(&rl_intra, 1); - init_vlc_rl(&rvlc_rl_inter, 1); - init_vlc_rl(&rvlc_rl_intra, 1); - init_vlc_rl(&rl_intra_aic, 1); + INIT_VLC_RL(rl_inter, 554); + INIT_VLC_RL(rl_intra, 554); + INIT_VLC_RL(rvlc_rl_inter, 1072); + INIT_VLC_RL(rvlc_rl_intra, 1072); + INIT_VLC_RL(rl_intra_aic, 554); init_vlc(&dc_lum, DC_VLC_BITS, 10 /* 13 */, &DCtab_lum[0][1], 2, 1, &DCtab_lum[0][0], 2, 1, 1); diff -r 213852a36370 -r 778ecab25dd8 mpegvideo.c --- a/mpegvideo.c Fri May 30 21:06:40 2008 +0000 +++ b/mpegvideo.c Fri May 30 21:08:41 2008 +0000 @@ -722,19 +722,10 @@ } } -void init_vlc_rl(RLTable *rl, int use_static) +void init_vlc_rl(RLTable *rl) { int i, q; - /* Return if static table is already initialized */ - if(use_static && rl->rl_vlc[0]) - return; - - init_vlc(&rl->vlc, 9, rl->n + 1, - &rl->table_vlc[0][1], 4, 2, - &rl->table_vlc[0][0], 4, 2, use_static); - - for(q=0; q<32; q++){ int qmul= q*2; int qadd= (q-1)|1; @@ -743,10 +734,6 @@ qmul=1; qadd=0; } - if(use_static) - rl->rl_vlc[q]= av_mallocz_static(rl->vlc.table_size*sizeof(RL_VLC_ELEM)); - else - rl->rl_vlc[q]= av_malloc(rl->vlc.table_size*sizeof(RL_VLC_ELEM)); for(i=0; ivlc.table_size; i++){ int code= rl->vlc.table[i][0]; int len = rl->vlc.table[i][1]; diff -r 213852a36370 -r 778ecab25dd8 msmpeg4.c --- a/msmpeg4.c Fri May 30 21:06:40 2008 +0000 +++ b/msmpeg4.c Fri May 30 21:08:41 2008 +0000 @@ -1063,8 +1063,13 @@ for(i=0;ivlc, MV_VLC_BITS, mv->n + 1, diff -r 213852a36370 -r 778ecab25dd8 rl.h --- a/rl.h Fri May 30 21:06:40 2008 +0000 +++ b/rl.h Fri May 30 21:08:41 2008 +0000 @@ -54,7 +54,23 @@ * the level and run tables, if this is NULL av_malloc() will be used */ void init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); -void init_vlc_rl(RLTable *rl, int use_static); +void init_vlc_rl(RLTable *rl); + +#define INIT_VLC_RL(rl, static_size)\ +{\ + int q;\ + static RL_VLC_ELEM rl_vlc_table[32][static_size];\ + INIT_VLC_STATIC(&rl.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];\ +\ + init_vlc_rl(&rl);\ + }\ +} static inline int get_rl_index(const RLTable *rl, int last, int run, int level) {