aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-15 13:56:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-15 15:07:10 +0100
commit91e00c4a785d3f4cd44f1044d3e7b1b34fee8b5c (patch)
treea866df7014974a63c167522f426dc53596d3c77b
parente28130bcaf48281b431ea611a546e7520bb90dda (diff)
parent458446acfa1441d283dacf9e6e545beb083b8bb0 (diff)
downloadffmpeg-91e00c4a785d3f4cd44f1044d3e7b1b34fee8b5c.tar.gz
Merge commit '458446acfa1441d283dacf9e6e545beb083b8bb0'
* commit '458446acfa1441d283dacf9e6e545beb083b8bb0': lavc: Edge emulation with dst/src linesize Conflicts: libavcodec/cavs.c libavcodec/h264.c libavcodec/hevc.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/rv34.c libavcodec/svq3.c libavcodec/vc1dec.c libavcodec/videodsp.h libavcodec/videodsp_template.c libavcodec/vp3.c libavcodec/vp8.c libavcodec/wmv2.c libavcodec/x86/videodsp.asm libavcodec/x86/videodsp_init.c Changes to the asm are not merged, they are left for volunteers or in their absence for later. The changes this merge introduces are reordering of the function arguments See: face578d56c2d1375e40d5e2a28acc122132bc55 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/cavs.c13
-rw-r--r--libavcodec/diracdec.c4
-rw-r--r--libavcodec/h264.c18
-rw-r--r--libavcodec/hevc.c9
-rw-r--r--libavcodec/mpegvideo.c41
-rw-r--r--libavcodec/mpegvideo_enc.c18
-rw-r--r--libavcodec/mpegvideo_motion.c56
-rw-r--r--libavcodec/rv34.c18
-rw-r--r--libavcodec/snow.c3
-rw-r--r--libavcodec/svq3.c8
-rw-r--r--libavcodec/vc1dec.c58
-rw-r--r--libavcodec/videodsp.h15
-rw-r--r--libavcodec/videodsp_template.c29
-rw-r--r--libavcodec/vp3.c7
-rw-r--r--libavcodec/vp56.c11
-rw-r--r--libavcodec/vp8.c15
-rw-r--r--libavcodec/vp9.c14
-rw-r--r--libavcodec/wmv2.c24
-rw-r--r--libavcodec/x86/dsputil_mmx.c7
-rw-r--r--libavcodec/x86/videodsp_init.c30
20 files changed, 226 insertions, 172 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index 42b82e453c..cc544293d1 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -407,8 +407,9 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
full_my < 0 - extra_height ||
full_mx + 16 /* FIXME */ > pic_width + extra_width ||
full_my + 16 /* FIXME */ > pic_height + extra_height) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->l_stride,
- src_y - 2 - 2 * h->l_stride, h->l_stride,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
+ src_y - 2 - 2 * h->l_stride,
+ h->l_stride, h->l_stride,
16 + 5, 16 + 5 /* FIXME */,
full_mx - 2, full_my - 2,
pic_width, pic_height);
@@ -420,8 +421,8 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
qpix_op[luma_xy](dest_y, src_y, h->l_stride);
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->c_stride, src_cb,
- h->c_stride,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
+ h->c_stride, h->c_stride,
9, 9 /* FIXME */,
mx >> 3, my >> 3,
pic_width >> 1, pic_height >> 1);
@@ -430,8 +431,8 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx & 7, my & 7);
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->c_stride, src_cr,
- h->c_stride,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
+ h->c_stride, h->c_stride,
9, 9 /* FIXME */,
mx >> 3, my >> 3,
pic_width >> 1, pic_height >> 1);
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 15baf75108..dbc2aab334 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1414,8 +1414,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
y + p->yblen > p->height+EDGE_WIDTH/2 ||
x < 0 || y < 0) {
for (i = 0; i < nplanes; i++) {
- ff_emulated_edge_mc(s->edge_emu_buffer[i], p->stride,
- src[i], p->stride,
+ ff_emulated_edge_mc(s->edge_emu_buffer[i], src[i],
+ p->stride, p->stride,
p->xblen, p->yblen, x, y,
p->width+EDGE_WIDTH/2, p->height+EDGE_WIDTH/2);
src[i] = s->edge_emu_buffer[i];
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a025d9fd0c..3d269e9f3e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -934,9 +934,9 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
full_my < 0 - extra_height ||
full_mx + 16 /*FIXME*/ > pic_width + extra_width ||
full_my + 16 /*FIXME*/ > pic_height + extra_height) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->mb_linesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize,
+ h->mb_linesize, h->mb_linesize,
16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
full_my - 2, pic_width, pic_height);
src_y = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
@@ -953,9 +953,9 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
if (chroma_idc == 3 /* yuv444 */) {
src_cb = pic->f.data[1] + offset;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->mb_linesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize,
+ h->mb_linesize, h->mb_linesize,
16 + 5, 16 + 5 /*FIXME*/,
full_mx - 2, full_my - 2,
pic_width, pic_height);
@@ -967,9 +967,9 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
src_cr = pic->f.data[2] + offset;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->mb_linesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize,
+ h->mb_linesize, h->mb_linesize,
16 + 5, 16 + 5 /*FIXME*/,
full_mx - 2, full_my - 2,
pic_width, pic_height);
@@ -994,7 +994,8 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
(my >> ysh) * h->mb_uvlinesize;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->mb_uvlinesize, src_cb, h->mb_uvlinesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
+ h->mb_uvlinesize, h->mb_uvlinesize,
9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
src_cb = h->edge_emu_buffer;
@@ -1004,7 +1005,8 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->mb_uvlinesize, src_cr, h->mb_uvlinesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
+ h->mb_uvlinesize, h->mb_uvlinesize,
9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
src_cr = h->edge_emu_buffer;
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 5564a697cb..eb3cb75017 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1026,7 +1026,8 @@ static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,
y_off >= pic_height - block_h - ff_hevc_qpel_extra_after[my]) {
int offset = extra_top * srcstride + (extra_left << s->sps->pixel_shift);
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, srcstride, src - offset, srcstride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset,
+ srcstride, srcstride,
block_w + ff_hevc_qpel_extra[mx],
block_h + ff_hevc_qpel_extra[my],
x_off - extra_left, y_off - extra_top,
@@ -1077,7 +1078,8 @@ static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->sps->pixel_shift));
int offset2 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->sps->pixel_shift));
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1stride, src1 - offset1, src1stride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1 - offset1,
+ src1stride, src1stride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
x_off - EPEL_EXTRA_BEFORE,
y_off - EPEL_EXTRA_BEFORE,
@@ -1087,7 +1089,8 @@ static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
s->hevcdsp.put_hevc_epel[!!my][!!mx](dst1, dststride, src1, src1stride,
block_w, block_h, mx, my, lc->mc_buffer);
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src2stride, src2 - offset2, src2stride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src2 - offset2,
+ src2stride, src2stride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
x_off - EPEL_EXTRA_BEFORE,
y_off - EPEL_EXTRA_BEFORE,
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 9eeb20d3b9..0d50befa8c 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2227,12 +2227,11 @@ static inline int hpel_motion_lowres(MpegEncContext *s,
if ((unsigned)src_x > FFMAX( h_edge_pos - (!!sx) - w, 0) ||
(unsigned)src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize,
- src, s->linesize, w + 1,
- (h + 1) << field_based, src_x,
- src_y << field_based,
- h_edge_pos,
- v_edge_pos);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
+ s->linesize, s->linesize,
+ w + 1, (h + 1) << field_based,
+ src_x, src_y << field_based,
+ h_edge_pos, v_edge_pos);
src = s->edge_emu_buffer;
emu = 1;
}
@@ -2330,21 +2329,22 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 ||
(unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, linesize >> field_based, ptr_y,
- linesize >> field_based, 17, 17 + field_based,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
+ linesize >> field_based, linesize >> field_based,
+ 17, 17 + field_based,
src_x, src_y << field_based, h_edge_pos,
v_edge_pos);
ptr_y = s->edge_emu_buffer;
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize;
- s->vdsp.emulated_edge_mc(uvbuf, uvlinesize >> field_based,
- ptr_cb, uvlinesize >> field_based, 9,
- 9 + field_based,
+ s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
+ uvlinesize >> field_based, uvlinesize >> field_based,
+ 9, 9 + field_based,
uvsrc_x, uvsrc_y << field_based,
h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(uvbuf + 16, uvlinesize >> field_based,
- ptr_cr, uvlinesize >> field_based, 9,
- 9 + field_based,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
+ uvlinesize >> field_based,uvlinesize >> field_based,
+ 9, 9 + field_based,
uvsrc_x, uvsrc_y << field_based,
h_edge_pos >> 1, v_edge_pos >> 1);
ptr_cb = uvbuf;
@@ -2416,8 +2416,10 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
ptr = ref_picture[1] + offset;
if ((unsigned) src_x > FFMAX(h_edge_pos - (!!sx) - block_s, 0) ||
(unsigned) src_y > FFMAX(v_edge_pos - (!!sy) - block_s, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize, ptr, s->uvlinesize,
- 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->uvlinesize, s->uvlinesize,
+ 9, 9,
+ src_x, src_y, h_edge_pos, v_edge_pos);
ptr = s->edge_emu_buffer;
emu = 1;
}
@@ -2427,9 +2429,10 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
ptr = ref_picture[2] + offset;
if (emu) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize,
- ptr, s->uvlinesize, 9, 9,
- src_x, src_y, h_edge_pos, v_edge_pos);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->uvlinesize, s->uvlinesize,
+ 9, 9,
+ src_x, src_y, h_edge_pos, v_edge_pos);
ptr = s->edge_emu_buffer;
}
pix_op[op_index](dest_cr, ptr, s->uvlinesize, block_s, sx, sy);
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 1a22fba5e9..9288049470 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1837,15 +1837,21 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
uint8_t *ebuf = s->edge_emu_buffer + 32;
int cw = (s->width + s->chroma_x_shift) >> s->chroma_x_shift;
int ch = (s->height + s->chroma_y_shift) >> s->chroma_y_shift;
- s->vdsp.emulated_edge_mc(ebuf, wrap_y, ptr_y, wrap_y, 16, 16, mb_x * 16,
- mb_y * 16, s->width, s->height);
+ s->vdsp.emulated_edge_mc(ebuf, ptr_y,
+ wrap_y, wrap_y,
+ 16, 16, mb_x * 16, mb_y * 16,
+ s->width, s->height);
ptr_y = ebuf;
- s->vdsp.emulated_edge_mc(ebuf + 18 * wrap_y, wrap_c, ptr_cb, wrap_c, mb_block_width,
- mb_block_height, mb_x * mb_block_width, mb_y * mb_block_height,
+ s->vdsp.emulated_edge_mc(ebuf + 18 * wrap_y, ptr_cb,
+ wrap_c, wrap_c,
+ mb_block_width, mb_block_height,
+ mb_x * mb_block_width, mb_y * mb_block_height,
cw, ch);
ptr_cb = ebuf + 18 * wrap_y;
- s->vdsp.emulated_edge_mc(ebuf + 18 * wrap_y + 16, wrap_c, ptr_cr, wrap_c, mb_block_width,
- mb_block_height, mb_x * mb_block_width, mb_y * mb_block_height,
+ s->vdsp.emulated_edge_mc(ebuf + 18 * wrap_y + 16, ptr_cr,
+ wrap_c, wrap_c,
+ mb_block_width, mb_block_height,
+ mb_x * mb_block_width, mb_y * mb_block_height,
cw, ch);
ptr_cr = ebuf + 18 * wrap_y + 16;
}
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index 48bfe5d52a..9ec3789058 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -62,8 +62,8 @@ 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, linesize, ptr,
- linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ linesize, linesize,
17, 17,
src_x, src_y,
s->h_edge_pos, s->v_edge_pos);
@@ -106,8 +106,8 @@ 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, uvlinesize,
- ptr, uvlinesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ uvlinesize, uvlinesize,
9, 9,
src_x, src_y,
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
@@ -119,8 +119,8 @@ static void gmc1_motion(MpegEncContext *s,
ptr = ref_picture[2] + offset;
if (emu) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, uvlinesize,
- ptr, uvlinesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ uvlinesize, uvlinesize,
9, 9,
src_x, src_y,
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
@@ -212,8 +212,8 @@ static inline int hpel_motion(MpegEncContext *s,
if (s->flags & CODEC_FLAG_EMU_EDGE) {
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, s->linesize, src,
- s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
+ s->linesize, s->linesize,
9, 9,
src_x, src_y,
s->h_edge_pos, s->v_edge_pos);
@@ -317,21 +317,21 @@ void mpeg_motion_internal(MpegEncContext *s,
src_y);
return;
}
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize, ptr_y,
- s->linesize,
+ s->vdsp.emulated_edge_mc(s->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;
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize;
- s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize, ptr_cb,
- s->uvlinesize,
+ s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
+ 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, s->uvlinesize, ptr_cr,
- s->uvlinesize,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
+ s->uvlinesize, s->uvlinesize,
9, 9 + field_based,
uvsrc_x, uvsrc_y << field_based,
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
@@ -538,24 +538,21 @@ 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,
- s->linesize,
- ptr_y, s->linesize,
+ s->vdsp.emulated_edge_mc(s->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;
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize;
- s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize,
- ptr_cb,
- s->uvlinesize,
+ s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
+ 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, s->uvlinesize,
- ptr_cr,
- s->uvlinesize,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
+ 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 +622,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, s->uvlinesize,
- 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 +634,8 @@ static void chroma_4mv_motion(MpegEncContext *s,
ptr = ref_picture[2] + offset;
if (emu) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize,
- 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;
@@ -785,9 +782,8 @@ static inline void apply_8x8(MpegEncContext *s,
if (s->flags & CODEC_FLAG_EMU_EDGE) {
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,
- s->linesize, ptr,
- s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->linesize, s->linesize,
9, 9,
src_x, src_y,
s->h_edge_pos,
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 4896b39a8c..1aee59ce73 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -724,15 +724,21 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
uint8_t *uvbuf = s->edge_emu_buffer + 22 * s->linesize;
srcY -= 2 + 2*s->linesize;
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize, srcY, s->linesize,
- (width<<3)+6, (height<<3)+6, src_x - 2, src_y - 2,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
+ (width << 3) + 6, (height << 3) + 6,
+ src_x - 2, src_y - 2,
s->h_edge_pos, s->v_edge_pos);
srcY = s->edge_emu_buffer + 2 + 2*s->linesize;
- s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize, srcU, s->uvlinesize,
- (width<<2)+1, (height<<2)+1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(uvbuf, srcU,
+ s->uvlinesize, s->uvlinesize,
+ (width << 2) + 1, (height << 2) + 1,
+ uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(uvbuf + 16, s->uvlinesize, srcV, s->uvlinesize,
- (width<<2)+1, (height<<2)+1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ (width << 2) + 1, (height << 2) + 1,
+ uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
srcU = uvbuf;
srcV = uvbuf + 16;
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index b54c491f42..c645b120fb 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -349,7 +349,8 @@ void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, ptrdiff_t st
src += sx + sy*stride;
if( (unsigned)sx >= FFMAX(w - b_w - (HTAPS_MAX-2), 0)
|| (unsigned)sy >= FFMAX(h - b_h - (HTAPS_MAX-2), 0)){
- s->vdsp.emulated_edge_mc(tmp + MB_SIZE, stride, src, stride,
+ s->vdsp.emulated_edge_mc(tmp + MB_SIZE, src,
+ stride, stride,
b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1,
sx, sy, w, h);
src= tmp + MB_SIZE;
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index a717e9d17d..189be48c36 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -317,8 +317,8 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
src = pic->f.data[0] + mx + my * h->linesize;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->linesize,
- src, h->linesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src,
+ h->linesize, h->linesize,
width + 1, height + 1,
mx, my, s->h_edge_pos, s->v_edge_pos);
src = h->edge_emu_buffer;
@@ -344,8 +344,8 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
src = pic->f.data[i] + mx + my * h->uvlinesize;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->uvlinesize,
- src, h->uvlinesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src,
+ h->uvlinesize, h->uvlinesize,
width + 1, height + 1,
mx, my, (s->h_edge_pos >> 1),
s->v_edge_pos >> 1);
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 1d54904a19..0f6ebac22f 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -454,17 +454,21 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
srcY -= s->mspel * (1 + s->linesize);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize,
- srcY, s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
17 + s->mspel * 2, 17 + s->mspel * 2,
src_x - s->mspel, src_y - s->mspel,
s->h_edge_pos, v_edge_pos);
srcY = s->edge_emu_buffer;
- s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize, srcU, s->uvlinesize,
- 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(uvbuf, srcU,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
+ uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(uvbuf + 16, s->uvlinesize, srcV, s->uvlinesize,
- 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
+ uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
srcU = uvbuf;
srcV = uvbuf + 16;
@@ -700,7 +704,8 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
|| (unsigned)(src_y - (s->mspel << fieldmv)) > v_edge_pos - (my & 3) - ((8 + s->mspel * 2) << fieldmv)) {
srcY -= s->mspel * (1 + (s->linesize << fieldmv));
/* check emulate edge stride and offset */
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize, srcY, s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
9 + s->mspel * 2, (9 + s->mspel * 2) << fieldmv,
src_x - s->mspel, src_y - (s->mspel << fieldmv),
s->h_edge_pos, v_edge_pos);
@@ -915,11 +920,13 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
|| s->h_edge_pos < 18 || v_edge_pos < 18
|| (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 9
|| (unsigned)uvsrc_y > (v_edge_pos >> 1) - 9) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize, srcU,
- s->uvlinesize, 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, s->uvlinesize, srcV,
- s->uvlinesize, 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
srcU = s->edge_emu_buffer;
srcV = s->edge_emu_buffer + 16;
@@ -1036,12 +1043,14 @@ static void vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
|| s->h_edge_pos < 10 || v_edge_pos < (5 << fieldmv)
|| (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 5
|| (unsigned)uvsrc_y > v_edge_pos - (5 << fieldmv)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize, srcU,
- s->uvlinesize, 5, (5 << fieldmv), uvsrc_x,
- uvsrc_y, s->h_edge_pos >> 1, v_edge_pos);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, s->uvlinesize, srcV,
- s->uvlinesize, 5, (5 << fieldmv), uvsrc_x,
- uvsrc_y, s->h_edge_pos >> 1, v_edge_pos);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU,
+ s->uvlinesize, s->uvlinesize,
+ 5, (5 << fieldmv), uvsrc_x, uvsrc_y,
+ s->h_edge_pos >> 1, v_edge_pos);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ 5, (5 << fieldmv), uvsrc_x, uvsrc_y,
+ s->h_edge_pos >> 1, v_edge_pos);
srcU = s->edge_emu_buffer;
srcV = s->edge_emu_buffer + 16;
@@ -1968,16 +1977,21 @@ static void vc1_interp_mc(VC1Context *v)
uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
srcY -= s->mspel * (1 + s->linesize);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize, srcY, s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
17 + s->mspel * 2, 17 + s->mspel * 2,
src_x - s->mspel, src_y - s->mspel,
s->h_edge_pos, v_edge_pos);
srcY = s->edge_emu_buffer;
- s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize, srcU, s->uvlinesize,
- 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(uvbuf, srcU,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
+ uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(uvbuf + 16, s->uvlinesize, srcV, s->uvlinesize,
- 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
+ uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
srcU = uvbuf;
srcV = uvbuf + 16;
diff --git a/libavcodec/videodsp.h b/libavcodec/videodsp.h
index e1f7ee586f..0bb15f2c94 100644
--- a/libavcodec/videodsp.h
+++ b/libavcodec/videodsp.h
@@ -30,8 +30,8 @@
#include <stdint.h>
#define EMULATED_EDGE(depth) \
-void ff_emulated_edge_mc_ ## depth(uint8_t *dst, ptrdiff_t dst_stride, \
- const uint8_t *src, ptrdiff_t src_stride, \
+void ff_emulated_edge_mc_ ## depth(uint8_t *dst, const uint8_t *src, \
+ ptrdiff_t dst_stride, ptrdiff_t src_stride, \
int block_w, int block_h,\
int src_x, int src_y, int w, int h);
@@ -47,8 +47,10 @@ typedef struct VideoDSPContext {
* @param dst_stride number of bytes between 2 vertically adjacent samples
* in destination buffer
* @param src source buffer
- * @param src_stride number of bytes between 2 vertically adjacent samples
- * in source buffer
+ * @param dst_linesize number of bytes between 2 vertically adjacent
+ * samples in the destination buffer
+ * @param src_linesize number of bytes between 2 vertically adjacent
+ * samples in both the source buffer
* @param block_w width of block
* @param block_h height of block
* @param src_x x coordinate of the top left sample of the block in the
@@ -58,8 +60,9 @@ typedef struct VideoDSPContext {
* @param w width of the source buffer
* @param h height of the source buffer
*/
- void (*emulated_edge_mc)(uint8_t *dst, ptrdiff_t dst_stride,
- const uint8_t *src, ptrdiff_t src_stride,
+ void (*emulated_edge_mc)(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_linesize,
+ ptrdiff_t src_linesize,
int block_w, int block_h,
int src_x, int src_y, int w, int h);
diff --git a/libavcodec/videodsp_template.c b/libavcodec/videodsp_template.c
index f7e7bfdb13..c569c30d60 100644
--- a/libavcodec/videodsp_template.c
+++ b/libavcodec/videodsp_template.c
@@ -20,8 +20,9 @@
*/
#include "bit_depth_template.c"
-void FUNC(ff_emulated_edge_mc)(uint8_t *buf, ptrdiff_t buf_stride,
- const uint8_t *src, ptrdiff_t src_stride,
+void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
+ ptrdiff_t buf_linesize,
+ ptrdiff_t src_linesize,
int block_w, int block_h,
int src_x, int src_y, int w, int h)
{
@@ -32,12 +33,12 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, ptrdiff_t buf_stride,
return;
if (src_y >= h) {
- src -= src_y * src_stride;
- src += (h - 1) * src_stride;
+ src -= src_y * src_linesize;
+ src += (h - 1) * src_linesize;
src_y = h - 1;
} else if (src_y <= -block_h) {
- src -= src_y * src_stride;
- src += (1 - block_h) * src_stride;
+ src -= src_y * src_linesize;
+ src += (1 - block_h) * src_linesize;
src_y = 1 - block_h;
}
if (src_x >= w) {
@@ -56,30 +57,30 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, ptrdiff_t buf_stride,
av_assert2(start_x < end_x && block_w);
w = end_x - start_x;
- src += start_y * src_stride + start_x * sizeof(pixel);
+ src += start_y * src_linesize + start_x * sizeof(pixel);
buf += start_x * sizeof(pixel);
// top
for (y = 0; y < start_y; y++) {
memcpy(buf, src, w * sizeof(pixel));
- buf += buf_stride;
+ buf += buf_linesize;
}
// copy existing part
for (; y < end_y; y++) {
memcpy(buf, src, w * sizeof(pixel));
- src += src_stride;
- buf += buf_stride;
+ src += src_linesize;
+ buf += buf_linesize;
}
// bottom
- src -= src_stride;
+ src -= src_linesize;
for (; y < block_h; y++) {
memcpy(buf, src, w * sizeof(pixel));
- buf += buf_stride;
+ buf += buf_linesize;
}
- buf -= block_h * buf_stride + start_x * sizeof(pixel);
+ buf -= block_h * buf_linesize + start_x * sizeof(pixel);
while (block_h--) {
pixel *bufp = (pixel *) buf;
@@ -92,6 +93,6 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, ptrdiff_t buf_stride,
for (x = end_x; x < block_w; x++) {
bufp[x] = bufp[end_x - 1];
}
- buf += buf_stride;
+ buf += buf_linesize;
}
}
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index bfe745b443..626642f4ad 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1549,10 +1549,11 @@ static void render_slice(Vp3DecodeContext *s, int slice)
uint8_t *temp= s->edge_emu_buffer;
if(stride<0) temp -= 8*stride;
- s->vdsp.emulated_edge_mc(temp, stride,
- motion_source, stride,
+ s->vdsp.emulated_edge_mc(temp, motion_source,
+ stride, stride,
9, 9, src_x, src_y,
- plane_width, plane_height);
+ plane_width,
+ plane_height);
motion_source= temp;
}
}
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index b3b9e3e4e5..a0cb060d68 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -339,11 +339,12 @@ static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
if (x<0 || x+12>=s->plane_width[plane] ||
y<0 || y+12>=s->plane_height[plane]) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, stride,
- src + s->block_offset[b] + (dy-2)*stride + (dx-2),
- stride, 12, 12, x, y,
- s->plane_width[plane],
- s->plane_height[plane]);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ src + s->block_offset[b] + (dy-2)*stride + (dx-2),
+ stride, stride,
+ 12, 12, x, y,
+ s->plane_width[plane],
+ s->plane_height[plane]);
src_block = s->edge_emu_buffer;
src_offset = 2 + 2*stride;
} else if (deblock_filtering) {
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index a7572f3935..0e4a36d138 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1196,8 +1196,9 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
src += y_off * linesize + x_off;
if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
- s->vdsp.emulated_edge_mc(td->edge_emu_buffer, 32,
- src - my_idx * linesize - mx_idx, linesize,
+ s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
+ src - my_idx * linesize - mx_idx,
+ 32, linesize,
block_w + subpel_idx[1][mx],
block_h + subpel_idx[1][my],
x_off - mx_idx, y_off - my_idx, width, height);
@@ -1249,16 +1250,18 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst
ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 3, 0);
if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
- s->vdsp.emulated_edge_mc(td->edge_emu_buffer, 32,
- src1 - my_idx * linesize - mx_idx, linesize,
+ s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
+ src1 - my_idx * linesize - mx_idx,
+ 32, linesize,
block_w + subpel_idx[1][mx],
block_h + subpel_idx[1][my],
x_off - mx_idx, y_off - my_idx, width, height);
src1 = td->edge_emu_buffer + mx_idx + 32 * my_idx;
mc_func[my_idx][mx_idx](dst1, linesize, src1, 32, block_h, mx, my);
- s->vdsp.emulated_edge_mc(td->edge_emu_buffer, 32,
- src2 - my_idx * linesize - mx_idx, linesize,
+ s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
+ src2 - my_idx * linesize - mx_idx,
+ 32, linesize,
block_w + subpel_idx[1][mx],
block_h + subpel_idx[1][my],
x_off - mx_idx, y_off - my_idx, width, height);
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 4f9c1ad1da..bd288ce9d6 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2223,9 +2223,9 @@ static av_always_inline void mc_luma_dir(VP9Context *s, vp9_mc_func (*mc)[2],
// FIXME bilinear filter only needs 0/1 pixels, not 3/4
if (x < !!mx * 3 || y < !!my * 3 ||
x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, 80,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
ref - !!my * 3 * ref_stride - !!mx * 3,
- ref_stride,
+ 80, ref_stride,
bw + !!mx * 7, bh + !!my * 7,
x - !!mx * 3, y - !!my * 3, w, h);
ref = s->edge_emu_buffer + !!my * 3 * 80 + !!mx * 3;
@@ -2253,15 +2253,17 @@ static av_always_inline void mc_chroma_dir(VP9Context *s, vp9_mc_func (*mc)[2],
// FIXME bilinear filter only needs 0/1 pixels, not 3/4
if (x < !!mx * 3 || y < !!my * 3 ||
x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, 80,
- ref_u - !!my * 3 * src_stride_u - !!mx * 3, src_stride_u,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ref_u - !!my * 3 * src_stride_u - !!mx * 3,
+ 80, src_stride_u,
bw + !!mx * 7, bh + !!my * 7,
x - !!mx * 3, y - !!my * 3, w, h);
ref_u = s->edge_emu_buffer + !!my * 3 * 80 + !!mx * 3;
mc[!!mx][!!my](dst_u, dst_stride, ref_u, 80, bh, mx, my);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, 80,
- ref_v - !!my * 3 * src_stride_v - !!mx * 3, src_stride_v,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ref_v - !!my * 3 * src_stride_v - !!mx * 3,
+ 80, src_stride_v,
bw + !!mx * 7, bh + !!my * 7,
x - !!mx * 3, y - !!my * 3, w, h);
ref_v = s->edge_emu_buffer + !!my * 3 * 80 + !!mx * 3;
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index 8d30259b15..30c8bc1d3a 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -119,9 +119,11 @@ void ff_mspel_motion(MpegEncContext *s,
if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
|| src_y + h+1 >= v_edge_pos){
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize,
- ptr - 1 - s->linesize, s->linesize, 19, 19,
- src_x-1, src_y-1,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ptr - 1 - s->linesize,
+ s->linesize, s->linesize,
+ 19, 19,
+ src_x - 1, src_y - 1,
s->h_edge_pos, s->v_edge_pos);
ptr= s->edge_emu_buffer + 1 + s->linesize;
emu=1;
@@ -161,18 +163,22 @@ void ff_mspel_motion(MpegEncContext *s,
offset = (src_y * uvlinesize) + src_x;
ptr = ref_picture[1] + offset;
if(emu){
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize,
- ptr, s->uvlinesize, 9, 9, src_x, src_y,
- s->h_edge_pos>>1, s->v_edge_pos>>1);
+ 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;
}
pix_op[1][dxy](dest_cb, ptr, uvlinesize, h >> 1);
ptr = ref_picture[2] + offset;
if(emu){
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize,
- ptr, s->uvlinesize, 9, 9, src_x, src_y,
- s->h_edge_pos>>1, s->v_edge_pos>>1);
+ 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;
}
pix_op[1][dxy](dest_cr, ptr, uvlinesize, h >> 1);
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 805bacd44b..df8cfdb464 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -367,8 +367,9 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
}
}
-typedef void emulated_edge_mc_func(uint8_t *dst, ptrdiff_t dst_stride,
- const uint8_t *src, ptrdiff_t src_linesize,
+typedef void emulated_edge_mc_func(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride,
+ ptrdiff_t src_linesize,
int block_w, int block_h,
int src_x, int src_y, int w, int h);
@@ -417,7 +418,7 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
src += ix + iy * stride;
if (need_emu) {
- emu_edge_fn(edge_buf, stride, src, stride, w + 1, h + 1, ix, iy, width, height);
+ emu_edge_fn(edge_buf, src, stride, stride, w + 1, h + 1, ix, iy, width, height);
src = edge_buf;
}
diff --git a/libavcodec/x86/videodsp_init.c b/libavcodec/x86/videodsp_init.c
index 0e6e0ddf1f..2013a93b90 100644
--- a/libavcodec/x86/videodsp_init.c
+++ b/libavcodec/x86/videodsp_init.c
@@ -129,8 +129,9 @@ static emu_edge_hfix_func *hfixtbl_sse2[11] = {
};
extern emu_edge_hvar_func ff_emu_edge_hvar_sse2;
-static av_always_inline void emulated_edge_mc(uint8_t *dst, ptrdiff_t dst_stride,
- const uint8_t *src, ptrdiff_t src_stride,
+static av_always_inline void emulated_edge_mc(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride,
+ ptrdiff_t src_stride,
x86_reg block_w, x86_reg block_h,
x86_reg src_x, x86_reg src_y,
x86_reg w, x86_reg h,
@@ -141,7 +142,7 @@ static av_always_inline void emulated_edge_mc(uint8_t *dst, ptrdiff_t dst_stride
{
x86_reg start_y, start_x, end_y, end_x, src_y_add = 0, p;
- if(!w || !h)
+ if (!w || !h)
return;
if (src_y >= h) {
@@ -203,34 +204,37 @@ static av_always_inline void emulated_edge_mc(uint8_t *dst, ptrdiff_t dst_stride
}
#if ARCH_X86_32
-static av_noinline void emulated_edge_mc_mmx(uint8_t *buf, ptrdiff_t buf_stride,
- const uint8_t *src, ptrdiff_t src_stride,
+static av_noinline void emulated_edge_mc_mmx(uint8_t *buf, const uint8_t *src,
+ ptrdiff_t buf_stride,
+ ptrdiff_t src_stride,
int block_w, int block_h,
int src_x, int src_y, int w, int h)
{
- emulated_edge_mc(buf, buf_stride, src, src_stride, block_w, block_h,
+ emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
src_x, src_y, w, h, vfixtbl_mmx, &ff_emu_edge_vvar_mmx,
hfixtbl_mmx, &ff_emu_edge_hvar_mmx);
}
-static av_noinline void emulated_edge_mc_sse(uint8_t *buf, ptrdiff_t buf_stride,
- const uint8_t *src, ptrdiff_t src_stride,
+static av_noinline void emulated_edge_mc_sse(uint8_t *buf, const uint8_t *src,
+ ptrdiff_t buf_stride,
+ ptrdiff_t src_stride,
int block_w, int block_h,
int src_x, int src_y, int w, int h)
{
- emulated_edge_mc(buf, buf_stride, src, src_stride, block_w, block_h,
+ emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
hfixtbl_mmx, &ff_emu_edge_hvar_mmx);
}
#endif
-static av_noinline void emulated_edge_mc_sse2(uint8_t *buf, ptrdiff_t buf_stride,
- const uint8_t *src, ptrdiff_t src_stride,
+static av_noinline void emulated_edge_mc_sse2(uint8_t *buf, const uint8_t *src,
+ ptrdiff_t buf_stride,
+ ptrdiff_t src_stride,
int block_w, int block_h,
int src_x, int src_y, int w, int h)
{
- emulated_edge_mc(buf, buf_stride, src, src_stride, block_w, block_h, src_x,
- src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
+ emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
+ src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
hfixtbl_sse2, &ff_emu_edge_hvar_sse2);
}
#endif /* HAVE_YASM */