26 int block_w,
int block_h,
27 int src_x,
int src_y,
int w,
int h)
30 int start_y, start_x, end_y, end_x;
33 src += (h - 1 - src_y) * linesize;
35 }
else if (src_y <= -block_h) {
36 src += (1 - block_h - src_y) * linesize;
40 src += (w - 1 - src_x) *
sizeof(
pixel);
42 }
else if (src_x <= -block_w) {
43 src += (1 - block_w - src_x) *
sizeof(
pixel);
47 start_y =
FFMAX(0, -src_y);
48 start_x =
FFMAX(0, -src_x);
49 end_y =
FFMIN(block_h, h-src_y);
50 end_x =
FFMIN(block_w, w-src_x);
51 assert(start_y < end_y && block_h);
52 assert(start_x < end_x && block_w);
55 src += start_y * linesize + start_x *
sizeof(
pixel);
56 buf += start_x *
sizeof(
pixel);
59 for (y = 0; y < start_y; y++) {
60 memcpy(buf, src, w *
sizeof(
pixel));
65 for (; y < end_y; y++) {
66 memcpy(buf, src, w *
sizeof(
pixel));
73 for (; y < block_h; y++) {
74 memcpy(buf, src, w *
sizeof(
pixel));
78 buf -= block_h * linesize + start_x *
sizeof(
pixel);
83 for(x = 0; x < start_x; x++) {
84 bufp[x] = bufp[start_x];
88 for (x = end_x; x < block_w; x++) {
89 bufp[x] = bufp[end_x - 1];
static void FUNC() ff_emulated_edge_mc(uint8_t *buf, const uint8_t *src, ptrdiff_t linesize, int block_w, int block_h, int src_x, int src_y, int w, int h)