FFmpeg
Loading...
Searching...
No Matches
uops_macros_gen.c
Go to the documentation of this file.
1/**
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include <string.h>
20
21#ifdef _WIN32
22#include <io.h>
23#include <fcntl.h>
24#endif
25
26#include "libavutil/bprint.h"
27#include "libavutil/error.h"
28#include "libavutil/macros.h"
29#include "libavutil/mem.h"
30#include "libavutil/pixfmt.h"
31#include "libavutil/thread.h"
32#include "libavutil/tree.h"
33#include "ops.h"
34#include "ops_dispatch.h"
36#include "swscale.h"
37#include "uops.h"
38#include "uops_list.h"
39
40static const struct {
41 char full[32];
42 char abbr[32];
44#define UOP_NAME(OP, ABBR) [OP] = { #OP, ABBR },
46};
47
48static const struct {
49 char full[16];
50 char prefix[8];
52 [SWS_PIXEL_NONE] = { "SWS_PIXEL_NONE", "" },
53 [SWS_PIXEL_U8] = { "SWS_PIXEL_U8", "U8_" },
54 [SWS_PIXEL_U16] = { "SWS_PIXEL_U16", "U16_" },
55 [SWS_PIXEL_U32] = { "SWS_PIXEL_U32", "U32_" },
56 [SWS_PIXEL_F32] = { "SWS_PIXEL_F32", "F32_" },
57};
58
59static int generate_entry_struct(void *opaque, void *key)
60{
61 const SwsUOp *ref = opaque;
62 const SwsUOp *uop = key;
63 AVBPrint *bp = ref->data.opaque;
66 av_bprintf(bp, " \\\n MACRO(__VA_ARGS__, %-40s", name);
67 av_bprintf(bp, ", .type = %-13s, .uop = %-24s, .mask = 0x%x",
68 pixel_types[uop->type].full, uop_names[uop->uop].full, uop->mask);
69
70 const SwsUOpParams *par = &uop->par;
71 switch (uop->uop) {
75 av_bprintf(bp, ", .par.filter.type = %s", pixel_types[par->filter.type].full);
76 break;
78 av_bprintf(bp, ", .par.shuffle.clear_value = 0x%x"
79 ", .par.shuffle.read_size = %u"
80 ", .par.shuffle.write_size = %u",
83 break;
84 case SWS_UOP_LSHIFT:
85 case SWS_UOP_RSHIFT:
86 av_bprintf(bp, ", .par.shift.amount = %u", par->shift.amount);
87 break;
88 case SWS_UOP_PERMUTE:
89 case SWS_UOP_COPY:
90 av_bprintf(bp, ", .par.move.num_moves = %d", par->move.num_moves);
91 av_bprintf(bp, ", .par.move.dst = {%d, %d, %d, %d, %d, %d}",
92 par->move.dst[0], par->move.dst[1], par->move.dst[2],
93 par->move.dst[3], par->move.dst[4], par->move.dst[5]);
94 av_bprintf(bp, ", .par.move.src = {%d, %d, %d, %d, %d, %d}",
95 par->move.src[0], par->move.src[1], par->move.src[2],
96 par->move.src[3], par->move.src[4], par->move.src[5]);
97 break;
98 case SWS_UOP_PACK:
99 case SWS_UOP_UNPACK:
100 av_bprintf(bp, ", .par.pack.pattern = {%d, %d, %d, %d}",
101 par->pack.pattern[0], par->pack.pattern[1],
102 par->pack.pattern[2], par->pack.pattern[3]);
103 break;
104 case SWS_UOP_CLEAR:
105 av_bprintf(bp, ", .par.clear.one = 0x%x, .par.clear.zero = 0x%x",
106 par->clear.one, par->clear.zero);
107 break;
108 case SWS_UOP_LINEAR:
110 av_bprintf(bp, ", .par.lin.one = 0x%x, .par.lin.zero = 0x%x",
111 par->lin.one, par->lin.zero);
112 if (uop->uop == SWS_UOP_LINEAR_FMA)
113 av_bprintf(bp, ", .par.lin.exact = 0x%x", par->lin.exact);
114 break;
115 case SWS_UOP_DITHER:
116 av_bprintf(bp, ", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
117 par->dither.y_offset[0], par->dither.y_offset[1],
118 par->dither.y_offset[2], par->dither.y_offset[3],
119 par->dither.size_log2);
120 break;
121 case SWS_UOP_LUT_3D:
122 av_bprintf(bp, ", .par.lut3d.dynamic = %d", par->lut3d.dynamic);
123 break;
124 }
125
126 av_bprintf(bp, ")");
127 return 0;
128}
129
130static int generate_entry_args(void *opaque, void *key)
131{
132 const SwsUOp *ref = opaque;
133 const SwsUOp *uop = key;
134 AVBPrint *bp = ref->data.opaque;
136 ff_sws_uop_name(uop, name);
137 av_bprintf(bp, " \\\n MACRO(__VA_ARGS__, %-40s, %-13s, %-24s, 0x%x",
138 name, pixel_types[uop->type].full, uop_names[uop->uop].full, uop->mask);
139
140 const SwsUOpParams *par = &uop->par;
141 switch (uop->uop) {
145 av_bprintf(bp, ", %s", pixel_types[par->filter.type].full);
146 break;
148 av_bprintf(bp, ", 0x%x, %u, %u", par->shuffle.clear_value,
150 break;
151 case SWS_UOP_LSHIFT:
152 case SWS_UOP_RSHIFT:
153 av_bprintf(bp, ", %u", par->shift.amount);
154 break;
155 case SWS_UOP_PERMUTE:
156 case SWS_UOP_COPY:
157 av_bprintf(bp, ", %d", par->move.num_moves);
158 av_bprintf(bp, ", %d, %d, %d, %d, %d, %d",
159 par->move.dst[0], par->move.dst[1], par->move.dst[2],
160 par->move.dst[3], par->move.dst[4], par->move.dst[5]);
161 av_bprintf(bp, ", %d, %d, %d, %d, %d, %d",
162 par->move.src[0], par->move.src[1], par->move.src[2],
163 par->move.src[3], par->move.src[4], par->move.src[5]);
164 break;
165 case SWS_UOP_PACK:
166 case SWS_UOP_UNPACK:
167 av_bprintf(bp, ", %d, %d, %d, %d",
168 par->pack.pattern[0], par->pack.pattern[1],
169 par->pack.pattern[2], par->pack.pattern[3]);
170 break;
171 case SWS_UOP_CLEAR:
172 av_bprintf(bp, ", 0x%05x, 0x%05x", par->clear.one, par->clear.zero);
173 break;
174 case SWS_UOP_LINEAR:
176 av_bprintf(bp, ", 0x%05x, 0x%05x", par->lin.one, par->lin.zero);
177 if (uop->uop == SWS_UOP_LINEAR_FMA)
178 av_bprintf(bp, ", 0x%05x", par->lin.exact);
179 break;
180 case SWS_UOP_DITHER:
181 av_bprintf(bp, ", %u, %u, %u, %u, %u",
182 par->dither.y_offset[0], par->dither.y_offset[1],
183 par->dither.y_offset[2], par->dither.y_offset[3],
184 par->dither.size_log2);
185 break;
186 case SWS_UOP_LUT_3D:
187 av_bprintf(bp, ", %d", par->lut3d.dynamic);
188 break;
189 }
190
191 av_bprintf(bp, ")");
192 return 0;
193}
194
195struct EnumPriv {
198};
199
200static int register_uop(struct EnumPriv *s, const SwsUOp *uop)
201{
202 SwsUOp *key = av_memdup(uop, sizeof(*uop));
203 if (!key)
204 return AVERROR(ENOMEM);
205 memset(&key->data, 0, sizeof(key->data));
206
207 struct AVTreeNode *node = av_tree_node_alloc();
208 if (!node) {
209 av_free(key);
210 return AVERROR(ENOMEM);
211 }
212
213 ff_mutex_lock(&s->lock);
214 av_tree_insert(&s->root, key, ff_sws_uop_cmp_v, &node);
215 ff_mutex_unlock(&s->lock);
216 if (node) {
217 av_free(node);
218 av_free(key);
219 }
220 return 0;
221}
222
224{
226 if (!uops)
227 return AVERROR(ENOMEM);
228
229 int ret = ff_sws_ops_translate(ctx, ops, flags, uops);
230 if (ret < 0)
231 goto fail;
232
233 for (int i = 0; i < uops->num_ops; i++) {
234 ret = register_uop(ctx->opaque, &uops->ops[i]);
235 if (ret < 0)
236 goto fail;
237 }
238
239fail:
241 return ret;
242}
243
244static const SwsUOpFlags uop_flags[] = {
245 0,
246 SWS_UOP_FLAG_PSHUFB | SWS_UOP_FLAG_FMA, /* x86 backend */
247};
248
249static int register_uops(SwsContext *ctx, const SwsOpList *ops,
251{
252 for (int i = 0; i < FF_ARRAY_ELEMS(uop_flags); i++) {
253 int ret = register_flags(ctx, ops, uop_flags[i]);
254 if (ret < 0)
255 return ret;
256 }
257
258 *out = (SwsCompiledOp) {0}; /* dummy value, will be immediately freed */
259 return 0;
260}
261
262/* Dummy backend that just registers all seen uops */
264 .name = "uops_gen",
265 .compile = register_uops,
266};
267
268static int register_all_uops(SwsContext *ctx, void *graph, SwsOpList *ops)
269{
270 /* ff_sws_compile_pass() takes over ownership of `ops` */
272 if (!copy)
273 return AVERROR(ENOMEM);
274
276 return ff_sws_compile_pass(graph, &backend_uops, &copy, flags, NULL, NULL);
277}
278
279static const SwsFlags flags_list[] = {
280 0,
281 SWS_ACCURATE_RND, /* may insert extra 1x1 dither ops (for accurate rounding) */
282 SWS_BITEXACT, /* prevents some FMA optimizations */
284};
285
286/* Limit the range of av_tree_enumerate() to only matching uop and type */
287static int enum_type(void *opaque, void *elem)
288{
289 const SwsUOp *a = opaque, *b = elem;
290 if (a->type != b->type)
291 return (int) b->type - a->type;
292 if (a->uop != b->uop)
293 return (int) b->uop - a->uop;
294 return 0;
295}
296
297static int free_uop_key(void *opaque, void *key)
298{
299 av_free(key);
300 return 0;
301}
302
303/**
304 * Generate a set of boilerplate C preprocessor macros for describing and
305 * programmatically iterating over all possible SwsUOps.
306 *
307 * This function can be quite slow as it iterates over every possible
308 * combination of pixel formats and flags.
309 *
310 * Returns 0 or a negative error code. On success, an allocated string is
311 * returned via `out_str`, and must be av_free()'d by the caller.
312 */
313static int sws_uops_macros_gen(char **out_str)
314{
315 struct EnumPriv s = {0};
316 SwsLut3D *lut3d = NULL;
317 int ret = ff_mutex_init(&s.lock, NULL);
318 if (ret)
319 return AVERROR(ENOSYS);
320
321 AVBPrint bprint, *const bp = &bprint;
323
324 /* Allocate dummy graph and context for ff_sws_compile_pass() */
325 SwsGraph *graph = ff_sws_graph_alloc();
327 if (!graph || !ctx) {
328 ret = AVERROR(ENOMEM);
329 goto fail;
330 }
331
332 /* Use this to plumb the enum state through all the layers of abstraction */
333 graph->ctx = ctx;
334 ctx->opaque = &s;
335 ctx->scaler = SWS_SCALE_BILINEAR; /* cheaper to generate filter kernels */
336 ctx->threads = 0; /* use slice threading to speed up tree building */
337
338 /* Allocate dummy 3DLUT to force generation of SWS_UOP_LUT_3D */
339 lut3d = ff_sws_lut3d_alloc();
340 if (!lut3d) {
341 ret = AVERROR(ENOMEM);
342 goto fail;
343 }
344 ret = ff_sws_enum_op_lists(ctx, graph, lut3d, AV_PIX_FMT_NONE,
346 if (ret < 0)
347 goto fail;
348
349 lut3d->dynamic = true;
350 ret = ff_sws_enum_op_lists(ctx, graph, lut3d, AV_PIX_FMT_NONE,
352 if (ret < 0)
353 goto fail;
354
355 /* Register all unique uops over every relevant combination of flags */
356 for (int i = 0; i < FF_ARRAY_ELEMS(flags_list); i++) {
357 ctx->flags = flags_list[i];
360 if (ret < 0)
361 goto fail;
362 }
363
364 #define BPRINT_STR(str) av_bprint_append_data(bp, str, strlen(str))
366"/**\n"
367" * This file is automatically generated. Do not edit manually.\n"
368" * To regenerate, run: make fate-sws-uops-macros GEN=1\n"
369" */\n"
370"\n"
371"#ifndef SWSCALE_UOPS_MACROS_H\n"
372"#define SWSCALE_UOPS_MACROS_H\n"
373"\n"
374"/**\n"
375" * Boilerplate helper macros, for template-based backends. These will be\n"
376" * instantiated like this, with parameters in struct order:\n"
377" * MACRO(__VA_ARGS__, NAME, UOP, TYPE, MASK, [PARAMS,])\n"
378" * The _STRUCT variants pass all arguments in C struct syntax, while the\n"
379" * plain variants give them as separate C values (e.g. for use in calls)\n"
380" */\n"
381"#define SWS_GLUE3(x, y, z) x ## _ ## y ## _ ## z\n"
382"#define SWS_FOR(TYPE, UOP, MACRO, ...) \\\n"
383" SWS_GLUE3(SWS_FOR, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
384"#define SWS_FOR_STRUCT(TYPE, UOP, MACRO, ...) \\\n"
385" SWS_GLUE3(SWS_FOR_STRUCT, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
386"\n");
387
388 SwsUOp key = { .data.opaque = bp };
389 for (key.type = SWS_PIXEL_NONE + 1; key.type < SWS_PIXEL_TYPE_NB; key.type++) {
390 for (key.uop = SWS_UOP_INVALID + 1; key.uop < SWS_UOP_TYPE_NB; key.uop++) {
391 const char *macro = uop_names[key.uop].full + sizeof("SWS_UOP_") - 1;
392 const char *prefix = pixel_types[key.type].prefix;
393 av_bprintf(bp, "#define SWS_FOR_%s%s(MACRO, ...)", prefix, macro);
395 av_bprintf(bp, "\n");
396 av_bprintf(bp, "#define SWS_FOR_STRUCT_%s%s(MACRO, ...)", prefix, macro);
398 av_bprintf(bp, "\n");
399 }
400 }
401
402 BPRINT_STR("\n#endif /* SWSCALE_UOPS_MACROS_H */");
403 ret = av_bprint_finalize(bp, out_str);
404
405fail:
406 av_refstruct_unref(&lut3d);
409 av_tree_destroy(s.root);
410 ff_mutex_destroy(&s.lock);
411 ff_sws_graph_free(&graph);
413 return ret;
414}
415
416int main(int argc, char **argv)
417{
418#ifdef _WIN32
419 _setmode(_fileno(stdout), _O_BINARY);
420#endif
421
422 char *macros = NULL;
423 int ret = sws_uops_macros_gen(&macros);
424 if (ret >= 0)
425 puts(macros);
426 av_free(macros);
427 return ret;
428}
static FILE * out
static AVFormatContext * ctx
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition bprint.c:122
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition bprint.c:69
AVBPrint public header.
#define AV_BPRINT_SIZE_UNLIMITED
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define NULL
Definition coverity.c:32
int main
Definition dovi_rpuenc.c:38
error code definitions
const char * key
SwsGraph * ff_sws_graph_alloc(void)
Allocate an empty SwsGraph.
Definition graph.c:866
void ff_sws_graph_free(SwsGraph **pgraph)
Uninitialize any state associate with this filter graph and free it.
Definition graph.c:942
#define fail
Definition test.h:479
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition bprint.c:235
#define AVERROR(e)
Definition error.h:45
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
Definition mem.c:302
void av_tree_enumerate(AVTreeNode *t, void *opaque, int(*cmp)(void *opaque, void *elem), int(*enu)(void *opaque, void *elem))
Apply enu(opaque, &elem) to all the elements in the tree in a given range.
Definition tree.c:155
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
Definition tree.c:59
void av_tree_destroy(AVTreeNode *t)
Definition tree.c:146
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
Definition tree.c:34
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
Definition utils.c:1032
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
Definition utils.c:2321
SwsFlags
Definition swscale.h:131
@ SWS_SCALE_BILINEAR
bilinear filtering
Definition swscale.h:98
@ SWS_BITEXACT
Definition swscale.h:178
@ SWS_ACCURATE_RND
Force bit-exact output.
Definition swscale.h:177
int a
#define b
Definition input.c:43
static int ff_mutex_unlock(AVMutex *mutex)
Definition thread.h:189
static int ff_mutex_lock(AVMutex *mutex)
Definition thread.h:188
static int ff_mutex_destroy(AVMutex *mutex)
Definition thread.h:190
#define AVMutex
Definition thread.h:184
static int ff_mutex_init(AVMutex *mutex, const void *attr)
Definition thread.h:187
SwsLut3D * ff_sws_lut3d_alloc(void)
Allocates a refstruct.
Definition lut3d.c:33
Utility Preprocessor macros.
Memory handling functions.
static int ff_sws_enum_op_lists(SwsContext *ctx, void *opaque, const SwsLut3D *lut3d, 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 ...
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
Definition ops.c:673
int ff_sws_compile_pass(SwsGraph *graph, const SwsOpBackend *backend, SwsOpList **pops, int flags, SwsPass *input, SwsPass **output)
Resolves an operation list to a graph pass.
@ SWS_OP_FLAG_DRY_RUN
@ SWS_OP_FLAG_SPLIT_MEMCPY
pixel format definitions
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
const char * name
Definition qsvenc.c:142
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
Definition refstruct.c:120
#define FF_ARRAY_ELEMS(a)
void * elem
Definition tree.c:28
struct AVTreeNode * root
SwsCompMask one
Definition uops.h:219
SwsCompMask zero
Definition uops.h:220
Main external API structure.
Definition swscale.h:227
uint8_t size_log2
Definition uops.h:239
uint8_t y_offset[4]
Definition uops.h:238
SwsPixelType type
Definition uops.h:197
Filter graph, which represents a 'baked' pixel format conversion.
Definition graph.h:132
SwsContext * ctx
Definition graph.h:133
uint32_t zero
Definition uops.h:225
uint32_t one
Definition uops.h:224
uint32_t exact
Definition uops.h:228
int dynamic
Definition uops.h:243
Append a set of operations for applying a gamut/tone mapping 3D LUT to the pixels.
Definition lut3d.h:50
bool dynamic
Definition lut3d.h:52
int8_t src[SWS_UOP_MOVE_MAX]
Definition uops.h:211
int num_moves
Definition uops.h:207
int8_t dst[SWS_UOP_MOVE_MAX]
Definition uops.h:210
Helper struct for representing a list of operations.
Definition ops.h:293
uint8_t pattern[4]
Definition uops.h:215
uint8_t amount
Definition uops.h:201
uint8_t write_size
Definition uops.h:188
uint8_t read_size
Definition uops.h:187
uint8_t clear_value
Definition uops.h:186
SwsUOp * ops
Definition uops.h:301
int num_ops
Definition uops.h:302
Definition uops.h:264
SwsCompMask mask
Definition uops.h:268
SwsUOpType uop
Definition uops.h:267
SwsUOpParams par
Definition uops.h:269
SwsPixelType type
Definition uops.h:266
static const char pixel_types[SWS_PIXEL_TYPE_NB][32]
external API header
#define av_free(p)
static int ref[MAX_W *MAX_W]
A tree container.
SwsMoveUOp move
Definition uops.h:256
SwsClearUOp clear
Definition uops.h:258
SwsDitherUOp dither
Definition uops.h:260
SwsFilterUOp filter
Definition uops.h:254
SwsLut3DUOp lut3d
Definition uops.h:261
SwsShuffleUOp shuffle
Definition uops.h:253
SwsLinearUOp lin
Definition uops.h:259
SwsShiftUOp shift
Definition uops.h:255
SwsPackUOp pack
Definition uops.h:257
char abbr[32]
Definition uops.c:43
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:677
#define UOP_NAME(OP, ABBR)
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
Definition uops.c:81
SwsUOpList * ff_sws_uop_list_alloc(void)
Definition uops.c:203
void ff_sws_uop_list_free(SwsUOpList **p_ops)
Definition uops.c:189
static const struct @145311200363243152256244361015041277337174162300 uop_names[SWS_UOP_TYPE_NB]
uint32_t SwsUOpFlags
Definition uops.h:122
@ SWS_PIXEL_F32
Definition uops.h:44
@ SWS_PIXEL_U32
Definition uops.h:43
@ SWS_PIXEL_U16
Definition uops.h:42
@ SWS_PIXEL_TYPE_NB
Definition uops.h:45
@ SWS_PIXEL_NONE
Definition uops.h:40
@ SWS_PIXEL_U8
Definition uops.h:41
@ SWS_UOP_PACK
Definition uops.h:172
@ SWS_UOP_PERMUTE
Definition uops.h:151
@ SWS_UOP_LINEAR
Definition uops.h:176
@ SWS_UOP_RSHIFT
Definition uops.h:174
@ SWS_UOP_COPY
Definition uops.h:152
@ SWS_UOP_INVALID
Definition uops.h:130
@ SWS_UOP_LINEAR_FMA
Definition uops.h:177
@ SWS_UOP_READ_PLANAR_FH
Definition uops.h:134
@ SWS_UOP_READ_PLANAR_FV_FMA
Definition uops.h:136
@ SWS_UOP_LUT_3D
Definition uops.h:179
@ SWS_UOP_DITHER
Definition uops.h:178
@ SWS_UOP_TYPE_NB
Definition uops.h:182
@ SWS_UOP_CLEAR
Definition uops.h:175
@ SWS_UOP_READ_PLANAR_FV
Definition uops.h:135
@ SWS_UOP_RW_SHUFFLE
Definition uops.h:148
@ SWS_UOP_UNPACK
Definition uops.h:171
@ SWS_UOP_LSHIFT
Definition uops.h:173
static int ff_sws_uop_cmp_v(const void *a, const void *b)
Definition uops.h:289
@ SWS_UOP_FLAG_FMA
Definition uops.h:125
@ SWS_UOP_FLAG_PSHUFB
Definition uops.h:126
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
Definition uops.h:297
#define UOPS_LIST(ENTRY)
This file is part of FFmpeg.
Definition uops_list.h:23
static const SwsOpBackend backend_uops
static const SwsFlags flags_list[]
static int register_uops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
static int register_uop(struct EnumPriv *s, const SwsUOp *uop)
static const SwsUOpFlags uop_flags[]
static int register_flags(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags)
static int register_all_uops(SwsContext *ctx, void *graph, SwsOpList *ops)
#define BPRINT_STR(str)
static int free_uop_key(void *opaque, void *key)
char full[32]
static int sws_uops_macros_gen(char **out_str)
Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating ove...
static int enum_type(void *opaque, void *elem)
char prefix[8]
static int generate_entry_struct(void *opaque, void *key)
static int generate_entry_args(void *opaque, void *key)
static void copy(const float *p1, float *p2, const int length)