Go to the documentation of this file.
27 #define Q(N) ((AVRational) { N, 1 })
58 chain->
free[idx + 1] = free;
63 #define q2pixel(type, q) ((q).den ? (type) (q).num / (q).den : 0)
74 default:
return AVERROR(EINVAL);
83 for (
int i = 0;
i < 4;
i++) {
90 default:
return AVERROR(EINVAL);
100 for (
int i = 0;
i < 4;
i++) {
109 default:
return AVERROR(EINVAL);
117 int num_tables,
const SwsUOp *uop,
const int block_size,
129 for (
int n = 0; !match && n < num_tables; n++) {
131 if (
table->block_size &&
table->block_size != block_size ||
135 for (
int i = 0;
table->entries[
i];
i++) {
137 const SwsUOp entry_uop = {
176 for (
int i = 0;
i < 4;
i++) {
194 default:
return AVERROR(EINVAL);
203 for (
int i = 0;
i < 4;
i++) {
210 default:
return AVERROR(EINVAL);
Copyright (C) 2025 Niklas Haas.
int(* func)(AVBPrint *dst, const char *in, const char *arg)
static const int factor[16]
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
int ff_sws_setup_clear(const SwsImplParams *params, SwsImplResult *out)
int ff_sws_setup_scale(const SwsImplParams *params, SwsImplResult *out)
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[]
int ff_sws_uop_cmp(const SwsUOp *a, const SwsUOp *b)
Copyright (C) 2026 Niklas Haas.
int(* setup)(const SwsImplParams *params, SwsImplResult *out)
void(* SwsFuncPtr)(void)
Per-kernel execution context.
Writing a table generator This documentation is preliminary Parts of the API are not good and should be changed Basic concepts A table generator consists of two *_tablegen c and *_tablegen h The h file will provide the variable declarations and initialization code for the tables
void(* free[SWS_MAX_OPS+1])(SwsOpPriv *)
SwsOpChain * ff_sws_op_chain_alloc(void)
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.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static AVFormatContext * ctx
SwsOpImpl impl[SWS_MAX_OPS+1]
Compiled "chain" of operations, which can be dispatched efficiently.
Rational number (pair of numerator and denominator).
int ff_sws_setup_vec4(const SwsImplParams *params, SwsImplResult *out)
int ff_sws_setup_clamp(const SwsImplParams *params, SwsImplResult *out)
#define i(width, name, range_min, range_max)
void ff_sws_op_chain_free_cb(void *ptr)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
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 value
void(* free)(SwsOpPriv *priv)
static double limit(double x)
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
int ff_sws_setup_scalar(const SwsImplParams *params, SwsImplResult *out)
int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func, void(*free)(SwsOpPriv *), const SwsOpPriv *priv)
Main external API structure.
Private data for each kernel.