FFmpeg
uops.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_UOPS_H
22 #define SWSCALE_UOPS_H
23 
24 #include <assert.h>
25 #include <stdbool.h>
26 #include <stdint.h>
27 
28 /***************************************************************************
29  * Note: This header must be usable at build time, to generate asm sources *
30  ***************************************************************************/
31 
32 #include "libavutil/attributes.h"
33 
34 typedef struct SwsContext SwsContext;
35 typedef struct SwsFilterWeights SwsFilterWeights;
36 typedef struct SwsOpList SwsOpList;
37 
38 typedef enum SwsPixelType {
45 } SwsPixelType;
46 
48 
50 {
51  switch (type) {
52  case SWS_PIXEL_U8: return sizeof(uint8_t);
53  case SWS_PIXEL_U16: return sizeof(uint16_t);
54  case SWS_PIXEL_U32: return sizeof(uint32_t);
55  case SWS_PIXEL_F32: return sizeof(float);
56  case SWS_PIXEL_NONE: break;
57  case SWS_PIXEL_TYPE_NB: break;
58  }
59  return 0;
60 }
61 
63 {
64  switch (type) {
65  case SWS_PIXEL_U8:
66  case SWS_PIXEL_U16:
67  case SWS_PIXEL_U32:
68  return true;
69  case SWS_PIXEL_F32:
70  return false;
71  case SWS_PIXEL_NONE:
72  case SWS_PIXEL_TYPE_NB: break;
73  }
74  return false;
75 }
76 
77 typedef union SwsPixel {
78  char data[4];
79 
80  uint8_t u8;
81  uint16_t u16;
82  uint32_t u32;
83  float f32;
84 } SwsPixel;
85 
86 /* Ensures (SwsPixel) {0} is properly initialized to all zeros */
87 static_assert(sizeof(SwsPixel) == sizeof(char[4]), "SwsPixel size mismatch");
88 
89 /**
90  * Bit-mask of components. Exact meaning depends on the usage context.
91  */
92 typedef uint8_t SwsCompMask;
93 enum {
95  SWS_COMP_ALL = 0xF,
96 #define SWS_COMP(X) (1 << (X))
97 #define SWS_COMP_TEST(mask, X) (!!((mask) & SWS_COMP(X)))
98 #define SWS_COMP_INV(mask) ((mask) ^ SWS_COMP_ALL)
99 #define SWS_COMP_ELEMS(N) ((1 << (N)) - 1)
100 #define SWS_COMP_COUNT(mask) (av_popcount((mask) & SWS_COMP_ALL))
101 #define SWS_COMP_MASK(X, Y, Z, W) \
102  (((X) ? SWS_COMP(0) : 0) | \
103  ((Y) ? SWS_COMP(1) : 0) | \
104  ((Z) ? SWS_COMP(2) : 0) | \
105  ((W) ? SWS_COMP(3) : 0))
106 };
107 
108 
109 #define ff_sws_comp_mask_str(mask) ff_sws_comp_mask_print(mask, (char[5]){0})
110 static inline char *ff_sws_comp_mask_print(SwsCompMask mask, char buf[5])
111 {
112  char *ptr = buf;
113  for (int c = 0; c < 4; c++) {
114  if (SWS_COMP_TEST(mask, c))
115  *ptr++ = "xyzw"[c];
116  }
117  *ptr = '\0';
118  return buf;
119 }
120 
121 typedef uint32_t SwsUOpFlags;
122 typedef enum SwsUOpFlagBits {
124  SWS_UOP_FLAG_FMA = (1 << 0), /* platform supports FMA ops */
125  SWS_UOP_FLAG_PSHUFB = (1 << 1), /* platform supports pshufb equivalent */
127 
128 typedef enum SwsUOpType {
130 
131  /* Read/write uops; mask = components to read/write */
132  SWS_UOP_READ_PLANAR, /* simple planar byte-aligned read */
133  SWS_UOP_READ_PLANAR_FH, /* planar read with horizontal filter */
134  SWS_UOP_READ_PLANAR_FV, /* planar read with vertical filter */
136  SWS_UOP_READ_PACKED, /* simple packed byte-aligned read */
137  SWS_UOP_READ_NIBBLE, /* fractional read (4 bits) from single plane */
138  SWS_UOP_READ_BIT, /* fractional read (1 bit) from single plane */
139  SWS_UOP_READ_PALETTE, /* indexed read from palette in plane 1 */
140 
141  SWS_UOP_WRITE_PLANAR, /* simple planar byte-aligned write */
142  SWS_UOP_WRITE_PACKED, /* simple packed byte-aligned write */
143  SWS_UOP_WRITE_NIBBLE, /* fractional write (4 bits) to single plane */
144  SWS_UOP_WRITE_BIT, /* fractional write (1 bit) to single plane */
145 
146  /* Packed shuffle / gather uops */
147  SWS_UOP_RW_SHUFFLE, /* in-place (packed) indexed shuffle/gather */
148 
149  /* Data rearrangement uops; mask = needed or trivial components */
150  SWS_UOP_PERMUTE, /* permute pointers (no duplicates) */
151  SWS_UOP_COPY, /* permute data (may contain duplicates) */
152 
153  /* Data conversion / manipulation uops; mask = affected components */
154  SWS_UOP_SWAP_BYTES, /* swap byte order in components */
155  SWS_UOP_EXPAND_BIT, /* expand low-order bit to all bits in type */
156  SWS_UOP_EXPAND_PAIR, /* expand bytes in pairs (16 bit) */
157  SWS_UOP_EXPAND_QUAD, /* expand bytes in quads (32 bit) */
158  SWS_UOP_TO_U8, /* cast pixel values to SWS_PIXEL_U8 */
159  SWS_UOP_TO_U16, /* cast pixel values to SWS_PIXEL_U16 */
160  SWS_UOP_TO_U32, /* cast pixel values to SWS_PIXEL_U32 */
161  SWS_UOP_TO_F32, /* cast pixel values to SWS_PIXEL_F32 */
162 
163  /* Arithmetic uops */
164  SWS_UOP_SCALE, /* multiply masked components by scalar */
165  SWS_UOP_ADD, /* add vec4 to masked components */
166  SWS_UOP_MIN, /* min(x, vec4) on masked components */
167  SWS_UOP_MAX, /* max(x, vec4) on masked components */
168 
169  /* Identical to corresponding SwsOpType */
170  SWS_UOP_UNPACK, /* mask = nonzero components in pack pattern */
171  SWS_UOP_PACK, /* mask = nonzero components in pack pattern */
172  SWS_UOP_LSHIFT, /* mask = components to shift */
173  SWS_UOP_RSHIFT, /* mask = components to shift */
174  SWS_UOP_CLEAR, /* mask = components to clear */
175  SWS_UOP_LINEAR, /* mask = non-trivial output rows */
176  SWS_UOP_LINEAR_FMA, /* with SWS_UOP_FLAG_FMA */
177  SWS_UOP_DITHER, /* mask = components to dither */
178 
179  /* Platform-specific uops would go here */
181 } SwsUOpType;
182 
183 typedef struct SwsShuffleUOp {
184  uint8_t clear_value; /* value to clear elements with negative indices to */
185  uint8_t read_size; /* input bytes per iteration */
186  uint8_t write_size; /* output bytes per iteration */
187 } SwsShuffleUOp;
188 
189 typedef struct SwsShuffleMask {
190  int8_t mask[16]; /* shuffle index mask, or -1 to clear bytes (to `clear_value`) */
191  uint8_t pixels; /* number of pixels per iteration */
193 
194 typedef struct SwsFilterUOp {
195  SwsPixelType type; /* pixel type to store result as */
196 } SwsFilterUOp;
197 
198 typedef struct SwsShiftUOp {
199  uint8_t amount;
200 } SwsShiftUOp;
201 
202 typedef struct SwsMoveUOp {
203  /* The worst case number of moves (for two independent cycles) */
204  #define SWS_UOP_MOVE_MAX 6
206 
207  /* This may involve a temporary register (index -1) */
208  int8_t dst[SWS_UOP_MOVE_MAX]; /* destination register index */
209  int8_t src[SWS_UOP_MOVE_MAX]; /* source register index */
210 } SwsMoveUOp;
211 
212 typedef struct SwsPackUOp {
213  uint8_t pattern[4]; /* bit depth pattern, from MSB to LSB */
214 } SwsPackUOp;
215 
216 typedef struct SwsClearUOp {
217  SwsCompMask one; /* mask of coefficients equal to all 1s */
218  SwsCompMask zero; /* mask of coefficients equal to all 0s */
219 } SwsClearUOp;
220 
221 typedef struct SwsLinearUOp {
222  uint32_t one; /* mask of coefficients equal to one */
223  uint32_t zero; /* mask of coefficients equal to zero */
224 
225  /* for SWS_UOP_LINEAR_FMA only */
226  uint32_t exact; /* mask of coefficients whose product is exact */
227 } SwsLinearUOp;
228 
229 #define SWS_MASK(I, J) (1 << (5 * (I) + (J)))
230 #define SWS_MASK_OFF(I) SWS_MASK(I, 4)
231 #define SWS_MASK_ROW(I) (0x1F << (5 * (I)))
232 #define SWS_MASK_COL(J) (0x8421 << J)
233 #define SWS_MASK_DIAG4 (0x41041)
234 
235 typedef struct SwsDitherUOp {
236  uint8_t y_offset[4];
237  uint8_t size_log2;
238 } SwsDitherUOp;
239 
240 /**
241  * Computes (1 << size_log2) + MAX(y_offset). The dither matrix attached to
242  * the SwsUOp is always pre-padded to this number of lines.
243  */
245 
246 typedef union SwsUOpParams {
247  SwsShuffleUOp shuffle; /* for SWS_UOP_RW_SHUFFLE */
248  SwsFilterUOp filter; /* for SWS_UOP_READ_*_FV/FH */
250  SwsMoveUOp move; /* for SWS_UOP_PERMUTE and SWS_UOP_COPY */
255 } SwsUOpParams;
256 
257 typedef struct SwsUOp {
258  /* These fields uniquely identify the uop implementation */
263 
264  /* Constant data for this uop; not part of the unique identifier */
265  union {
266  SwsFilterWeights *kernel; /* refstruct */
267  SwsPixel *ptr; /* refstruct */
270  SwsPixel mat4[4][5]; /* row major */
271  SwsShuffleMask shuffle; /* for SWS_UOP_RW_SHUFFLE */
272  void *opaque; /* reserved for internal use */
273  } data;
274 } SwsUOp;
275 
276 /**
277  * Compare two SwsUOps for equality (excluding constant data).
278  */
279 int ff_sws_uop_cmp(const SwsUOp *a, const SwsUOp *b);
280 
281 static inline int ff_sws_uop_cmp_v(const void *a, const void *b)
282 {
283  return ff_sws_uop_cmp(a, b);
284 }
285 
286 /**
287  * Generate a unique name for a SwsUOp.
288  */
289 #define SWS_UOP_NAME_MAX 64
290 void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX]);
291 
292 typedef struct SwsUOpList {
294  int num_ops;
295 
296  /* Additional metadata for implementations */
297  SwsCompMask planes_in; /* mask of planes read from */
298  SwsCompMask planes_out; /* mask of planes written to */
299  int pixel_size_max; /* size of largest pixel type seen in any uop */
300 } SwsUOpList;
301 
303 void ff_sws_uop_list_free(SwsUOpList **ops);
304 void ff_sws_uop_list_remove_at(SwsUOpList *uops, int index, int count);
305 
306 /* Takes over ownership of `uop` and sets it to {0}, even on failure. */
307 int ff_sws_uop_list_append(SwsUOpList *uops, SwsUOp *uop);
308 
309 /**
310  * Called internally by ff_sws_ops_translate().
311  */
313 
314 /**
315  * Translate a list of operations down to micro-ops, which can be further
316  * optimized and then directly executed by backends.
317  *
318  * Return 0 or a negative error code.
319  */
321  SwsUOpFlags flags, SwsUOpList *uops);
322 
323 /**
324  * Compute a shuffle mask for `pshufb`-style ASM functions, by repeating
325  * the shuffle pattern for as many groups as will fit.
326  *
327  * @param uop An operation of type SWS_UOP_RW_SHUFFLE.
328  * @param shuffle The output shuffle index mask (or -1 to clear bytes).
329  * @param size The maximum size (in bytes) of the output shuffle mask.
330  *
331  * @return the number of groups on success, or a negative error code.
332  *
333  * @note The shuffle mask is already pre-expanded to fill up to 16 bytes,
334  * so this is only needed for larger shuffle instructions (e.g. vpermb).
335  */
336 int ff_sws_shuffle_mask(const SwsUOp *uop, int8_t shuffle[], int size);
337 
338 #endif
SwsUOpList::pixel_size_max
int pixel_size_max
Definition: uops.h:299
SWS_UOP_RW_SHUFFLE
@ SWS_UOP_RW_SHUFFLE
Definition: uops.h:147
SWS_UOP_SCALE
@ SWS_UOP_SCALE
Definition: uops.h:164
SwsUOpParams::move
SwsMoveUOp move
Definition: uops.h:250
SwsShuffleMask::pixels
uint8_t pixels
Definition: uops.h:191
ff_sws_uop_cmp_v
static int ff_sws_uop_cmp_v(const void *a, const void *b)
Definition: uops.h:281
SWS_UOP_RSHIFT
@ SWS_UOP_RSHIFT
Definition: uops.h:173
SWS_PIXEL_NONE
@ SWS_PIXEL_NONE
Definition: uops.h:39
SwsClearUOp::zero
SwsCompMask zero
Definition: uops.h:218
mask
int mask
Definition: mediacodecdec_common.c:154
ff_sws_uop_cmp
int ff_sws_uop_cmp(const SwsUOp *a, const SwsUOp *b)
Compare two SwsUOps for equality (excluding constant data).
Definition: uops.c:31
ff_sws_pixel_type_is_int
static av_const bool ff_sws_pixel_type_is_int(SwsPixelType type)
Definition: uops.h:62
SwsFilterWeights
Represents a computed filter kernel.
Definition: filters.h:85
ff_sws_uop_list_free
void ff_sws_uop_list_free(SwsUOpList **ops)
Definition: uops.c:183
b
#define b
Definition: input.c:43
SWS_UOP_MOVE_MAX
#define SWS_UOP_MOVE_MAX
Definition: uops.h:204
SWS_UOP_LINEAR_FMA
@ SWS_UOP_LINEAR_FMA
Definition: uops.h:176
SWS_UOP_MAX
@ SWS_UOP_MAX
Definition: uops.h:167
ff_sws_pixel_type_name
const char * ff_sws_pixel_type_name(SwsPixelType type)
Definition: ops.c:56
SWS_UOP_LSHIFT
@ SWS_UOP_LSHIFT
Definition: uops.h:172
SwsLinearUOp::one
uint32_t one
Definition: uops.h:222
SwsFilterUOp
Definition: uops.h:194
SWS_UOP_TYPE_NB
@ SWS_UOP_TYPE_NB
Definition: uops.h:180
SWS_UOP_NAME_MAX
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
Definition: uops.h:289
SwsMoveUOp::num_moves
int num_moves
Definition: uops.h:205
SwsMoveUOp
Definition: uops.h:202
SWS_COMP_TEST
#define SWS_COMP_TEST(mask, X)
Definition: uops.h:97
SWS_UOP_TO_U16
@ SWS_UOP_TO_U16
Definition: uops.h:159
SWS_UOP_PACK
@ SWS_UOP_PACK
Definition: uops.h:171
ff_sws_uop_list_alloc
SwsUOpList * ff_sws_uop_list_alloc(void)
Definition: uops.c:197
SwsShiftUOp::amount
uint8_t amount
Definition: uops.h:199
SWS_UOP_PERMUTE
@ SWS_UOP_PERMUTE
Definition: uops.h:150
SwsUOpParams::pack
SwsPackUOp pack
Definition: uops.h:251
SWS_UOP_EXPAND_BIT
@ SWS_UOP_EXPAND_BIT
Definition: uops.h:155
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
SwsUOpParams
Definition: uops.h:246
SwsFilterUOp::type
SwsPixelType type
Definition: uops.h:195
SWS_UOP_COPY
@ SWS_UOP_COPY
Definition: uops.h:151
SWS_UOP_INVALID
@ SWS_UOP_INVALID
Definition: uops.h:129
ff_sws_uop_list_optimize
int ff_sws_uop_list_optimize(SwsContext *ctx, SwsUOpFlags flags, SwsUOpList *uops)
Called internally by ff_sws_ops_translate().
Definition: ops_optimizer.c:1016
SWS_UOP_WRITE_NIBBLE
@ SWS_UOP_WRITE_NIBBLE
Definition: uops.h:143
SWS_UOP_READ_PALETTE
@ SWS_UOP_READ_PALETTE
Definition: uops.h:139
av_const
#define av_const
Definition: attributes.h:113
SwsUOp::kernel
SwsFilterWeights * kernel
Definition: uops.h:266
float
float
Definition: af_crystalizer.c:122
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:504
SwsShuffleUOp::write_size
uint8_t write_size
Definition: uops.h:186
SwsPackUOp
Definition: uops.h:212
dither
static const uint16_t dither[8][8]
Definition: vf_gradfun.c:46
SwsUOp::uop
SwsUOpType uop
Definition: uops.h:260
SWS_UOP_FLAG_PSHUFB
@ SWS_UOP_FLAG_PSHUFB
Definition: uops.h:125
SWS_UOP_WRITE_PLANAR
@ SWS_UOP_WRITE_PLANAR
Definition: uops.h:141
SwsShuffleMask::mask
int8_t mask[16]
Definition: uops.h:190
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_UOP_TO_F32
@ SWS_UOP_TO_F32
Definition: uops.h:161
SWS_UOP_MIN
@ SWS_UOP_MIN
Definition: uops.h:166
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
SwsCompMask
uint8_t SwsCompMask
Bit-mask of components.
Definition: uops.h:87
SWS_UOP_READ_PACKED
@ SWS_UOP_READ_PACKED
Definition: uops.h:136
SwsPixel::f32
float f32
Definition: uops.h:83
ff_sws_pixel_type_size
static av_const int ff_sws_pixel_type_size(SwsPixelType type)
Definition: uops.h:49
SwsPixel::u8
uint8_t u8
Definition: uops.h:80
SwsUOp::mat4
SwsPixel mat4[4][5]
Definition: uops.h:270
SWS_PIXEL_TYPE_NB
@ SWS_PIXEL_TYPE_NB
Definition: uops.h:44
SwsUOpParams::shift
SwsShiftUOp shift
Definition: uops.h:249
SwsLinearUOp
Definition: uops.h:221
SwsShuffleUOp::read_size
uint8_t read_size
Definition: uops.h:185
SwsMoveUOp::dst
int8_t dst[SWS_UOP_MOVE_MAX]
Definition: uops.h:208
ff_sws_uop_list_remove_at
void ff_sws_uop_list_remove_at(SwsUOpList *uops, int index, int count)
Definition: uops.c:215
SwsClearUOp::one
SwsCompMask one
Definition: uops.h:217
SwsClearUOp
Definition: uops.h:216
SWS_UOP_READ_NIBBLE
@ SWS_UOP_READ_NIBBLE
Definition: uops.h:137
attributes.h
SWS_UOP_ADD
@ SWS_UOP_ADD
Definition: uops.h:165
SwsShiftUOp
Definition: uops.h:198
SwsPixelType
SwsPixelType
Definition: uops.h:38
index
int index
Definition: gxfenc.c:90
c
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
Definition: undefined.txt:32
SwsUOp::par
SwsUOpParams par
Definition: uops.h:262
SWS_UOP_TO_U32
@ SWS_UOP_TO_U32
Definition: uops.h:160
SwsPixel::u16
uint16_t u16
Definition: uops.h:81
SwsUOp
Definition: uops.h:257
SWS_UOP_WRITE_BIT
@ SWS_UOP_WRITE_BIT
Definition: uops.h:144
SwsUOp::opaque
void * opaque
Definition: uops.h:272
SwsUOp::shuffle
SwsShuffleMask shuffle
Definition: uops.h:271
SWS_UOP_READ_PLANAR_FV_FMA
@ SWS_UOP_READ_PLANAR_FV_FMA
Definition: uops.h:135
SwsLinearUOp::zero
uint32_t zero
Definition: uops.h:223
SwsUOp::mask
SwsCompMask mask
Definition: uops.h:261
SwsDitherUOp::size_log2
uint8_t size_log2
Definition: uops.h:237
size
int size
Definition: twinvq_data.h:10344
SWS_UOP_UNPACK
@ SWS_UOP_UNPACK
Definition: uops.h:170
SWS_PIXEL_U32
@ SWS_PIXEL_U32
Definition: uops.h:42
SWS_UOP_FLAG_NONE
@ SWS_UOP_FLAG_NONE
Definition: uops.h:123
SwsShuffleUOp::clear_value
uint8_t clear_value
Definition: uops.h:184
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
SWS_COMP_NONE
@ SWS_COMP_NONE
Definition: uops.h:94
SwsPixel
Definition: uops.h:77
SwsShuffleUOp
Definition: uops.h:183
ff_sws_shuffle_mask
int ff_sws_shuffle_mask(const SwsUOp *uop, int8_t shuffle[], int size)
Compute a shuffle mask for pshufb-style ASM functions, by repeating the shuffle pattern for as many g...
Definition: ops_optimizer.c:857
SwsUOpFlagBits
SwsUOpFlagBits
Definition: uops.h:122
SWS_UOP_TO_U8
@ SWS_UOP_TO_U8
Definition: uops.h:158
SWS_UOP_READ_PLANAR
@ SWS_UOP_READ_PLANAR
Definition: uops.h:132
SWS_PIXEL_U8
@ SWS_PIXEL_U8
Definition: uops.h:40
SwsUOpType
SwsUOpType
Definition: uops.h:128
SWS_UOP_SWAP_BYTES
@ SWS_UOP_SWAP_BYTES
Definition: uops.h:154
SwsUOp::scalar
SwsPixel scalar
Definition: uops.h:268
SwsShuffleMask
Definition: uops.h:189
SWS_UOP_LINEAR
@ SWS_UOP_LINEAR
Definition: uops.h:175
SwsUOpParams::lin
SwsLinearUOp lin
Definition: uops.h:253
SwsUOpList::planes_out
SwsCompMask planes_out
Definition: uops.h:298
SwsPackUOp::pattern
uint8_t pattern[4]
Definition: uops.h:213
SwsUOp::type
SwsPixelType type
Definition: uops.h:259
SwsUOpList::num_ops
int num_ops
Definition: uops.h:294
ff_sws_uop_name
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
Definition: uops.c:81
SwsUOp::ptr
SwsPixel * ptr
Definition: uops.h:267
ff_sws_uop_list_append
int ff_sws_uop_list_append(SwsUOpList *uops, SwsUOp *uop)
Definition: uops.c:202
ff_sws_ops_translate
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...
Definition: uops.c:665
ff_sws_comp_mask_print
static char * ff_sws_comp_mask_print(SwsCompMask mask, char buf[5])
Definition: uops.h:110
SwsLinearUOp::exact
uint32_t exact
Definition: uops.h:226
SwsDitherUOp::y_offset
uint8_t y_offset[4]
Definition: uops.h:236
SwsUOpList
Definition: uops.h:292
SwsUOp::vec4
SwsPixel vec4[4]
Definition: uops.h:269
SwsUOpList::planes_in
SwsCompMask planes_in
Definition: uops.h:297
SWS_UOP_DITHER
@ SWS_UOP_DITHER
Definition: uops.h:177
SWS_UOP_WRITE_PACKED
@ SWS_UOP_WRITE_PACKED
Definition: uops.h:142
SwsDitherUOp
Definition: uops.h:235
SwsUOpParams::dither
SwsDitherUOp dither
Definition: uops.h:254
SWS_PIXEL_F32
@ SWS_PIXEL_F32
Definition: uops.h:43
SWS_COMP_ALL
@ SWS_COMP_ALL
Definition: uops.h:95
SWS_UOP_READ_PLANAR_FV
@ SWS_UOP_READ_PLANAR_FV
Definition: uops.h:134
SWS_UOP_EXPAND_QUAD
@ SWS_UOP_EXPAND_QUAD
Definition: uops.h:157
SwsUOpFlags
uint32_t SwsUOpFlags
Definition: uops.h:121
SWS_UOP_READ_PLANAR_FH
@ SWS_UOP_READ_PLANAR_FH
Definition: uops.h:133
SwsMoveUOp::src
int8_t src[SWS_UOP_MOVE_MAX]
Definition: uops.h:209
SwsUOpParams::filter
SwsFilterUOp filter
Definition: uops.h:248
SWS_UOP_FLAG_FMA
@ SWS_UOP_FLAG_FMA
Definition: uops.h:124
SWS_UOP_READ_BIT
@ SWS_UOP_READ_BIT
Definition: uops.h:138
SWS_UOP_CLEAR
@ SWS_UOP_CLEAR
Definition: uops.h:174
SwsOpList
Helper struct for representing a list of operations.
Definition: ops.h:265
SwsContext
Main external API structure.
Definition: swscale.h:227
SWS_PIXEL_U16
@ SWS_PIXEL_U16
Definition: uops.h:41
SwsPixel::u32
uint32_t u32
Definition: uops.h:82
SwsUOp::data
union SwsUOp::@596 data
shuffle
static uint64_t shuffle(uint64_t in, const uint8_t *shuffle, int shuffle_len)
Definition: des.c:179
SwsUOpParams::clear
SwsClearUOp clear
Definition: uops.h:252
SwsPixel::data
char data[4]
Definition: uops.h:78
SwsUOpList::ops
SwsUOp * ops
Definition: uops.h:293
ff_sws_dither_height
int ff_sws_dither_height(const SwsDitherUOp *dither)
Computes (1 << size_log2) + MAX(y_offset).
Definition: uops.c:226
SWS_UOP_EXPAND_PAIR
@ SWS_UOP_EXPAND_PAIR
Definition: uops.h:156
SwsUOpParams::shuffle
SwsShuffleUOp shuffle
Definition: uops.h:247