summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorAlexander Strange <astrange@ithinksw.com>2011-02-05 00:28:27 -0500
committerMichael Niedermayer <michaelni@gmx.at>2011-02-06 20:31:45 +0100
commitdc4a1883093af45996f6b6b8e4e41ae90a7729cf (patch)
tree82e28d5a7c904b0b3171a32bc93968dffcf80dfd /libavcodec/vp3.c
parent3f171f5aec6a7e0e0f8a84520923824191a48f36 (diff)
vp3: Factor out expression
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit e8dcd730583a0aa69c33a17fc27d65fa55f5effe)
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 06f55f6d47..292a4efd16 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1345,7 +1345,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
*/
static void render_slice(Vp3DecodeContext *s, int slice)
{
- int x, y, i, j;
+ int x, y, i, j, fragment;
LOCAL_ALIGNED_16(DCTELEM, block, [64]);
int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef;
int motion_halfpel_index;
@@ -1390,8 +1390,9 @@ static void render_slice(Vp3DecodeContext *s, int slice)
for (j = 0; j < 16; j++) {
x = 4*sb_x + hilbert_offset[j][0];
y = 4*sb_y + hilbert_offset[j][1];
+ fragment = y*fragment_width + x;
- i = fragment_start + y*fragment_width + x;
+ i = fragment_start + fragment;
// bounds check
if (x >= fragment_width || y >= fragment_height)
@@ -1415,8 +1416,8 @@ static void render_slice(Vp3DecodeContext *s, int slice)
if ((s->all_fragments[i].coding_method > MODE_INTRA) &&
(s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {
int src_x, src_y;
- motion_x = motion_val[y*fragment_width + x][0];
- motion_y = motion_val[y*fragment_width + x][1];
+ motion_x = motion_val[fragment][0];
+ motion_y = motion_val[fragment][1];
src_x= (motion_x>>1) + 8*x;
src_y= (motion_y>>1) + 8*y;