156 struct { uint8_t
x,
y,
z,
w; };
160#define SWS_SWIZZLE(X,Y,Z,W) ((SwsSwizzleOp) { .in = {X, Y, Z, W} })
265#define SWS_OP_NEEDED(op, idx) (!((op)->comps.flags[idx] & SWS_COMP_GARBAGE))
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 const uint16_t mask[17]
int ff_sws_op_list_max_size(const SwsOpList *ops)
Returns the size of the largest pixel type used in ops.
void ff_sws_op_list_update_comps(SwsOpList *ops)
Infer + propagate known information about components.
void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op)
Describe an operation in human-readable form.
int ff_sws_op_list_optimize(SwsOpList *ops)
Fuse compatible and eliminate redundant operations, as well as replacing some operations with more ef...
uint32_t ff_sws_linear_mask(const SwsLinearOp *c)
int ff_sws_op_list_insert_at(SwsOpList *ops, int index, SwsOp *op)
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.
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.
void ff_sws_op_uninit(SwsOp *op)
Frees any allocations associated with an SwsOp and sets it to {0}.
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.
void ff_sws_comp_mask_swizzle(SwsCompMask *mask, const SwsSwizzleOp *swiz)
SwsOpList * ff_sws_op_list_alloc(void)
const char * ff_sws_op_type_name(SwsOpType op)
SwsCompMask ff_sws_comp_mask_needed(const SwsOp *op)
SwsCompMask ff_sws_comp_mask_q4(const AVRational64 q[4])
int ff_sws_rw_op_planes(const SwsOp *op)
Return the number of planes involved in a read/write operation.
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.
bool ff_sws_op_list_is_noop(const SwsOpList *ops)
Returns whether an op list represents a true no-op operation, i.e.
SwsOpType
Copyright (C) 2025 Niklas Haas.
@ SWS_RW_PLANAR
Note: 1-component reads are either SWS_RW_PLANAR or SWS_RW_PACKED, depending on the underlying interp...
void ff_sws_apply_op_q(const SwsOp *op, AVRational64 x[4])
Apply an operation to an AVRational64.
void ff_sws_op_list_remove_at(SwsOpList *ops, int index, int count)
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
void ff_sws_op_list_free(SwsOpList **ops)
64-bit extension of AVRational.
64-bit Rational number (pair of numerator and denominator).
SwsFilterWeights * kernel
Represents a computed filter kernel.
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 ...
Append a set of operations for applying a gamut/tone mapping 3D LUT to the pixels.
const SwsLut3D * lut
Reference to the external LUT3D to apply.
Helper struct for representing a list of operations.
SwsComps comps_src
Source component metadata associated with pixel values from each corresponding component (in plane/me...
SwsComps comps
Metadata about the operation's input/output components.
uint8_t pattern[4]
Packed bits are assumed to be LSB-aligned within the underlying integer type; i.e.
SwsFilterWeights * kernel
SwsReadWriteMode mode
Examples: rgba = 4x u8 packed yuv444p = 3x u8 rgb565 = 1x u16 <- use SWS_OP_UNPACK to unpack monow = ...
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
uint8_t SwsCompMask
Bit-mask of components.