Go to the documentation of this file.
144 struct { uint8_t
x,
y,
z,
w; };
148 #define SWS_SWIZZLE(X,Y,Z,W) ((SwsSwizzleOp) { .in = {X, Y, Z, W} })
197 #define SWS_MASK(I, J) (1 << (5 * (I) + (J)))
198 #define SWS_MASK_OFF(I) SWS_MASK(I, 4)
199 #define SWS_MASK_ROW(I) (0x1F << (5 * (I)))
200 #define SWS_MASK_COL(J) (0x8421 << J)
253 #define SWS_OP_NEEDED(op, idx) (!((op)->comps.flags[idx] & SWS_COMP_GARBAGE))
AVPixelFormat
Pixel format.
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...
static double cb(void *priv, double x, double y)
SwsComps comps_src
Source component metadata associated with pixel values from each corresponding component (in plane/me...
AVRational m[4][5]
Generalized 5x5 affine transformation: [ Out.x ] = [ A B C D E ] [ Out.y ] = [ F G H I J ] * [ x y z ...
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)
SwsCompMask ff_sws_comp_mask_swizzle(SwsCompMask mask, const SwsSwizzleOp *swiz)
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.
static AVFormatContext * ctx
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
SwsCompMask ff_sws_comp_mask_q4(const AVRational q[4])
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
Rational number (pair of numerator and denominator).
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_op_list_free(SwsOpList **ops)
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...
void ff_sws_apply_op_q(const SwsOp *op, AVRational x[4])
Apply an operation to an AVRational.
struct SwsReadWriteOp::@571 filter
Filter kernel to apply to each plane while sampling.
const char * ff_sws_op_type_name(SwsOpType op)
int ff_sws_enum_op_lists(SwsContext *ctx, void *opaque, enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt, int(*cb)(SwsContext *ctx, void *opaque, SwsOpList *ops))
Helper function to enumerate over all possible (optimized) operation lists, under the current set of ...
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.
Main external API structure.
SwsCompMask ff_sws_comp_mask_needed(const SwsOp *op)