Mercurial > libavcodec.hg
comparison vp6.c @ 4925:ff4cd98bc90c libavcodec
simplify
author | lorenm |
---|---|
date | Sun, 06 May 2007 09:17:50 +0000 |
parents | 58f751086434 |
children | 470601203f44 |
comparison
equal
deleted
inserted
replaced
4924:4d185d65488c | 4925:ff4cd98bc90c |
---|---|
297 model2 = s->coeff_model_dcct[pt][ctx]; | 297 model2 = s->coeff_model_dcct[pt][ctx]; |
298 | 298 |
299 for (coeff_idx=0; coeff_idx<64; ) { | 299 for (coeff_idx=0; coeff_idx<64; ) { |
300 if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) { | 300 if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) { |
301 /* parse a coeff */ | 301 /* parse a coeff */ |
302 if (coeff_idx == 0) { | |
303 s->left_block[vp56_b6to4[b]].not_null_dc = 1; | |
304 s->above_blocks[s->above_block_idx[b]].not_null_dc = 1; | |
305 } | |
306 | |
307 if (vp56_rac_get_prob(c, model2[2])) { | 302 if (vp56_rac_get_prob(c, model2[2])) { |
308 if (vp56_rac_get_prob(c, model2[3])) { | 303 if (vp56_rac_get_prob(c, model2[3])) { |
309 idx = vp56_rac_get_tree(c, vp56_pc_tree, model); | 304 idx = vp56_rac_get_tree(c, vp56_pc_tree, model); |
310 coeff = vp56_coeff_bias[idx]; | 305 coeff = vp56_coeff_bias[idx]; |
311 for (i=vp56_coeff_bit_length[idx]; i>=0; i--) | 306 for (i=vp56_coeff_bit_length[idx]; i>=0; i--) |
329 s->block_coeff[b][permute[idx]] = coeff; | 324 s->block_coeff[b][permute[idx]] = coeff; |
330 run = 1; | 325 run = 1; |
331 } else { | 326 } else { |
332 /* parse a run */ | 327 /* parse a run */ |
333 ct = 0; | 328 ct = 0; |
334 if (coeff_idx == 0) { | 329 if (coeff_idx > 0) { |
335 s->left_block[vp56_b6to4[b]].not_null_dc = 0; | |
336 s->above_blocks[s->above_block_idx[b]].not_null_dc = 0; | |
337 } else { | |
338 if (!vp56_rac_get_prob(c, model2[1])) | 330 if (!vp56_rac_get_prob(c, model2[1])) |
339 break; | 331 break; |
340 | 332 |
341 model3 = s->coeff_model_runv[coeff_idx >= 6]; | 333 model3 = s->coeff_model_runv[coeff_idx >= 6]; |
342 run = vp56_rac_get_tree(c, vp6_pcr_tree, model3); | 334 run = vp56_rac_get_tree(c, vp6_pcr_tree, model3); |
347 } | 339 } |
348 | 340 |
349 cg = vp6_coeff_groups[coeff_idx+=run]; | 341 cg = vp6_coeff_groups[coeff_idx+=run]; |
350 model = model2 = s->coeff_model_ract[pt][ct][cg]; | 342 model = model2 = s->coeff_model_ract[pt][ct][cg]; |
351 } | 343 } |
344 | |
345 s->left_block[vp56_b6to4[b]].not_null_dc = | |
346 s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0]; | |
352 } | 347 } |
353 } | 348 } |
354 | 349 |
355 static int vp6_adjust(int v, int t) | 350 static int vp6_adjust(int v, int t) |
356 { | 351 { |