summaryrefslogtreecommitdiff
path: root/libavcodec/h261dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-26 03:36:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-26 04:22:39 +0100
commitc05065aac0d921c7eeacbc9fd6dcc7eb8e194835 (patch)
treedd907ad7a9fe948b61e72f81202bea2d88cbf363 /libavcodec/h261dec.c
parent6795dcfa659c5f1f00c8db4eb3cb565939023e78 (diff)
avcodec/h261: move b_stride/b_xy under the if() where they are used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h261dec.c')
-rw-r--r--libavcodec/h261dec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 882bef1947..30d2802431 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -341,8 +341,7 @@ static int h261_decode_block(H261Context *h, int16_t *block, int n, int coded)
static int h261_decode_mb(H261Context *h)
{
MpegEncContext *const s = &h->s;
- int i, cbp, xy, b_xy;
- int b_stride = 2*s->mb_width + 1;
+ int i, cbp, xy;
cbp = 63;
// Read mba
@@ -375,7 +374,6 @@ static int h261_decode_mb(H261Context *h)
s->mb_x = ((h->gob_number - 1) % 2) * 11 + ((h->current_mba - 1) % 11);
s->mb_y = ((h->gob_number - 1) / 2) * 3 + ((h->current_mba - 1) / 11);
xy = s->mb_x + s->mb_y * s->mb_stride;
- b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride;
ff_init_block_index(s);
ff_update_block_index(s);
@@ -435,6 +433,8 @@ static int h261_decode_mb(H261Context *h)
s->mv[0][0][1] = h->current_mv_y * 2;
if (s->current_picture.motion_val[0]) {
+ int b_stride = 2*s->mb_width + 1;
+ int b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride;
s->current_picture.motion_val[0][b_xy][0] = s->mv[0][0][0];
s->current_picture.motion_val[0][b_xy][1] = s->mv[0][0][1];
}