25 ptrdiff_t buf_linesize,
26 ptrdiff_t src_linesize,
27 int block_w,
int block_h,
28 int src_x,
int src_y,
int w,
int h)
31 int start_y, start_x, end_y, end_x;
34 src += (h - 1 - src_y) * src_linesize;
36 }
else if (src_y <= -block_h) {
37 src += (1 - block_h - src_y) * src_linesize;
41 src += (w - 1 - src_x) *
sizeof(
pixel);
43 }
else if (src_x <= -block_w) {
44 src += (1 - block_w - src_x) *
sizeof(
pixel);
48 start_y =
FFMAX(0, -src_y);
49 start_x =
FFMAX(0, -src_x);
50 end_y =
FFMIN(block_h, h-src_y);
51 end_x =
FFMIN(block_w, w-src_x);
52 assert(start_y < end_y && block_h);
53 assert(start_x < end_x && block_w);
56 src += start_y * src_linesize + start_x *
sizeof(
pixel);
57 buf += start_x *
sizeof(
pixel);
60 for (y = 0; y < start_y; y++) {
61 memcpy(buf, src, w *
sizeof(
pixel));
66 for (; y < end_y; y++) {
67 memcpy(buf, src, w *
sizeof(
pixel));
74 for (; y < block_h; y++) {
75 memcpy(buf, src, w *
sizeof(
pixel));
79 buf -= block_h * buf_linesize + start_x *
sizeof(
pixel);
84 for(x = 0; x < start_x; x++) {
85 bufp[x] = bufp[start_x];
89 for (x = end_x; x < block_w; x++) {
90 bufp[x] = bufp[end_x - 1];
static 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)