diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-24 14:49:31 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-05-15 11:39:57 +0300 |
commit | 2412ad171716edc57905f9473123a59ebce2ed63 (patch) | |
tree | 7b437a71729ede186a0a0c3c16f8685b676675e2 | |
parent | 19673db34aa0fb014a07cb3e72970c1c0aeeeac1 (diff) | |
download | ffmpeg-streaming-2412ad171716edc57905f9473123a59ebce2ed63.zip ffmpeg-streaming-2412ad171716edc57905f9473123a59ebce2ed63.tar.gz |
vc1dec: Factorize picture pointer selection code
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/vc1dec.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 838ebee..b13e91f 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -379,32 +379,20 @@ static void vc1_mc_1mv(VC1Context *v, int dir) uvmx = uvmx + ((uvmx < 0) ? (uvmx & 1) : -(uvmx & 1)); uvmy = uvmy + ((uvmy < 0) ? (uvmy & 1) : -(uvmy & 1)); } - if (v->field_mode) { // interlaced field picture - if (!dir) { - if ((v->cur_field_type != v->ref_field_type[dir]) && v->cur_field_type) { - srcY = s->current_picture.f.data[0]; - srcU = s->current_picture.f.data[1]; - srcV = s->current_picture.f.data[2]; - } else { - srcY = s->last_picture.f.data[0]; - srcU = s->last_picture.f.data[1]; - srcV = s->last_picture.f.data[2]; - } + if (!dir) { + if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->cur_field_type) { + srcY = s->current_picture.f.data[0]; + srcU = s->current_picture.f.data[1]; + srcV = s->current_picture.f.data[2]; } else { - srcY = s->next_picture.f.data[0]; - srcU = s->next_picture.f.data[1]; - srcV = s->next_picture.f.data[2]; - } - } else { - if (!dir) { srcY = s->last_picture.f.data[0]; srcU = s->last_picture.f.data[1]; srcV = s->last_picture.f.data[2]; - } else { - srcY = s->next_picture.f.data[0]; - srcU = s->next_picture.f.data[1]; - srcV = s->next_picture.f.data[2]; } + } else { + srcY = s->next_picture.f.data[0]; + srcU = s->next_picture.f.data[1]; + srcV = s->next_picture.f.data[2]; } src_x = s->mb_x * 16 + (mx >> 2); @@ -566,11 +554,8 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir) my = s->mv[dir][n][1]; if (!dir) { - if (v->field_mode) { - if ((v->cur_field_type != v->ref_field_type[dir]) && v->cur_field_type) - srcY = s->current_picture.f.data[0]; - else - srcY = s->last_picture.f.data[0]; + if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->cur_field_type) { + srcY = s->current_picture.f.data[0]; } else srcY = s->last_picture.f.data[0]; } else |