24 ptrdiff_t buf_linesize,
25 ptrdiff_t src_linesize,
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;
38 src -= src_y * src_linesize;
39 src += (
h - 1) * src_linesize;
41 }
else if (src_y <= -block_h) {
42 src -= src_y * src_linesize;
43 src += (1 - block_h) * src_linesize;
49 }
else if (src_x <= -block_w) {
50 src += (1 - block_w - src_x) *
sizeof(
pixel);
54 start_y =
FFMAX(0, -src_y);
55 start_x =
FFMAX(0, -src_x);
56 end_y =
FFMIN(block_h,
h-src_y);
57 end_x =
FFMIN(block_w,
w-src_x);
62 src += start_y * src_linesize + start_x *
sizeof(
pixel);
66 for (y = 0; y < start_y; y++) {
72 for (; y < end_y; y++) {
80 for (; y < block_h; y++) {
85 buf -= block_h * buf_linesize + start_x *
sizeof(
pixel);
90 for(x = 0; x < start_x; x++) {
91 bufp[x] = bufp[start_x];
95 for (x = end_x; x < block_w; x++) {
96 bufp[x] = bufp[end_x - 1];
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)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...