diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2007-09-26 02:33:31 +0400 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2007-09-26 02:33:31 +0400 |
commit | 7ecae905b688385428fabc41b029747ac5bac0ee (patch) | |
tree | 0b8f15a4f512e8389298333fe9f07a67c2531939 /libavcodec/vp56.c | |
parent | d7af6a9de4d71c0cba222f3a29c14e30a48a9f3d (diff) |
simplify
Originally committed as revision 10584 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp56.c')
-rw-r--r-- | libavcodec/vp56.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index bfc2447f84..8b2a61a9e2 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -268,6 +268,7 @@ static void vp56_add_predictors_dc(vp56_context_t *s, vp56_frame_t ref_frame) 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 @@ static void vp56_add_predictors_dc(vp56_context_t *s, vp56_frame_t ref_frame) 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) |