comparison h263.c @ 7098:f49a53051803 libavcodec

Allocate static tables on stack, not heap. Patch by Art Clarke: aclarke vlideshow com
author benoit
date Mon, 23 Jun 2008 07:33:15 +0000
parents 778ecab25dd8
children 3ec34b551aae
comparison
equal deleted inserted replaced
7097:206ad3177459 7098:f49a53051803
2905 static int done = 0; 2905 static int done = 0;
2906 2906
2907 if (!done) { 2907 if (!done) {
2908 done = 1; 2908 done = 1;
2909 2909
2910 init_vlc(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, 2910 INIT_VLC_STATIC(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
2911 intra_MCBPC_bits, 1, 1, 2911 intra_MCBPC_bits, 1, 1,
2912 intra_MCBPC_code, 1, 1, 1); 2912 intra_MCBPC_code, 1, 1, 72);
2913 init_vlc(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, 2913 INIT_VLC_STATIC(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
2914 inter_MCBPC_bits, 1, 1, 2914 inter_MCBPC_bits, 1, 1,
2915 inter_MCBPC_code, 1, 1, 1); 2915 inter_MCBPC_code, 1, 1, 198);
2916 init_vlc(&cbpy_vlc, CBPY_VLC_BITS, 16, 2916 INIT_VLC_STATIC(&cbpy_vlc, CBPY_VLC_BITS, 16,
2917 &cbpy_tab[0][1], 2, 1, 2917 &cbpy_tab[0][1], 2, 1,
2918 &cbpy_tab[0][0], 2, 1, 1); 2918 &cbpy_tab[0][0], 2, 1, 64);
2919 init_vlc(&mv_vlc, MV_VLC_BITS, 33, 2919 INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33,
2920 &mvtab[0][1], 2, 1, 2920 &mvtab[0][1], 2, 1,
2921 &mvtab[0][0], 2, 1, 1); 2921 &mvtab[0][0], 2, 1, 538);
2922 init_rl(&rl_inter, static_rl_table_store[0]); 2922 init_rl(&rl_inter, static_rl_table_store[0]);
2923 init_rl(&rl_intra, static_rl_table_store[1]); 2923 init_rl(&rl_intra, static_rl_table_store[1]);
2924 init_rl(&rvlc_rl_inter, static_rl_table_store[3]); 2924 init_rl(&rvlc_rl_inter, static_rl_table_store[3]);
2925 init_rl(&rvlc_rl_intra, static_rl_table_store[4]); 2925 init_rl(&rvlc_rl_intra, static_rl_table_store[4]);
2926 init_rl(&rl_intra_aic, static_rl_table_store[2]); 2926 init_rl(&rl_intra_aic, static_rl_table_store[2]);
2927 INIT_VLC_RL(rl_inter, 554); 2927 INIT_VLC_RL(rl_inter, 554);
2928 INIT_VLC_RL(rl_intra, 554); 2928 INIT_VLC_RL(rl_intra, 554);
2929 INIT_VLC_RL(rvlc_rl_inter, 1072); 2929 INIT_VLC_RL(rvlc_rl_inter, 1072);
2930 INIT_VLC_RL(rvlc_rl_intra, 1072); 2930 INIT_VLC_RL(rvlc_rl_intra, 1072);
2931 INIT_VLC_RL(rl_intra_aic, 554); 2931 INIT_VLC_RL(rl_intra_aic, 554);
2932 init_vlc(&dc_lum, DC_VLC_BITS, 10 /* 13 */, 2932 INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
2933 &DCtab_lum[0][1], 2, 1, 2933 &DCtab_lum[0][1], 2, 1,
2934 &DCtab_lum[0][0], 2, 1, 1); 2934 &DCtab_lum[0][0], 2, 1, 512);
2935 init_vlc(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, 2935 INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
2936 &DCtab_chrom[0][1], 2, 1, 2936 &DCtab_chrom[0][1], 2, 1,
2937 &DCtab_chrom[0][0], 2, 1, 1); 2937 &DCtab_chrom[0][0], 2, 1, 512);
2938 init_vlc(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, 2938 INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
2939 &sprite_trajectory_tab[0][1], 4, 2, 2939 &sprite_trajectory_tab[0][1], 4, 2,
2940 &sprite_trajectory_tab[0][0], 4, 2, 1); 2940 &sprite_trajectory_tab[0][0], 4, 2, 128);
2941 init_vlc(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, 2941 INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
2942 &mb_type_b_tab[0][1], 2, 1, 2942 &mb_type_b_tab[0][1], 2, 1,
2943 &mb_type_b_tab[0][0], 2, 1, 1); 2943 &mb_type_b_tab[0][0], 2, 1, 16);
2944 init_vlc(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, 2944 INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
2945 &h263_mbtype_b_tab[0][1], 2, 1, 2945 &h263_mbtype_b_tab[0][1], 2, 1,
2946 &h263_mbtype_b_tab[0][0], 2, 1, 1); 2946 &h263_mbtype_b_tab[0][0], 2, 1, 80);
2947 init_vlc(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, 2947 INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
2948 &cbpc_b_tab[0][1], 2, 1, 2948 &cbpc_b_tab[0][1], 2, 1,
2949 &cbpc_b_tab[0][0], 2, 1, 1); 2949 &cbpc_b_tab[0][0], 2, 1, 8);
2950 } 2950 }
2951 } 2951 }
2952 2952
2953 /** 2953 /**
2954 * Get the GOB height based on picture height. 2954 * Get the GOB height based on picture height.