diff options
author | Ronald S. Bultje <rbultje@gmail.com> | 2013-10-14 03:13:10 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-11-15 10:16:27 +0100 |
commit | 458446acfa1441d283dacf9e6e545beb083b8bb0 (patch) | |
tree | 49178dd81fe5208c996c942fb0c7e7a08f2e51db /libavcodec/mpegvideo_motion.c | |
parent | 3cbe1126530449336e2ce59b194bdb8c4eb4abb4 (diff) | |
download | ffmpeg-458446acfa1441d283dacf9e6e545beb083b8bb0.tar.gz |
lavc: Edge emulation with dst/src linesize
Allow supporting files for which the image stride is smaller than
the maximum block size + number of subpel mc taps, e.g. a 64x64 VP9
file or a 16x16 VP8 file with -fflags +emu_edge.
Diffstat (limited to 'libavcodec/mpegvideo_motion.c')
-rw-r--r-- | libavcodec/mpegvideo_motion.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index df7ddf7c3b..fafbaa9f03 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -63,7 +63,7 @@ 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, - linesize, + linesize, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos); @@ -109,7 +109,7 @@ static void gmc1_motion(MpegEncContext *s, 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, - uvlinesize, + uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); @@ -123,7 +123,7 @@ static void gmc1_motion(MpegEncContext *s, ptr = ref_picture[2] + offset; if (emu) { s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, - uvlinesize, + uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); @@ -216,7 +216,7 @@ static inline int hpel_motion(MpegEncContext *s, 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->linesize, + s->linesize, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos); @@ -321,7 +321,7 @@ void mpeg_motion_internal(MpegEncContext *s, return; } s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, - s->linesize, + s->linesize, s->linesize, 17, 17 + field_based, src_x, src_y << field_based, s->h_edge_pos, s->v_edge_pos); @@ -329,12 +329,12 @@ void mpeg_motion_internal(MpegEncContext *s, if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) { uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize; s->vdsp.emulated_edge_mc(uvbuf, ptr_cb, - s->uvlinesize, + s->uvlinesize, s->uvlinesize, 9, 9 + field_based, uvsrc_x, uvsrc_y << field_based, s->h_edge_pos >> 1, s->v_edge_pos >> 1); s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr, - s->uvlinesize, + s->uvlinesize, s->uvlinesize, 9, 9 + field_based, uvsrc_x, uvsrc_y << field_based, s->h_edge_pos >> 1, s->v_edge_pos >> 1); @@ -542,7 +542,7 @@ 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->linesize, + s->linesize, s->linesize, 17, 17 + field_based, src_x, src_y << field_based, s->h_edge_pos, s->v_edge_pos); @@ -550,12 +550,12 @@ static inline void qpel_motion(MpegEncContext *s, if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) { uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize; s->vdsp.emulated_edge_mc(uvbuf, ptr_cb, - s->uvlinesize, + s->uvlinesize, s->uvlinesize, 9, 9 + field_based, uvsrc_x, uvsrc_y << field_based, s->h_edge_pos >> 1, s->v_edge_pos >> 1); s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr, - s->uvlinesize, + s->uvlinesize, s->uvlinesize, 9, 9 + field_based, uvsrc_x, uvsrc_y << field_based, s->h_edge_pos >> 1, s->v_edge_pos >> 1); @@ -625,8 +625,8 @@ static void chroma_4mv_motion(MpegEncContext *s, if (s->flags & CODEC_FLAG_EMU_EDGE) { 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->uvlinesize, + s->vdsp.emulated_edge_mc(s->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; @@ -637,8 +637,8 @@ static void chroma_4mv_motion(MpegEncContext *s, ptr = ref_picture[2] + offset; if (emu) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, - ptr, s->uvlinesize, + s->vdsp.emulated_edge_mc(s->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; @@ -786,7 +786,7 @@ static inline void apply_8x8(MpegEncContext *s, 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->linesize, + s->linesize, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, |