101 int motion_x,
int motion_y,
int h)
105 int dxy, mx, my, src_x, src_y, v_edge_pos;
106 ptrdiff_t
offset, linesize, uvlinesize;
109 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
110 dxy = 2 * dxy + w->
hshift;
111 src_x = s->
mb_x * 16 + (motion_x >> 1);
112 src_y = s->
mb_y * 16 + (motion_y >> 1);
116 src_x = av_clip(src_x, -16, s->
width);
117 src_y = av_clip(src_y, -16, s->
height);
119 if (src_x <= -16 || src_x >= s->
width)
121 if (src_y <= -16 || src_y >= s->
height)
126 ptr = ref_picture[0] + (src_y * linesize) + src_x;
128 if (src_x < 1 || src_y < 1 || src_x + 17 >= s->
h_edge_pos ||
129 src_y + h + 1 >= v_edge_pos) {
132 src_x - 1, src_y - 1,
147 if ((motion_x & 3) != 0)
149 if ((motion_y & 3) != 0)
154 src_x = s->
mb_x * 8 + mx;
155 src_y = s->
mb_y * 8 + my;
156 src_x = av_clip(src_x, -8, s->
width >> 1);
157 if (src_x == (s->
width >> 1))
159 src_y = av_clip(src_y, -8, s->
height >> 1);
160 if (src_y == (s->
height >> 1))
162 offset = (src_y * uvlinesize) + src_x;
163 ptr = ref_picture[1] +
offset;
172 pix_op[1][dxy](dest_cb, ptr, uvlinesize, h >> 1);
174 ptr = ref_picture[2] +
offset;
183 pix_op[1][dxy](dest_cr, ptr, uvlinesize, h >> 1);