diff options
Diffstat (limited to 'libavcodec/videodsp_template.c')
-rw-r--r-- | libavcodec/videodsp_template.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libavcodec/videodsp_template.c b/libavcodec/videodsp_template.c index 5d5a32ff60..98313ac5cd 100644 --- a/libavcodec/videodsp_template.c +++ b/libavcodec/videodsp_template.c @@ -22,7 +22,8 @@ #include "bit_depth_template.c" static void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, - ptrdiff_t linesize, + ptrdiff_t buf_linesize, + ptrdiff_t src_linesize, int block_w, int block_h, int src_x, int src_y, int w, int h) { @@ -30,10 +31,10 @@ static void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int start_y, start_x, end_y, end_x; if (src_y >= h) { - src += (h - 1 - src_y) * linesize; + src += (h - 1 - src_y) * src_linesize; src_y = h - 1; } else if (src_y <= -block_h) { - src += (1 - block_h - src_y) * linesize; + src += (1 - block_h - src_y) * src_linesize; src_y = 1 - block_h; } if (src_x >= w) { @@ -52,30 +53,30 @@ static void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, assert(start_x < end_x && block_w); w = end_x - start_x; - src += start_y * linesize + 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 += linesize; + buf += buf_linesize; } // copy existing part for (; y < end_y; y++) { memcpy(buf, src, w * sizeof(pixel)); - src += linesize; - buf += linesize; + src += src_linesize; + buf += buf_linesize; } // bottom - src -= linesize; + src -= src_linesize; for (; y < block_h; y++) { memcpy(buf, src, w * sizeof(pixel)); - buf += linesize; + buf += buf_linesize; } - buf -= block_h * linesize + start_x * sizeof(pixel); + buf -= block_h * buf_linesize + start_x * sizeof(pixel); while (block_h--) { pixel *bufp = (pixel *) buf; @@ -88,6 +89,6 @@ static void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, for (x = end_x; x < block_w; x++) { bufp[x] = bufp[end_x - 1]; } - buf += linesize; + buf += buf_linesize; } } |