FFmpeg
ops.h
Go to the documentation of this file.
1 /**
2  * Copyright (C) 2025 Niklas Haas
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef SWSCALE_OPS_H
22 #define SWSCALE_OPS_H
23 
24 #include <assert.h>
25 #include <stdbool.h>
26 #include <stdalign.h>
27 
28 #include "libavutil/bprint.h"
29 
30 #include "graph.h"
31 
32 typedef enum SwsPixelType {
39 } SwsPixelType;
40 
44 
45 typedef enum SwsOpType {
47 
48  /* Defined for all types; but implemented for integers only */
49  SWS_OP_READ, /* gather raw pixels from planes */
50  SWS_OP_WRITE, /* write raw pixels to planes */
51  SWS_OP_SWAP_BYTES, /* swap byte order (for differing endianness) */
52  SWS_OP_SWIZZLE, /* rearrange channel order, or duplicate channels */
53 
54  /* Bit manipulation operations. Defined for integers only. */
55  SWS_OP_UNPACK, /* split tightly packed data into components */
56  SWS_OP_PACK, /* compress components into tightly packed data */
57  SWS_OP_LSHIFT, /* logical left shift of raw pixel values by (u8) */
58  SWS_OP_RSHIFT, /* right shift of raw pixel values by (u8) */
59 
60  /* Generic arithmetic. Defined and implemented for all types */
61  SWS_OP_CLEAR, /* clear pixel values */
62  SWS_OP_CONVERT, /* convert (cast) between formats */
63  SWS_OP_MIN, /* numeric minimum (q4) */
64  SWS_OP_MAX, /* numeric maximum (q4) */
65  SWS_OP_SCALE, /* multiplication by scalar (q) */
66 
67  /* Floating-point only arithmetic operations. */
68  SWS_OP_LINEAR, /* generalized linear affine transform */
69  SWS_OP_DITHER, /* add dithering noise */
70 
72 } SwsOpType;
73 
74 const char *ff_sws_op_type_name(SwsOpType op);
75 
76 typedef enum SwsCompFlags {
77  SWS_COMP_GARBAGE = 1 << 0, /* contents are undefined / garbage data */
78  SWS_COMP_EXACT = 1 << 1, /* value is an exact integer */
79  SWS_COMP_ZERO = 1 << 2, /* known to be a constant zero */
80  SWS_COMP_SWAPPED = 1 << 3, /* byte order is swapped */
81 } SwsCompFlags;
82 
83 typedef union SwsConst {
84  /* Generic constant value */
87  unsigned u;
88 } SwsConst;
89 
90 static_assert(sizeof(SwsConst) == sizeof(AVRational) * 4,
91  "First field of SwsConst should span the entire union");
92 
93 typedef struct SwsComps {
94  SwsCompFlags flags[4]; /* knowledge about (output) component contents */
95  bool unused[4]; /* which input components are definitely unused */
96 
97  /* Keeps track of the known possible value range, or {0, 0} for undefined
98  * or (unknown range) floating point inputs */
99  AVRational min[4], max[4];
100 } SwsComps;
101 
102 typedef struct SwsReadWriteOp {
103  uint8_t elems; /* number of elements (of type `op.type`) to read/write */
104  uint8_t frac; /* fractional pixel step factor (log2) */
105  bool packed; /* read multiple elements from a single plane */
106 
107  /** Examples:
108  * rgba = 4x u8 packed
109  * yuv444p = 3x u8
110  * rgb565 = 1x u16 <- use SWS_OP_UNPACK to unpack
111  * monow = 1x u8 (frac 3)
112  * rgb4 = 1x u8 (frac 1)
113  */
115 
116 typedef struct SwsPackOp {
117  /**
118  * Packed bits are assumed to be LSB-aligned within the underlying
119  * integer type; i.e. (msb) 0 ... X Y Z W (lsb).
120  */
121  uint8_t pattern[4]; /* bit depth pattern, from MSB to LSB */
122 } SwsPackOp;
123 
124 typedef struct SwsSwizzleOp {
125  /**
126  * Input component for each output component:
127  * Out[x] := In[swizzle.in[x]]
128  */
129  union {
130  uint32_t mask;
131  uint8_t in[4];
132  struct { uint8_t x, y, z, w; };
133  };
134 } SwsSwizzleOp;
135 
136 #define SWS_SWIZZLE(X,Y,Z,W) ((SwsSwizzleOp) { .in = {X, Y, Z, W} })
137 
138 typedef struct SwsConvertOp {
139  SwsPixelType to; /* type of pixel to convert to */
140  bool expand; /* if true, integers are expanded to the full range */
141 } SwsConvertOp;
142 
143 typedef struct SwsDitherOp {
144  AVRational *matrix; /* tightly packed dither matrix (refstruct) */
145  int size_log2; /* size (in bits) of the dither matrix */
146  int8_t y_offset[4]; /* row offset for each component, or -1 for ignored */
147 } SwsDitherOp;
148 
149 typedef struct SwsLinearOp {
150  /**
151  * Generalized 5x5 affine transformation:
152  * [ Out.x ] = [ A B C D E ]
153  * [ Out.y ] = [ F G H I J ] * [ x y z w 1 ]
154  * [ Out.z ] = [ K L M N O ]
155  * [ Out.w ] = [ P Q R S T ]
156  *
157  * The mask keeps track of which components differ from an identity matrix.
158  * There may be more efficient implementations of particular subsets, for
159  * example the common subset of {A, E, G, J, M, O} can be implemented with
160  * just three fused multiply-add operations.
161  */
162  AVRational m[4][5];
163  uint32_t mask; /* m[i][j] <-> 1 << (5 * i + j) */
164 } SwsLinearOp;
165 
166 #define SWS_MASK(I, J) (1 << (5 * (I) + (J)))
167 #define SWS_MASK_OFF(I) SWS_MASK(I, 4)
168 #define SWS_MASK_ROW(I) (0x1F << (5 * (I)))
169 #define SWS_MASK_COL(J) (0x8421 << J)
170 
171 enum {
172  SWS_MASK_ALL = (1 << 20) - 1,
175 
176  SWS_MASK_DIAG3 = SWS_MASK(0, 0) | SWS_MASK(1, 1) | SWS_MASK(2, 2),
178  SWS_MASK_MAT3 = SWS_MASK(0, 0) | SWS_MASK(0, 1) | SWS_MASK(0, 2) |
179  SWS_MASK(1, 0) | SWS_MASK(1, 1) | SWS_MASK(1, 2) |
180  SWS_MASK(2, 0) | SWS_MASK(2, 1) | SWS_MASK(2, 2),
181 
185 };
186 
187 /* Helper function to compute the correct mask */
189 
190 typedef struct SwsOp {
191  SwsOpType op; /* operation to perform */
192  SwsPixelType type; /* pixel type to operate on */
193  union {
201  };
202 
203  /**
204  * Metadata about the operation's input/output components. Discarded
205  * and regenerated automatically by `ff_sws_op_list_update_comps()`.
206  *
207  * Note that backends may rely on the presence and accuracy of this
208  * metadata for all operations, during ff_sws_ops_compile().
209  */
211 } SwsOp;
212 
213 /**
214  * Describe an operation in human-readable form.
215  */
216 void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const bool unused[4]);
217 
218 /**
219  * Frees any allocations associated with an SwsOp and sets it to {0}.
220  */
221 void ff_sws_op_uninit(SwsOp *op);
222 
223 /**
224  * Apply an operation to an AVRational. No-op for read/write operations.
225  */
226 void ff_sws_apply_op_q(const SwsOp *op, AVRational x[4]);
227 
228 /**
229  * Helper struct for representing a list of operations.
230  */
231 typedef struct SwsOpList {
233  int num_ops;
234 
235  /* Metadata associated with this operation list */
237 
238  /* Input/output plane pointer swizzle mask */
240 
241  /**
242  * Source component metadata associated with pixel values from each
243  * corresponding component (in plane/memory order, i.e. not affected by
244  * `order_src`). Lets the optimizer know additional information about
245  * the value range and/or pixel data to expect.
246  *
247  * The default value of {0} is safe to pass in the case that no additional
248  * information is known.
249  */
251 } SwsOpList;
252 
254 void ff_sws_op_list_free(SwsOpList **ops);
255 
256 /**
257  * Returns a duplicate of `ops`, or NULL on OOM.
258  */
260 
261 /**
262  * Returns the input operation for a given op list, or NULL if there is none
263  * (e.g. for a pure CLEAR-only operation list).
264  *
265  * This will always be an op of type SWS_OP_READ.
266  */
267 const SwsOp *ff_sws_op_list_input(const SwsOpList *ops);
268 
269 /**
270  * Returns the output operation for a given op list, or NULL if there is none.
271  *
272  * This will always be an op of type SWS_OP_WRITE.
273  */
274 const SwsOp *ff_sws_op_list_output(const SwsOpList *ops);
275 
276 /**
277  * Returns whether an op list represents a true no-op operation, i.e. may be
278  * eliminated entirely from an execution graph.
279  */
280 bool ff_sws_op_list_is_noop(const SwsOpList *ops);
281 
282 /**
283  * Returns the size of the largest pixel type used in `ops`.
284  */
285 int ff_sws_op_list_max_size(const SwsOpList *ops);
286 
287 /**
288  * These will take over ownership of `op` and set it to {0}, even on failure.
289  */
292 
293 void ff_sws_op_list_remove_at(SwsOpList *ops, int index, int count);
294 
295 /**
296  * Print out the contents of an operation list.
297  */
298 void ff_sws_op_list_print(void *log_ctx, int log_level, int log_level_extra,
299  const SwsOpList *ops);
300 
301 /**
302  * Infer + propagate known information about components. Called automatically
303  * when needed by the optimizer and compiler.
304  */
306 
307 /**
308  * Fuse compatible and eliminate redundant operations, as well as replacing
309  * some operations with more efficient alternatives.
310  */
312 
314  /* Automatically optimize the operations when compiling */
316 };
317 
318 /**
319  * Resolves an operation list to a graph pass. The first and last operations
320  * must be a read/write respectively. `flags` is a list of SwsOpCompileFlags.
321  *
322  * Takes over ownership of `ops` and sets it to NULL, even on failure.
323  *
324  * Note: `ops` may be modified by this function.
325  */
326 int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **ops, int flags,
328 
329 /**
330  * Helper function to enumerate over all possible (optimized) operation lists,
331  * under the current set of options in `ctx`, and run the given callback on
332  * each list.
333  *
334  * @param src_fmt If set (not AV_PIX_FMT_NONE), constrain the source format
335  * @param dst_fmt If set (not AV_PIX_FMT_NONE), constrain the destination format
336  * @return 0 on success, the return value if cb() < 0, or a negative error code
337  *
338  * @note `ops` belongs to ff_sws_enum_op_lists(), but may be mutated by `cb`.
339  * @see ff_sws_enum_ops()
340  */
341 int ff_sws_enum_op_lists(SwsContext *ctx, void *opaque,
342  enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt,
343  int (*cb)(SwsContext *ctx, void *opaque, SwsOpList *ops));
344 
345 /**
346  * Helper function to enumerate over all possible operations, under the current
347  * set of options in `ctx`, and run the given callback on each operation.
348  *
349  * @param src_fmt If set (not AV_PIX_FMT_NONE), constrain the source format
350  * @param dst_fmt If set (not AV_PIX_FMT_NONE), constrain the destination format
351  * @return 0 on success, the return value if cb() < 0, or a negative error code
352  *
353  * @note May contain duplicates. `op` belongs to ff_sws_enum_ops(), but may be
354  * mutated by `cb`.
355  * @see ff_sws_num_op_lists()
356  */
357 int ff_sws_enum_ops(SwsContext *ctx, void *opaque,
358  enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt,
359  int (*cb)(SwsContext *ctx, void *opaque, SwsOp *op));
360 
361 #endif
SWS_OP_READ
@ SWS_OP_READ
Definition: ops.h:49
flags
const SwsFlags flags[]
Definition: swscale.c:71
SWS_PIXEL_U16
@ SWS_PIXEL_U16
Definition: ops.h:35
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
ff_sws_op_list_input
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.
Definition: ops.c:572
SWS_OP_SWIZZLE
@ SWS_OP_SWIZZLE
Definition: ops.h:52
SwsPass
Represents a single filter pass in the scaling graph.
Definition: graph.h:71
SWS_OP_LSHIFT
@ SWS_OP_LSHIFT
Definition: ops.h:57
SWS_OP_UNPACK
@ SWS_OP_UNPACK
Definition: ops.h:55
ff_sws_enum_ops
int ff_sws_enum_ops(SwsContext *ctx, void *opaque, enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt, int(*cb)(SwsContext *ctx, void *opaque, SwsOp *op))
Helper function to enumerate over all possible operations, under the current set of options in ctx,...
Definition: ops.c:978
SwsSwizzleOp::mask
uint32_t mask
Definition: ops.h:130
SWS_MASK_OFF4
@ SWS_MASK_OFF4
Definition: ops.h:183
cb
static double cb(void *priv, double x, double y)
Definition: vf_geq.c:247
SwsOpList::comps_src
SwsComps comps_src
Source component metadata associated with pixel values from each corresponding component (in plane/me...
Definition: ops.h:250
SwsConst
Definition: ops.h:83
SWS_COMP_ZERO
@ SWS_COMP_ZERO
Definition: ops.h:79
SWS_OP_CLEAR
@ SWS_OP_CLEAR
Definition: ops.h:61
SwsOp::swizzle
SwsSwizzleOp swizzle
Definition: ops.h:197
SwsLinearOp::m
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 ...
Definition: ops.h:162
SwsSwizzleOp::z
uint8_t z
Definition: ops.h:132
SwsComps::unused
bool unused[4]
Definition: ops.h:95
SwsOp::convert
SwsConvertOp convert
Definition: ops.h:198
output
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
Definition: filter_design.txt:226
SwsOp::rw
SwsReadWriteOp rw
Definition: ops.h:195
SWS_OP_DITHER
@ SWS_OP_DITHER
Definition: ops.h:69
ff_sws_op_list_max_size
int ff_sws_op_list_max_size(const SwsOpList *ops)
Returns the size of the largest pixel type used in ops.
Definition: ops.c:649
av_const
#define av_const
Definition: attributes.h:105
ff_sws_pixel_type_size
int ff_sws_pixel_type_size(SwsPixelType type) av_const
Definition: ops.c:65
SWS_PIXEL_U32
@ SWS_PIXEL_U32
Definition: ops.h:36
SWS_OP_TYPE_NB
@ SWS_OP_TYPE_NB
Definition: ops.h:71
SwsPixelType
SwsPixelType
Copyright (C) 2025 Niklas Haas.
Definition: ops.h:32
SwsComps::max
AVRational max[4]
Definition: ops.h:99
SwsSwizzleOp::w
uint8_t w
Definition: ops.h:132
SWS_PIXEL_F32
@ SWS_PIXEL_F32
Definition: ops.h:37
SWS_MASK_LUMA
@ SWS_MASK_LUMA
Definition: ops.h:173
SwsOpList::num_ops
int num_ops
Definition: ops.h:233
SwsCompFlags
SwsCompFlags
Definition: ops.h:76
SwsDitherOp
Definition: ops.h:143
ff_sws_op_uninit
void ff_sws_op_uninit(SwsOp *op)
Frees any allocations associated with an SwsOp and sets it to {0}.
SwsOp::c
SwsConst c
Definition: ops.h:200
ff_sws_op_list_alloc
SwsOpList * ff_sws_op_list_alloc(void)
Definition: ops.c:517
SWS_PIXEL_U8
@ SWS_PIXEL_U8
Definition: ops.h:34
SwsReadWriteOp
Definition: ops.h:102
SwsSwizzleOp
Definition: ops.h:124
type
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 type
Definition: writing_filters.txt:86
SWS_MASK_MAT4
@ SWS_MASK_MAT4
Definition: ops.h:184
SwsLinearOp::mask
uint32_t mask
Definition: ops.h:163
SwsOp::op
SwsOpType op
Definition: ops.h:191
SwsOpCompileFlags
SwsOpCompileFlags
Definition: ops.h:313
SWS_OP_SCALE
@ SWS_OP_SCALE
Definition: ops.h:65
ff_sws_op_list_append
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.
Definition: ops.c:615
SWS_MASK_OFF3
@ SWS_MASK_OFF3
Definition: ops.h:177
ff_sws_op_list_insert_at
int ff_sws_op_list_insert_at(SwsOpList *ops, int index, SwsOp *op)
Definition: ops.c:601
SwsComps::min
AVRational min[4]
Definition: ops.h:99
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.
Definition: anm.c:76
SWS_OP_MIN
@ SWS_OP_MIN
Definition: ops.h:63
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
SWS_OP_LINEAR
@ SWS_OP_LINEAR
Definition: ops.h:68
SWS_OP_PACK
@ SWS_OP_PACK
Definition: ops.h:56
SwsOp::dither
SwsDitherOp dither
Definition: ops.h:199
ff_sws_op_list_duplicate
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
Definition: ops.c:543
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
SwsReadWriteOp::frac
uint8_t frac
Definition: ops.h:104
ff_sws_pixel_type_is_int
bool ff_sws_pixel_type_is_int(SwsPixelType type) av_const
Definition: ops.c:80
ff_sws_op_list_is_noop
bool ff_sws_op_list_is_noop(const SwsOpList *ops)
Returns whether an op list represents a true no-op operation, i.e.
Definition: ops.c:620
SWS_COMP_GARBAGE
@ SWS_COMP_GARBAGE
Definition: ops.h:77
SwsConvertOp::to
SwsPixelType to
Definition: ops.h:139
ff_sws_op_list_print
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.
Definition: ops.c:834
SwsOpType
SwsOpType
Definition: ops.h:45
SWS_MASK
#define SWS_MASK(I, J)
Definition: ops.h:166
SWS_PIXEL_NONE
@ SWS_PIXEL_NONE
Definition: ops.h:33
index
int index
Definition: gxfenc.c:90
SwsConvertOp::expand
bool expand
Definition: ops.h:140
SWS_MASK_MAT3
@ SWS_MASK_MAT3
Definition: ops.h:178
SwsOpList::order_dst
SwsSwizzleOp order_dst
Definition: ops.h:239
SwsPackOp::pattern
uint8_t pattern[4]
Packed bits are assumed to be LSB-aligned within the underlying integer type; i.e.
Definition: ops.h:121
SwsConst::q
AVRational q
Definition: ops.h:86
ff_sws_op_list_free
void ff_sws_op_list_free(SwsOpList **ops)
Definition: ops.c:529
SwsDitherOp::size_log2
int size_log2
Definition: ops.h:145
SwsOp::type
SwsPixelType type
Definition: ops.h:192
SwsDitherOp::matrix
AVRational * matrix
Definition: ops.h:144
SWS_OP_RSHIFT
@ SWS_OP_RSHIFT
Definition: ops.h:58
SwsOp::lin
SwsLinearOp lin
Definition: ops.h:194
SwsOpList::src
SwsFormat src
Definition: ops.h:236
SWS_OP_INVALID
@ SWS_OP_INVALID
Definition: ops.h:46
SwsFormat
Definition: format.h:77
SWS_OP_WRITE
@ SWS_OP_WRITE
Definition: ops.h:50
ff_sws_op_list_output
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.
Definition: ops.c:581
SwsOp::comps
SwsComps comps
Metadata about the operation's input/output components.
Definition: ops.h:210
SWS_MASK_ALL
@ SWS_MASK_ALL
Definition: ops.h:172
SWS_OP_FLAG_OPTIMIZE
@ SWS_OP_FLAG_OPTIMIZE
Definition: ops.h:315
SwsLinearOp
Definition: ops.h:149
input
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
Definition: filter_design.txt:172
ff_sws_op_list_update_comps
void ff_sws_op_list_update_comps(SwsOpList *ops)
Infer + propagate known information about components.
Definition: ops.c:269
ff_sws_op_list_optimize
int ff_sws_op_list_optimize(SwsOpList *ops)
Fuse compatible and eliminate redundant operations, as well as replacing some operations with more ef...
Definition: ops_optimizer.c:283
bprint.h
SWS_MASK_DIAG4
@ SWS_MASK_DIAG4
Definition: ops.h:182
SwsOpList::ops
SwsOp * ops
Definition: ops.h:232
SwsPackOp
Definition: ops.h:116
SwsOpList::order_src
SwsSwizzleOp order_src
Definition: ops.h:239
graph.h
SwsConst::q4
AVRational q4[4]
Definition: ops.h:85
SWS_MASK_ALPHA
@ SWS_MASK_ALPHA
Definition: ops.h:174
SwsOp
Definition: ops.h:190
ff_sws_apply_op_q
void ff_sws_apply_op_q(const SwsOp *op, AVRational x[4])
Apply an operation to an AVRational.
Definition: ops.c:134
SwsComps::flags
SwsCompFlags flags[4]
Definition: ops.h:94
SwsOpList::dst
SwsFormat dst
Definition: ops.h:236
SWS_OP_MAX
@ SWS_OP_MAX
Definition: ops.h:64
SWS_PIXEL_TYPE_NB
@ SWS_PIXEL_TYPE_NB
Definition: ops.h:38
SwsComps
Definition: ops.h:93
SwsConst::u
unsigned u
Definition: ops.h:87
ff_sws_op_type_name
const char * ff_sws_op_type_name(SwsOpType op)
Definition: ops.c:97
SWS_MASK_OFF
#define SWS_MASK_OFF(I)
Definition: ops.h:167
SWS_COMP_SWAPPED
@ SWS_COMP_SWAPPED
Definition: ops.h:80
SwsReadWriteOp::packed
bool packed
Definition: ops.h:105
SwsSwizzleOp::y
uint8_t y
Definition: ops.h:132
SWS_OP_SWAP_BYTES
@ SWS_OP_SWAP_BYTES
Definition: ops.h:51
ff_sws_op_desc
void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const bool unused[4])
Describe an operation in human-readable form.
Definition: ops.c:758
SwsSwizzleOp::x
uint8_t x
Definition: ops.h:132
SWS_COMP_EXACT
@ SWS_COMP_EXACT
Definition: ops.h:78
ff_sws_enum_op_lists
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 ...
Definition: ops.c:933
SwsReadWriteOp::elems
uint8_t elems
Definition: ops.h:103
ff_sws_pixel_type_name
const char * ff_sws_pixel_type_name(SwsPixelType type)
Definition: ops.c:50
SwsGraph
Filter graph, which represents a 'baked' pixel format conversion.
Definition: graph.h:112
SwsDitherOp::y_offset
int8_t y_offset[4]
Definition: ops.h:146
SwsSwizzleOp::in
uint8_t in[4]
Definition: ops.h:131
SWS_OP_CONVERT
@ SWS_OP_CONVERT
Definition: ops.h:62
ff_sws_op_list_remove_at
void ff_sws_op_list_remove_at(SwsOpList *ops, int index, int count)
Definition: ops.c:590
SwsConvertOp
Definition: ops.h:138
SwsOpList
Helper struct for representing a list of operations.
Definition: ops.h:231
SwsOp::pack
SwsPackOp pack
Definition: ops.h:196
unused
static const bool unused[4]
Definition: sws_ops.c:53
SWS_MASK_DIAG3
@ SWS_MASK_DIAG3
Definition: ops.h:176
SwsContext
Main external API structure.
Definition: swscale.h:206
ff_sws_linear_mask
uint32_t ff_sws_linear_mask(SwsLinearOp)
Definition: ops.c:660
ff_sws_compile_pass
int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **ops, int flags, SwsPass *input, SwsPass **output)
Resolves an operation list to a graph pass.
Definition: ops_dispatch.c:378