Go to the documentation of this file.
30 # define PIXEL_TYPE SWS_PIXEL_F32
31 # define PIXEL_MAX FLT_MAX
32 # define PIXEL_MIN FLT_MIN
33 # define pixel_t float
34 # define block_t f32block_t
37 # error Invalid BIT_DEPTH
46 const int size = 1 <<
op->dither.size_log2;
59 static_assert(
sizeof(
out->ptr) <=
sizeof(uint8_t[8]),
">8 byte pointers not supported");
61 for (
int i = 0;
i < 4;
i++)
64 for (
int y = 0; y <
size; y++) {
65 for (
int x = 0; x <
size; x++)
77 const uint8_t *
offset = &impl->priv.u8[8];
78 const int mask = (1 << size_log2) - 1;
79 const int y_line = iter->y;
84 const int size = 1 << size_log2;
99 #define WRAP_DITHER(N) \
100 DECL_IMPL(dither##N) \
105 DECL_ENTRY(dither##N, \
106 .op = SWS_OP_DITHER, \
108 .setup = fn(setup_dither), \
132 for (
int i = 0;
i < 4;
i++) {
133 for (
int j = 0; j < 4; j++)
149 const fn(LinCoeffs)
c = *(
const fn(LinCoeffs) *) impl->priv.ptr;
186 #define WRAP_LINEAR(NAME, MASK) \
187 DECL_IMPL(linear_##NAME) \
189 CALL(linear_mask, MASK); \
192 DECL_ENTRY(linear_##NAME, \
193 .op = SWS_OP_LINEAR, \
194 .setup = fn(setup_linear), \
196 .linear_mask = (MASK), \
237 &
fn(op_linear_alpha),
238 &
fn(op_linear_lumalpha),
241 &
fn(op_linear_row0a),
242 &
fn(op_linear_diag3),
243 &
fn(op_linear_diag4),
244 &
fn(op_linear_diagoff3),
245 &
fn(op_linear_matrix3),
246 &
fn(op_linear_affine3),
247 &
fn(op_linear_affine3a),
248 &
fn(op_linear_matrix4),
249 &
fn(op_linear_affine4),
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int setup_linear(const SwsOp *op, SwsOpPriv *out)
static int setup_dither(const SwsOp *op, SwsOpPriv *out)
static const uint16_t dither[8][8]
#define CONTINUE(TYPE,...)
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.
#define SWS_BLOCK_SIZE
Copyright (C) 2025 Niklas Haas.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
DECL_FUNC(dither, const int size_log2)
static AVRational av_make_q(int num, int den)
Create an AVRational.
#define WRAP_LINEAR(NAME, MASK)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
#define i(width, name, range_min, range_max)
#define REF_COMMON_PATTERNS(NAME)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
void * av_malloc(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static const SwsOpTable fn(op_table_float)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static const int16_t alpha[]