diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-12 01:34:44 +0100 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-05-15 11:39:36 +0300 |
commit | 19673db34aa0fb014a07cb3e72970c1c0aeeeac1 (patch) | |
tree | 8af45caaf26075d70972467f5e2acb4e1b6fed9c /libavcodec/vc1dec.c | |
parent | 012b319d9147c18e6148003052b147722d11fe6e (diff) | |
download | ffmpeg-19673db34aa0fb014a07cb3e72970c1c0aeeeac1.tar.gz |
vc1dec: Factorize srcU/V offseting
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index b07214ad6f..838ebee7a3 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -846,21 +846,24 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir) if (!dir) { if (v->field_mode) { if ((v->cur_field_type != chroma_ref_type) && v->cur_field_type) { - srcU = s->current_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x; - srcV = s->current_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x; + srcU = s->current_picture.f.data[1]; + srcV = s->current_picture.f.data[2]; } else { - srcU = s->last_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x; - srcV = s->last_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x; + srcU = s->last_picture.f.data[1]; + srcV = s->last_picture.f.data[2]; } } else { - srcU = s->last_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x; - srcV = s->last_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x; + srcU = s->last_picture.f.data[1]; + srcV = s->last_picture.f.data[2]; } } else { - srcU = s->next_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x; - srcV = s->next_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x; + srcU = s->next_picture.f.data[1]; + srcV = s->next_picture.f.data[2]; } + srcU += uvsrc_y * s->uvlinesize + uvsrc_x; + srcV += uvsrc_y * s->uvlinesize + uvsrc_x; + if (v->field_mode) { if (chroma_ref_type) { srcU += s->current_picture_ptr->f.linesize[1]; |