aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1_mc.c
diff options
context:
space:
mode:
authorzhaoxiu.zeng <zhaoxiu.zeng@gmail.com>2015-03-07 22:45:36 +0800
committerMichael Niedermayer <michaelni@gmx.at>2015-03-07 21:06:21 +0100
commit468defc57b47dece90f8ad2072529e26ba581fa6 (patch)
tree65e4e922bc1508092508d71b27172eae9e6a80ec /libavcodec/vc1_mc.c
parent02fc168c93663ef14b8ce02a9e1362ba0ff32bbc (diff)
downloadffmpeg-468defc57b47dece90f8ad2072529e26ba581fa6.tar.gz
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>
Diffstat (limited to 'libavcodec/vc1_mc.c')
-rw-r--r--libavcodec/vc1_mc.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libavcodec/vc1_mc.c b/libavcodec/vc1_mc.c
index 18324c08ef..4b7f8b69d3 100644
--- a/libavcodec/vc1_mc.c
+++ b/libavcodec/vc1_mc.c
@@ -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