Go to the documentation of this file.
149 struct { uint8_t
x,
y,
z,
w; };
153 #define SWS_SWIZZLE(X,Y,Z,W) ((SwsSwizzleOp) { .in = {X, Y, Z, W} })
237 #define SWS_OP_NEEDED(op, idx) (!((op)->comps.flags[idx] & SWS_COMP_GARBAGE))
const SwsOp * ff_sws_op_list_input(const SwsOpList *ops)
Returns the input operation for a given op list, or NULL if there is none (e.g.
@ SWS_RW_PLANAR
Note: 1-component reads are either SWS_RW_PLANAR or SWS_RW_PACKED, depending on the underlying interp...
SwsComps comps_src
Source component metadata associated with pixel values from each corresponding component (in plane/me...
Represents a computed filter kernel.
int ff_sws_op_list_max_size(const SwsOpList *ops)
Returns the size of the largest pixel type used in ops.
uint32_t ff_sws_linear_mask(const SwsLinearOp *c)
void ff_sws_op_uninit(SwsOp *op)
Frees any allocations associated with an SwsOp and sets it to {0}.
SwsOpList * ff_sws_op_list_alloc(void)
int ff_sws_op_list_append(SwsOpList *ops, SwsOp *op)
These will take over ownership of op and set it to {0}, even on failure.
SwsFilterWeights * kernel
int ff_sws_op_list_insert_at(SwsOpList *ops, int index, SwsOp *op)
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.
uint8_t SwsCompMask
Bit-mask of components.
void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op)
Describe an operation in human-readable form.
int ff_sws_rw_op_planes(const SwsOp *op)
Return the number of planes involved in a read/write operation.
SwsFilterWeights * kernel
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
bool ff_sws_op_list_is_noop(const SwsOpList *ops)
Returns whether an op list represents a true no-op operation, i.e.
void ff_sws_op_list_print(void *log_ctx, int log_level, int log_level_extra, const SwsOpList *ops)
Print out the contents of an operation list.
SwsOpType
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
uint8_t pattern[4]
Packed bits are assumed to be LSB-aligned within the underlying integer type; i.e.
void ff_sws_apply_op_q(const SwsOp *op, AVRational64 x[4])
Apply an operation to an AVRational64.
void ff_sws_op_list_free(SwsOpList **ops)
64-bit Rational number (pair of numerator and denominator).
const SwsOp * ff_sws_op_list_output(const SwsOpList *ops)
Returns the output operation for a given op list, or NULL if there is none.
SwsComps comps
Metadata about the operation's input/output components.
void ff_sws_op_list_update_comps(SwsOpList *ops)
Infer + propagate known information about components.
int ff_sws_op_list_optimize(SwsOpList *ops)
Fuse compatible and eliminate redundant operations, as well as replacing some operations with more ef...
SwsCompMask ff_sws_comp_mask_q4(const AVRational64 q[4])
const char * ff_sws_op_type_name(SwsOpType op)
struct SwsReadWriteOp::@575 filter
Filter kernel to apply to each plane while sampling.
void ff_sws_op_list_remove_at(SwsOpList *ops, int index, int count)
SwsReadWriteMode mode
Examples: rgba = 4x u8 packed yuv444p = 3x u8 rgb565 = 1x u16 <- use SWS_OP_UNPACK to unpack monow = ...
Helper struct for representing a list of operations.
void ff_sws_comp_mask_swizzle(SwsCompMask *mask, const SwsSwizzleOp *swiz)
SwsCompMask ff_sws_comp_mask_needed(const SwsOp *op)
AVRational64 m[4][5]
Generalized 5x5 affine transformation: [ Out.x ] = [ A B C D E ] [ Out.y ] = [ F G H I J ] * [ x y z ...