comparison dv.c @ 4661:5b6f5e7ed3a0 libavcodec

kill a av_mallocz_static()
author michael
date Tue, 13 Mar 2007 23:30:28 +0000
parents 9bf957e669f0
children c43d2a68ec57
comparison
equal deleted inserted replaced
4660:c800e1a03b9c 4661:5b6f5e7ed3a0
73 #define DV_VLC_MAP_RUN_SIZE 64 73 #define DV_VLC_MAP_RUN_SIZE 64
74 #define DV_VLC_MAP_LEV_SIZE 512 //FIXME sign was removed so this should be /2 but needs check 74 #define DV_VLC_MAP_LEV_SIZE 512 //FIXME sign was removed so this should be /2 but needs check
75 #endif 75 #endif
76 76
77 /* XXX: also include quantization */ 77 /* XXX: also include quantization */
78 static RL_VLC_ELEM *dv_rl_vlc; 78 static RL_VLC_ELEM dv_rl_vlc[1184];
79 /* VLC encoding lookup table */ 79 /* VLC encoding lookup table */
80 static struct dv_vlc_pair { 80 static struct dv_vlc_pair {
81 uint32_t vlc; 81 uint32_t vlc;
82 uint8_t size; 82 uint8_t size;
83 } (*dv_vlc_map)[DV_VLC_MAP_LEV_SIZE] = NULL; 83 } (*dv_vlc_map)[DV_VLC_MAP_LEV_SIZE] = NULL;
152 152
153 /* NOTE: as a trick, we use the fact the no codes are unused 153 /* NOTE: as a trick, we use the fact the no codes are unused
154 to accelerate the parsing of partial codes */ 154 to accelerate the parsing of partial codes */
155 init_vlc(&dv_vlc, TEX_VLC_BITS, j, 155 init_vlc(&dv_vlc, TEX_VLC_BITS, j,
156 new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0); 156 new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
157 157 assert(dv_vlc.table_size == 1184);
158 dv_rl_vlc = av_mallocz_static(dv_vlc.table_size * sizeof(RL_VLC_ELEM));
159 if (!dv_rl_vlc)
160 return AVERROR(ENOMEM);
161 158
162 for(i = 0; i < dv_vlc.table_size; i++){ 159 for(i = 0; i < dv_vlc.table_size; i++){
163 int code= dv_vlc.table[i][0]; 160 int code= dv_vlc.table[i][0];
164 int len = dv_vlc.table[i][1]; 161 int len = dv_vlc.table[i][1];
165 int level, run; 162 int level, run;