summaryrefslogtreecommitdiff
path: root/libavcodec/videodsp_template.c
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 /libavcodec/videodsp_template.c
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>
Diffstat (limited to 'libavcodec/videodsp_template.c')
-rw-r--r--libavcodec/videodsp_template.c29
1 files changed, 15 insertions, 14 deletions
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;
}
}