1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/vc1_mc: Simplify v_edge_pos and src_y correction when fieldmv is true

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
zhaoxiu.zeng 2015-03-07 22:45:36 +08:00 committed by Michael Niedermayer
parent 02fc168c93
commit 468defc57b

View File

@ -416,10 +416,12 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
if (v->field_mode && v->ref_field_type[dir])
srcY += s->current_picture_ptr->f->linesize[0];
if (fieldmv && !(src_y & 1))
v_edge_pos--;
if (fieldmv && (src_y & 1) && src_y < 4)
src_y--;
if (fieldmv) {
if (!(src_y & 1))
v_edge_pos--;
else
src_y -= (src_y < 4);
}
if (v->rangeredfrm || use_ic
|| s->h_edge_pos < 13 || v_edge_pos < 23
|| (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx & 3) - 8 - s->mspel * 2
@ -722,11 +724,12 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
uvmx_field[i] = (uvmx_field[i] & 3) << 1;
uvmy_field[i] = (uvmy_field[i] & 3) << 1;
if (fieldmv && !(uvsrc_y & 1))
v_edge_pos = (s->v_edge_pos >> 1) - 1;
if (fieldmv && (uvsrc_y & 1) && uvsrc_y < 2)
uvsrc_y--;
if (fieldmv) {
if (!(uvsrc_y & 1))
v_edge_pos = (s->v_edge_pos >> 1) - 1;
else
uvsrc_y -= (uvsrc_y < 2);
}
if (use_ic
|| s->h_edge_pos < 10 || v_edge_pos < (5 << fieldmv)
|| (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 5