|
|
|
@ -63,12 +63,12 @@ static void gmc1_motion(MpegEncContext *s, |
|
|
|
|
|
|
|
|
|
if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) || |
|
|
|
|
(unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, |
|
|
|
|
linesize, linesize, |
|
|
|
|
17, 17, |
|
|
|
|
src_x, src_y, |
|
|
|
|
s->h_edge_pos, s->v_edge_pos); |
|
|
|
|
ptr = s->edge_emu_buffer; |
|
|
|
|
ptr = s->sc.edge_emu_buffer; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((motion_x | motion_y) & 7) { |
|
|
|
@ -107,12 +107,12 @@ static void gmc1_motion(MpegEncContext *s, |
|
|
|
|
ptr = ref_picture[1] + offset; |
|
|
|
|
if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) || |
|
|
|
|
(unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, |
|
|
|
|
uvlinesize, uvlinesize, |
|
|
|
|
9, 9, |
|
|
|
|
src_x, src_y, |
|
|
|
|
s->h_edge_pos >> 1, s->v_edge_pos >> 1); |
|
|
|
|
ptr = s->edge_emu_buffer; |
|
|
|
|
ptr = s->sc.edge_emu_buffer; |
|
|
|
|
emu = 1; |
|
|
|
|
} |
|
|
|
|
s->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8, |
|
|
|
@ -120,12 +120,12 @@ static void gmc1_motion(MpegEncContext *s, |
|
|
|
|
|
|
|
|
|
ptr = ref_picture[2] + offset; |
|
|
|
|
if (emu) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, |
|
|
|
|
uvlinesize, uvlinesize, |
|
|
|
|
9, 9, |
|
|
|
|
src_x, src_y, |
|
|
|
|
s->h_edge_pos >> 1, s->v_edge_pos >> 1); |
|
|
|
|
ptr = s->edge_emu_buffer; |
|
|
|
|
ptr = s->sc.edge_emu_buffer; |
|
|
|
|
} |
|
|
|
|
s->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8, |
|
|
|
|
motion_x & 15, motion_y & 15, 128 - s->no_rounding); |
|
|
|
@ -213,12 +213,12 @@ static inline int hpel_motion(MpegEncContext *s, |
|
|
|
|
if (s->unrestricted_mv) { |
|
|
|
|
if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 8, 0) || |
|
|
|
|
(unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 1) - 8, 0)) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, src, |
|
|
|
|
s->linesize, s->linesize, |
|
|
|
|
9, 9, |
|
|
|
|
src_x, src_y, s->h_edge_pos, |
|
|
|
|
s->v_edge_pos); |
|
|
|
|
src = s->edge_emu_buffer; |
|
|
|
|
src = s->sc.edge_emu_buffer; |
|
|
|
|
emu = 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -318,14 +318,14 @@ void mpeg_motion_internal(MpegEncContext *s, |
|
|
|
|
src_y); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, |
|
|
|
|
s->linesize, s->linesize, |
|
|
|
|
17, 17 + field_based, |
|
|
|
|
src_x, src_y << field_based, |
|
|
|
|
s->h_edge_pos, s->v_edge_pos); |
|
|
|
|
ptr_y = s->edge_emu_buffer; |
|
|
|
|
ptr_y = s->sc.edge_emu_buffer; |
|
|
|
|
if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) { |
|
|
|
|
uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize; |
|
|
|
|
uint8_t *uvbuf = s->sc.edge_emu_buffer + 18 * s->linesize; |
|
|
|
|
s->vdsp.emulated_edge_mc(uvbuf, ptr_cb, |
|
|
|
|
s->uvlinesize, s->uvlinesize, |
|
|
|
|
9, 9 + field_based, |
|
|
|
@ -476,7 +476,7 @@ static inline void obmc_motion(MpegEncContext *s, |
|
|
|
|
if (i && mv[i][0] == mv[MID][0] && mv[i][1] == mv[MID][1]) { |
|
|
|
|
ptr[i] = ptr[MID]; |
|
|
|
|
} else { |
|
|
|
|
ptr[i] = s->obmc_scratchpad + 8 * (i & 1) + |
|
|
|
|
ptr[i] = s->sc.obmc_scratchpad + 8 * (i & 1) + |
|
|
|
|
s->linesize * 8 * (i >> 1); |
|
|
|
|
hpel_motion(s, ptr[i], src, src_x, src_y, pix_op, |
|
|
|
|
mv[i][0], mv[i][1]); |
|
|
|
@ -539,14 +539,14 @@ static inline void qpel_motion(MpegEncContext *s, |
|
|
|
|
|
|
|
|
|
if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 16, 0) || |
|
|
|
|
(unsigned)src_y > FFMAX(v_edge_pos - (motion_y & 3) - h, 0)) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, |
|
|
|
|
s->linesize, s->linesize, |
|
|
|
|
17, 17 + field_based, |
|
|
|
|
src_x, src_y << field_based, |
|
|
|
|
s->h_edge_pos, s->v_edge_pos); |
|
|
|
|
ptr_y = s->edge_emu_buffer; |
|
|
|
|
ptr_y = s->sc.edge_emu_buffer; |
|
|
|
|
if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) { |
|
|
|
|
uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize; |
|
|
|
|
uint8_t *uvbuf = s->sc.edge_emu_buffer + 18 * s->linesize; |
|
|
|
|
s->vdsp.emulated_edge_mc(uvbuf, ptr_cb, |
|
|
|
|
s->uvlinesize, s->uvlinesize, |
|
|
|
|
9, 9 + field_based, |
|
|
|
@ -622,22 +622,22 @@ static void chroma_4mv_motion(MpegEncContext *s, |
|
|
|
|
ptr = ref_picture[1] + offset; |
|
|
|
|
if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) || |
|
|
|
|
(unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, |
|
|
|
|
s->uvlinesize, s->uvlinesize, |
|
|
|
|
9, 9, src_x, src_y, |
|
|
|
|
s->h_edge_pos >> 1, s->v_edge_pos >> 1); |
|
|
|
|
ptr = s->edge_emu_buffer; |
|
|
|
|
ptr = s->sc.edge_emu_buffer; |
|
|
|
|
emu = 1; |
|
|
|
|
} |
|
|
|
|
pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8); |
|
|
|
|
|
|
|
|
|
ptr = ref_picture[2] + offset; |
|
|
|
|
if (emu) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, |
|
|
|
|
s->uvlinesize, s->uvlinesize, |
|
|
|
|
9, 9, src_x, src_y, |
|
|
|
|
s->h_edge_pos >> 1, s->v_edge_pos >> 1); |
|
|
|
|
ptr = s->edge_emu_buffer; |
|
|
|
|
ptr = s->sc.edge_emu_buffer; |
|
|
|
|
} |
|
|
|
|
pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8); |
|
|
|
|
} |
|
|
|
@ -780,13 +780,13 @@ static inline void apply_8x8(MpegEncContext *s, |
|
|
|
|
ptr = ref_picture[0] + (src_y * s->linesize) + (src_x); |
|
|
|
|
if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) || |
|
|
|
|
(unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) { |
|
|
|
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, |
|
|
|
|
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, |
|
|
|
|
s->linesize, s->linesize, |
|
|
|
|
9, 9, |
|
|
|
|
src_x, src_y, |
|
|
|
|
s->h_edge_pos, |
|
|
|
|
s->v_edge_pos); |
|
|
|
|
ptr = s->edge_emu_buffer; |
|
|
|
|
ptr = s->sc.edge_emu_buffer; |
|
|
|
|
} |
|
|
|
|
dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize; |
|
|
|
|
qpix_op[1][dxy](dest, ptr, s->linesize); |
|
|
|
|