comparison mpeg12.c @ 4668:1f1a0e67b961 libavcodec

kill av_mallocz_static() calls in init_rl()
author michael
date Wed, 14 Mar 2007 13:19:19 +0000
parents f0ce30e115ac
children d161ec980995
comparison
equal deleted inserted replaced
4667:b3f099adfb36 4668:1f1a0e67b961
105 static uint32_t mpeg1_chr_dc_uni[512]; 105 static uint32_t mpeg1_chr_dc_uni[512];
106 106
107 static uint8_t mpeg1_index_run[2][64]; 107 static uint8_t mpeg1_index_run[2][64];
108 static int8_t mpeg1_max_level[2][64]; 108 static int8_t mpeg1_max_level[2][64];
109 #endif //CONFIG_ENCODERS 109 #endif //CONFIG_ENCODERS
110
111 static uint8_t static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
110 112
111 static void init_2d_vlc_rl(RLTable *rl, int use_static) 113 static void init_2d_vlc_rl(RLTable *rl, int use_static)
112 { 114 {
113 int i; 115 int i;
114 116
823 int f_code; 825 int f_code;
824 int mv; 826 int mv;
825 int i; 827 int i;
826 828
827 done=1; 829 done=1;
828 init_rl(&rl_mpeg1, 1); 830 init_rl(&rl_mpeg1, static_rl_table_store[0]);
829 if(s->intra_vlc_format) 831 if(s->intra_vlc_format)
830 init_rl(&rl_mpeg2, 1); 832 init_rl(&rl_mpeg2, static_rl_table_store[1]);
831 833
832 for(i=0; i<64; i++) 834 for(i=0; i<64; i++)
833 { 835 {
834 mpeg1_max_level[0][i]= rl_mpeg1.max_level[0][i]; 836 mpeg1_max_level[0][i]= rl_mpeg1.max_level[0][i];
835 mpeg1_index_run[0][i]= rl_mpeg1.index_run[0][i]; 837 mpeg1_index_run[0][i]= rl_mpeg1.index_run[0][i];
1073 &table_mb_ptype[0][1], 2, 1, 1075 &table_mb_ptype[0][1], 2, 1,
1074 &table_mb_ptype[0][0], 2, 1, 1); 1076 &table_mb_ptype[0][0], 2, 1, 1);
1075 init_vlc(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, 1077 init_vlc(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
1076 &table_mb_btype[0][1], 2, 1, 1078 &table_mb_btype[0][1], 2, 1,
1077 &table_mb_btype[0][0], 2, 1, 1); 1079 &table_mb_btype[0][0], 2, 1, 1);
1078 init_rl(&rl_mpeg1, 1); 1080 init_rl(&rl_mpeg1, static_rl_table_store[0]);
1079 init_rl(&rl_mpeg2, 1); 1081 init_rl(&rl_mpeg2, static_rl_table_store[1]);
1080 1082
1081 init_2d_vlc_rl(&rl_mpeg1, 1); 1083 init_2d_vlc_rl(&rl_mpeg1, 1);
1082 init_2d_vlc_rl(&rl_mpeg2, 1); 1084 init_2d_vlc_rl(&rl_mpeg2, 1);
1083 } 1085 }
1084 } 1086 }