Allocate static tables on stack, not heap.

Patch by Art Clarke: aclarke vlideshow com

Originally committed as revision 13907 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Art Clarke 2008-06-23 07:33:15 +00:00 committed by Benoit Fouet
parent 3ab29d8e4f
commit 51f90867ea
1 changed files with 20 additions and 20 deletions

View File

@ -2907,18 +2907,18 @@ void h263_decode_init_vlc(MpegEncContext *s)
if (!done) { if (!done) {
done = 1; done = 1;
init_vlc(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, INIT_VLC_STATIC(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
intra_MCBPC_bits, 1, 1, intra_MCBPC_bits, 1, 1,
intra_MCBPC_code, 1, 1, 1); intra_MCBPC_code, 1, 1, 72);
init_vlc(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, INIT_VLC_STATIC(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
inter_MCBPC_bits, 1, 1, inter_MCBPC_bits, 1, 1,
inter_MCBPC_code, 1, 1, 1); inter_MCBPC_code, 1, 1, 198);
init_vlc(&cbpy_vlc, CBPY_VLC_BITS, 16, INIT_VLC_STATIC(&cbpy_vlc, CBPY_VLC_BITS, 16,
&cbpy_tab[0][1], 2, 1, &cbpy_tab[0][1], 2, 1,
&cbpy_tab[0][0], 2, 1, 1); &cbpy_tab[0][0], 2, 1, 64);
init_vlc(&mv_vlc, MV_VLC_BITS, 33, INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33,
&mvtab[0][1], 2, 1, &mvtab[0][1], 2, 1,
&mvtab[0][0], 2, 1, 1); &mvtab[0][0], 2, 1, 538);
init_rl(&rl_inter, static_rl_table_store[0]); init_rl(&rl_inter, static_rl_table_store[0]);
init_rl(&rl_intra, static_rl_table_store[1]); init_rl(&rl_intra, static_rl_table_store[1]);
init_rl(&rvlc_rl_inter, static_rl_table_store[3]); init_rl(&rvlc_rl_inter, static_rl_table_store[3]);
@ -2929,24 +2929,24 @@ void h263_decode_init_vlc(MpegEncContext *s)
INIT_VLC_RL(rvlc_rl_inter, 1072); INIT_VLC_RL(rvlc_rl_inter, 1072);
INIT_VLC_RL(rvlc_rl_intra, 1072); INIT_VLC_RL(rvlc_rl_intra, 1072);
INIT_VLC_RL(rl_intra_aic, 554); INIT_VLC_RL(rl_intra_aic, 554);
init_vlc(&dc_lum, DC_VLC_BITS, 10 /* 13 */, INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
&DCtab_lum[0][1], 2, 1, &DCtab_lum[0][1], 2, 1,
&DCtab_lum[0][0], 2, 1, 1); &DCtab_lum[0][0], 2, 1, 512);
init_vlc(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
&DCtab_chrom[0][1], 2, 1, &DCtab_chrom[0][1], 2, 1,
&DCtab_chrom[0][0], 2, 1, 1); &DCtab_chrom[0][0], 2, 1, 512);
init_vlc(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
&sprite_trajectory_tab[0][1], 4, 2, &sprite_trajectory_tab[0][1], 4, 2,
&sprite_trajectory_tab[0][0], 4, 2, 1); &sprite_trajectory_tab[0][0], 4, 2, 128);
init_vlc(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
&mb_type_b_tab[0][1], 2, 1, &mb_type_b_tab[0][1], 2, 1,
&mb_type_b_tab[0][0], 2, 1, 1); &mb_type_b_tab[0][0], 2, 1, 16);
init_vlc(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
&h263_mbtype_b_tab[0][1], 2, 1, &h263_mbtype_b_tab[0][1], 2, 1,
&h263_mbtype_b_tab[0][0], 2, 1, 1); &h263_mbtype_b_tab[0][0], 2, 1, 80);
init_vlc(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
&cbpc_b_tab[0][1], 2, 1, &cbpc_b_tab[0][1], 2, 1,
&cbpc_b_tab[0][0], 2, 1, 1); &cbpc_b_tab[0][0], 2, 1, 8);
} }
} }