# HG changeset patch # User aurel # Date 1190759611 0 # Node ID 1643aa6ac14797af448bb479fbb162b9176dd91e # Parent bb4293d858da35f9f901372e913a1c4aff3eba7e simplify diff -r bb4293d858da -r 1643aa6ac147 vp56.c --- a/vp56.c Tue Sep 25 22:31:00 2007 +0000 +++ b/vp56.c Tue Sep 25 22:33:31 2007 +0000 @@ -268,6 +268,7 @@ vp56_ref_dc_t *lb = &s->left_block[vp56_b6to4[b]]; int count = 0; int dc = 0; + int i; if (ref_frame == lb->ref_frame) { dc += lb->dc_coeff; @@ -277,16 +278,12 @@ dc += ab->dc_coeff; count++; } - if (s->avctx->codec->id == CODEC_ID_VP5) { - if (count < 2 && ref_frame == ab[-1].ref_frame) { - dc += ab[-1].dc_coeff; - count++; - } - if (count < 2 && ref_frame == ab[1].ref_frame) { - dc += ab[1].dc_coeff; - count++; - } - } + if (s->avctx->codec->id == CODEC_ID_VP5) + for (i=0; i<2; i++) + if (count < 2 && ref_frame == ab[-1+2*i].ref_frame) { + dc += ab[-1+2*i].dc_coeff; + count++; + } if (count == 0) dc = s->prev_dc[vp56_b2p[b]][ref_frame]; else if (count == 2)