comparison h263.c @ 1042:a78f6f72d54e libavcodec

--disable-risky support
author michaelni
date Wed, 29 Jan 2003 12:00:11 +0000
parents af7ba8d8b43a
children f07fd48c23d4
comparison
equal deleted inserted replaced
1041:1d906a29afb6 1042:a78f6f72d54e
2207 static VLC cbpy_vlc; 2207 static VLC cbpy_vlc;
2208 static VLC mv_vlc; 2208 static VLC mv_vlc;
2209 static VLC dc_lum, dc_chrom; 2209 static VLC dc_lum, dc_chrom;
2210 static VLC sprite_trajectory; 2210 static VLC sprite_trajectory;
2211 static VLC mb_type_b_vlc; 2211 static VLC mb_type_b_vlc;
2212
2213 void init_rl(RLTable *rl)
2214 {
2215 INT8 max_level[MAX_RUN+1], max_run[MAX_LEVEL+1];
2216 UINT8 index_run[MAX_RUN+1];
2217 int last, run, level, start, end, i;
2218
2219 /* compute max_level[], max_run[] and index_run[] */
2220 for(last=0;last<2;last++) {
2221 if (last == 0) {
2222 start = 0;
2223 end = rl->last;
2224 } else {
2225 start = rl->last;
2226 end = rl->n;
2227 }
2228
2229 memset(max_level, 0, MAX_RUN + 1);
2230 memset(max_run, 0, MAX_LEVEL + 1);
2231 memset(index_run, rl->n, MAX_RUN + 1);
2232 for(i=start;i<end;i++) {
2233 run = rl->table_run[i];
2234 level = rl->table_level[i];
2235 if (index_run[run] == rl->n)
2236 index_run[run] = i;
2237 if (level > max_level[run])
2238 max_level[run] = level;
2239 if (run > max_run[level])
2240 max_run[level] = run;
2241 }
2242 rl->max_level[last] = av_malloc(MAX_RUN + 1);
2243 memcpy(rl->max_level[last], max_level, MAX_RUN + 1);
2244 rl->max_run[last] = av_malloc(MAX_LEVEL + 1);
2245 memcpy(rl->max_run[last], max_run, MAX_LEVEL + 1);
2246 rl->index_run[last] = av_malloc(MAX_RUN + 1);
2247 memcpy(rl->index_run[last], index_run, MAX_RUN + 1);
2248 }
2249 }
2250 2212
2251 void init_vlc_rl(RLTable *rl) 2213 void init_vlc_rl(RLTable *rl)
2252 { 2214 {
2253 int i, q; 2215 int i, q;
2254 2216