37#define SWS_MAX_PADDING 64
42 int x_start,
int y_start,
int x_end,
int y_end)
47 for (
int i = 0;
i < p->num_planes;
i++) {
50 const int idx = p->index[
i];
51 const uint8_t *in = (idx >= 0) ? exec->
in[idx] :
NULL;
52 const ptrdiff_t in_stride = (idx >= 0) ? exec->
in_stride[idx] : 0;
60 int lines = y_end - y_start;
63 const size_t abs_stride =
FFABS(out_stride);
64 if ((!in || out_stride == in_stride) &&
67 const ptrdiff_t
offset = (lines - 1) * out_stride;
72 bytes += (lines - 1) * abs_stride;
77 for (
int y = 0; y < lines; y++) {
78 memset(
out, p->clear_value[
i], bytes);
82 for (
int y = 0; y < lines; y++) {
83 memcpy(
out, in, bytes);
95 for (
int n = 0; n < ops->
num_ops; n++) {
101 for (
int i = 0;
i <
op->rw.elems;
i++)
107 for (
int i = 0;
i < 4;
i++) {
110 for (
int j = 0; j <
i; j++) {
111 if (
op->swizzle.in[
i] ==
op->swizzle.in[j])
114 p.index[
i] = orig.
index[
op->swizzle.in[
i]];
120 for (
int i = 0;
i < 4;
i++) {
123 if (
op->clear.value[
i].den != 1)
128 uint8_t
val =
op->clear.value[
i].num & 0xFF;
131 case 2:
ref *= 0x101;
break;
132 case 4:
ref *= 0x1010101;
break;
134 if (
ref !=
op->clear.value[
i].num)
136 p.clear_value[
i] =
val;
144 p.num_planes =
op->rw.elems;
static double val(void *priv, double ch)
static AVFormatContext * ctx
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define i(width, name, range_min, range_max)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
@ SWS_BACKEND_MEMCPY
Fast path using libc memcpy() / memset()
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Memory handling functions.
const SwsOpBackend backend_murder
int ff_sws_rw_op_planes(const SwsOp *op)
Return the number of planes involved in a read/write operation.
static int compile_ops_memcpy(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
static void process_memcpy(const SwsOpExec *exec, const void *priv, int x_start, int y_start, int x_end, int y_end)
#define SWS_MAX_PADDING
Switch to loop if total padding exceeds this number of bytes.
Copyright (C) 2025 Niklas Haas.
Main external API structure.
Copyright (C) 2026 Niklas Haas.
int32_t block_size_out[4]
Helper struct for representing a list of operations.
static int ref[MAX_W *MAX_W]
#define SWS_COMP_TEST(mask, X)
static av_const int ff_sws_pixel_type_size(SwsPixelType type)