37#define SWS_MAX_PADDING 64
42 int x_start,
int y_start,
int x_end,
int y_end)
45 const int lines = y_end - y_start;
48 for (
int i = 0;
i < p->num_planes;
i++) {
50 const int idx = p->index[
i];
53 if (idx < 0 && !use_loop) {
56 for (
int y = y_start; y < y_end; y++) {
57 memset(
out, p->clear_value[
i], bytes);
60 }
else if (
out == exec->
in[idx]) {
66 const uint8_t *in = exec->
in[idx];
67 for (
int y = y_start; y < y_end; y++) {
68 memcpy(
out, in, bytes);
80 for (
int n = 0; n < ops->
num_ops; n++) {
86 for (
int i = 0;
i <
op->rw.elems;
i++)
92 for (
int i = 0;
i < 4;
i++) {
95 for (
int j = 0; j <
i; j++) {
96 if (
op->swizzle.in[
i] ==
op->swizzle.in[j])
99 p.index[
i] = orig.
index[
op->swizzle.in[
i]];
105 for (
int i = 0;
i < 4;
i++) {
108 if (
op->clear.value[
i].den != 1)
113 uint8_t
val =
op->clear.value[
i].num & 0xFF;
116 case 2:
ref *= 0x101;
break;
117 case 4:
ref *= 0x1010101;
break;
119 if (
ref !=
op->clear.value[
i].num)
121 p.clear_value[
i] =
val;
129 p.num_planes =
op->rw.elems;
static double val(void *priv, double ch)
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)
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 void process(const SwsOpExec *exec, const void *priv, int x_start, int y_start, int x_end, int y_end)
static int compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
#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]
static AVFormatContext * ctx
#define SWS_COMP_TEST(mask, X)
static av_const int ff_sws_pixel_type_size(SwsPixelType type)
static void process(NormalizeContext *s, AVFrame *in, AVFrame *out)