Go to the documentation of this file.
30 #pragma STDC FP_CONTRACT OFF
31 #elif AV_GCC_VERSION_AT_LEAST(4, 8)
32 #pragma GCC optimize ("fp-contract=off")
33 #elif defined(_MSC_VER)
34 #pragma fp_contract (off)
37 #if AV_GCC_VERSION_AT_LEAST(4, 4)
38 #pragma GCC optimize ("finite-math-only")
62 #define REF_ALL_UOPS(TYPE) \
63 SWS_FOR(TYPE, READ_PLANAR, REF_ENTRY) \
64 SWS_FOR(TYPE, READ_PLANAR_FV, REF_ENTRY) \
65 SWS_FOR(TYPE, READ_PLANAR_FH, REF_ENTRY) \
66 SWS_FOR(TYPE, READ_PACKED, REF_ENTRY) \
67 SWS_FOR(TYPE, READ_NIBBLE, REF_ENTRY) \
68 SWS_FOR(TYPE, READ_BIT, REF_ENTRY) \
69 SWS_FOR(TYPE, PERMUTE, REF_ENTRY) \
70 SWS_FOR(TYPE, COPY, REF_ENTRY) \
71 SWS_FOR(TYPE, WRITE_PLANAR, REF_ENTRY) \
72 SWS_FOR(TYPE, WRITE_PACKED, REF_ENTRY) \
73 SWS_FOR(TYPE, WRITE_NIBBLE, REF_ENTRY) \
74 SWS_FOR(TYPE, WRITE_BIT, REF_ENTRY) \
75 SWS_FOR(TYPE, SWAP_BYTES, REF_ENTRY) \
76 SWS_FOR(TYPE, EXPAND_BIT, REF_ENTRY) \
77 SWS_FOR(TYPE, EXPAND_PAIR, REF_ENTRY) \
78 SWS_FOR(TYPE, EXPAND_QUAD, REF_ENTRY) \
79 SWS_FOR(TYPE, TO_U8, REF_ENTRY) \
80 SWS_FOR(TYPE, TO_U16, REF_ENTRY) \
81 SWS_FOR(TYPE, TO_U32, REF_ENTRY) \
82 SWS_FOR(TYPE, TO_F32, REF_ENTRY) \
83 SWS_FOR(TYPE, SCALE, REF_ENTRY) \
84 SWS_FOR(TYPE, ADD, REF_ENTRY) \
85 SWS_FOR(TYPE, MIN, REF_ENTRY) \
86 SWS_FOR(TYPE, MAX, REF_ENTRY) \
87 SWS_FOR(TYPE, UNPACK, REF_ENTRY) \
88 SWS_FOR(TYPE, PACK, REF_ENTRY) \
89 SWS_FOR(TYPE, LSHIFT, REF_ENTRY) \
90 SWS_FOR(TYPE, RSHIFT, REF_ENTRY) \
91 SWS_FOR(TYPE, CLEAR, REF_ENTRY) \
92 SWS_FOR(TYPE, LINEAR, REF_ENTRY) \
93 SWS_FOR(TYPE, DITHER, REF_ENTRY) \
108 const int bx_start,
const int y_start,
109 int bx_end,
int y_end)
118 for (
int i = 0;
i < 4;
i++) {
119 iter->
in[
i] = (uintptr_t) exec->
in[
i];
120 iter->
out[
i] = (uintptr_t) exec->
out[
i];
123 for (iter->
y = y_start; iter->
y < y_end; iter->
y++) {
130 for (
int i = 0;
i < 4;
i++) {
Copyright (C) 2025 Niklas Haas.
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 default minimum maximum flags name is the option name
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
#define REF_ALL_UOPS(TYPE)
ptrdiff_t in_bump[4]
Pointer bump, difference between stride and processed line size.
int ff_sws_uop_lookup(SwsContext *ctx, const SwsOpTable *const tables[], int num_tables, const SwsUOp *uop, const int block_size, SwsOpChain *chain)
"Compile" a single uop by looking it up in a list of fixed size uop tables, in decreasing order of pr...
static const uint16_t table[]
Internal context holding per-iter execution data.
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
void(* free[SWS_MAX_OPS+1])(SwsOpPriv *)
SwsOpChain * ff_sws_op_chain_alloc(void)
const SwsOpBackend backend_c
Copyright (C) 2025 Niklas Haas.
int32_t * in_bump_y
Line bump; determines how many additional lines to advance (after incrementing normally to the next l...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static AVFormatContext * ctx
SwsOpImpl impl[SWS_MAX_OPS+1]
Copyright (C) 2026 Niklas Haas.
Compiled "chain" of operations, which can be dispatched efficiently.
static int compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
#define SWS_BLOCK_SIZE
Copyright (C) 2026 Niklas Haas.
static void process(const SwsOpExec *exec, const void *priv, const int bx_start, const int y_start, int bx_end, int y_end)
#define i(width, name, range_min, range_max)
static const SwsOpTable op_table
SwsUOpList * ff_sws_uop_list_alloc(void)
void ff_sws_op_chain_free_cb(void *ptr)
static void ff_sws_op_chain_free(SwsOpChain *chain)
int ff_sws_ops_translate(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags, SwsUOpList *uops)
Translate a list of operations down to micro-ops, which can be further optimized and then directly ex...
void ff_sws_uop_list_free(SwsUOpList **p_ops)
@ SWS_BACKEND_C
Template-based C reference implementation.
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
The exact code depends on how similar the blocks are and how related they are to the block
Helper struct for representing a list of operations.
Main external API structure.