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;
39 src -= src_y * src_linesize;
40 src += (
h - 1) * src_linesize;
42 }
else if (src_y <= -block_h) {
43 src -= src_y * src_linesize;
44 src += (1 - block_h) * src_linesize;
51 }
else if (src_x <= -block_w) {
52 src += (1 - block_w - src_x) *
sizeof(
pixel);
56 start_y =
FFMAX(0, -src_y);
57 start_x =
FFMAX(0, -src_x);
58 end_y =
FFMIN(block_h,
h-src_y);
59 end_x =
FFMIN(block_w,
w-src_x);
64 src += start_y * src_linesize + start_x * (ptrdiff_t)
sizeof(
pixel);
65 buf += start_x *
sizeof(
pixel);
68 for (y = 0; y < start_y; y++) {
74 for (; y < end_y; y++) {
82 for (; y < block_h; y++) {
87 buf -= block_h * buf_linesize + start_x * (ptrdiff_t)
sizeof(
pixel);
92 for(x = 0; x < start_x; x++) {
93 bufp[x] = bufp[start_x];
97 for (x = end_x; x < block_w; x++) {
98 bufp[x] = bufp[end_x - 1];