FFmpeg
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/tree.h"
32 #include "ops.h"
33 #include "ops_dispatch.h"
34 #include "op_list_gen_template.c"
35 #include "swscale.h"
36 #include "uops.h"
37 #include "uops_list.h"
38 
39 static const struct {
40  char full[32];
41  char abbr[32];
43 #define UOP_NAME(OP, ABBR) [OP] = { #OP, ABBR },
45 };
46 
47 static const struct {
48  char full[16];
49  char prefix[8];
51  [SWS_PIXEL_NONE] = { "SWS_PIXEL_NONE", "" },
52  [SWS_PIXEL_U8] = { "SWS_PIXEL_U8", "U8_" },
53  [SWS_PIXEL_U16] = { "SWS_PIXEL_U16", "U16_" },
54  [SWS_PIXEL_U32] = { "SWS_PIXEL_U32", "U32_" },
55  [SWS_PIXEL_F32] = { "SWS_PIXEL_F32", "F32_" },
56 };
57 
58 static int generate_entry_struct(void *opaque, void *key)
59 {
60  const SwsUOp *ref = opaque;
61  const SwsUOp *uop = key;
62  AVBPrint *bp = ref->data.opaque;
63  char name[SWS_UOP_NAME_MAX];
64  ff_sws_uop_name(uop, name);
65  av_bprintf(bp, " \\\n MACRO(__VA_ARGS__, %-40s", name);
66  av_bprintf(bp, ", .type = %-13s, .uop = %-24s, .mask = 0x%x",
67  pixel_types[uop->type].full, uop_names[uop->uop].full, uop->mask);
68 
69  const SwsUOpParams *par = &uop->par;
70  switch (uop->uop) {
74  av_bprintf(bp, ", .par.filter.type = %s", pixel_types[par->filter.type].full);
75  break;
76  case SWS_UOP_RW_SHUFFLE:
77  av_bprintf(bp, ", .par.shuffle.clear_value = 0x%x"
78  ", .par.shuffle.read_size = %u"
79  ", .par.shuffle.write_size = %u",
80  par->shuffle.clear_value,
81  par->shuffle.read_size, par->shuffle.write_size);
82  break;
83  case SWS_UOP_LSHIFT:
84  case SWS_UOP_RSHIFT:
85  av_bprintf(bp, ", .par.shift.amount = %u", par->shift.amount);
86  break;
87  case SWS_UOP_PERMUTE:
88  case SWS_UOP_COPY:
89  av_bprintf(bp, ", .par.move.num_moves = %d", par->move.num_moves);
90  av_bprintf(bp, ", .par.move.dst = {%d, %d, %d, %d, %d, %d}",
91  par->move.dst[0], par->move.dst[1], par->move.dst[2],
92  par->move.dst[3], par->move.dst[4], par->move.dst[5]);
93  av_bprintf(bp, ", .par.move.src = {%d, %d, %d, %d, %d, %d}",
94  par->move.src[0], par->move.src[1], par->move.src[2],
95  par->move.src[3], par->move.src[4], par->move.src[5]);
96  break;
97  case SWS_UOP_PACK:
98  case SWS_UOP_UNPACK:
99  av_bprintf(bp, ", .par.pack.pattern = {%d, %d, %d, %d}",
100  par->pack.pattern[0], par->pack.pattern[1],
101  par->pack.pattern[2], par->pack.pattern[3]);
102  break;
103  case SWS_UOP_CLEAR:
104  av_bprintf(bp, ", .par.clear.one = 0x%x, .par.clear.zero = 0x%x",
105  par->clear.one, par->clear.zero);
106  break;
107  case SWS_UOP_LINEAR:
108  case SWS_UOP_LINEAR_FMA:
109  av_bprintf(bp, ", .par.lin.one = 0x%x, .par.lin.zero = 0x%x",
110  par->lin.one, par->lin.zero);
111  if (uop->uop == SWS_UOP_LINEAR_FMA)
112  av_bprintf(bp, ", .par.lin.exact = 0x%x", par->lin.exact);
113  break;
114  case SWS_UOP_DITHER:
115  av_bprintf(bp, ", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
116  par->dither.y_offset[0], par->dither.y_offset[1],
117  par->dither.y_offset[2], par->dither.y_offset[3],
118  par->dither.size_log2);
119  break;
120  }
121 
122  av_bprintf(bp, ")");
123  return 0;
124 }
125 
126 static int generate_entry_args(void *opaque, void *key)
127 {
128  const SwsUOp *ref = opaque;
129  const SwsUOp *uop = key;
130  AVBPrint *bp = ref->data.opaque;
131  char name[SWS_UOP_NAME_MAX];
132  ff_sws_uop_name(uop, name);
133  av_bprintf(bp, " \\\n MACRO(__VA_ARGS__, %-40s, %-13s, %-24s, 0x%x",
134  name, pixel_types[uop->type].full, uop_names[uop->uop].full, uop->mask);
135 
136  const SwsUOpParams *par = &uop->par;
137  switch (uop->uop) {
141  av_bprintf(bp, ", %s", pixel_types[par->filter.type].full);
142  break;
143  case SWS_UOP_RW_SHUFFLE:
144  av_bprintf(bp, ", 0x%x, %u, %u", par->shuffle.clear_value,
145  par->shuffle.read_size, par->shuffle.write_size);
146  break;
147  case SWS_UOP_LSHIFT:
148  case SWS_UOP_RSHIFT:
149  av_bprintf(bp, ", %u", par->shift.amount);
150  break;
151  case SWS_UOP_PERMUTE:
152  case SWS_UOP_COPY:
153  av_bprintf(bp, ", %d", par->move.num_moves);
154  av_bprintf(bp, ", %d, %d, %d, %d, %d, %d",
155  par->move.dst[0], par->move.dst[1], par->move.dst[2],
156  par->move.dst[3], par->move.dst[4], par->move.dst[5]);
157  av_bprintf(bp, ", %d, %d, %d, %d, %d, %d",
158  par->move.src[0], par->move.src[1], par->move.src[2],
159  par->move.src[3], par->move.src[4], par->move.src[5]);
160  break;
161  case SWS_UOP_PACK:
162  case SWS_UOP_UNPACK:
163  av_bprintf(bp, ", %d, %d, %d, %d",
164  par->pack.pattern[0], par->pack.pattern[1],
165  par->pack.pattern[2], par->pack.pattern[3]);
166  break;
167  case SWS_UOP_CLEAR:
168  av_bprintf(bp, ", 0x%05x, 0x%05x", par->clear.one, par->clear.zero);
169  break;
170  case SWS_UOP_LINEAR:
171  case SWS_UOP_LINEAR_FMA:
172  av_bprintf(bp, ", 0x%05x, 0x%05x", par->lin.one, par->lin.zero);
173  if (uop->uop == SWS_UOP_LINEAR_FMA)
174  av_bprintf(bp, ", 0x%05x", par->lin.exact);
175  break;
176  case SWS_UOP_DITHER:
177  av_bprintf(bp, ", %u, %u, %u, %u, %u",
178  par->dither.y_offset[0], par->dither.y_offset[1],
179  par->dither.y_offset[2], par->dither.y_offset[3],
180  par->dither.size_log2);
181  break;
182  }
183 
184  av_bprintf(bp, ")");
185  return 0;
186 }
187 
188 static int register_uop(struct AVTreeNode **root, const SwsUOp *uop)
189 {
190  SwsUOp *key = av_memdup(uop, sizeof(*uop));
191  if (!key)
192  return AVERROR(ENOMEM);
193  memset(&key->data, 0, sizeof(key->data));
194 
195  struct AVTreeNode *node = av_tree_node_alloc();
196  if (!node) {
197  av_free(key);
198  return AVERROR(ENOMEM);
199  }
200 
201  av_tree_insert(root, key, ff_sws_uop_cmp_v, &node);
202  if (node) {
203  av_free(node);
204  av_free(key);
205  }
206  return 0;
207 }
208 
210 {
212  if (!uops)
213  return AVERROR(ENOMEM);
214 
215  int ret = ff_sws_ops_translate(ctx, ops, flags, uops);
216  if (ret < 0)
217  goto fail;
218 
219  struct AVTreeNode **root = ctx->opaque;
220  for (int i = 0; i < uops->num_ops; i++) {
221  ret = register_uop(root, &uops->ops[i]);
222  if (ret < 0)
223  goto fail;
224  }
225 
226 fail:
227  ff_sws_uop_list_free(&uops);
228  return ret;
229 }
230 
231 static const SwsUOpFlags uop_flags[] = {
232  0,
233  SWS_UOP_FLAG_PSHUFB | SWS_UOP_FLAG_FMA, /* x86 backend */
234 };
235 
236 static int register_uops(SwsContext *ctx, const SwsOpList *ops,
238 {
239  for (int i = 0; i < FF_ARRAY_ELEMS(uop_flags); i++) {
240  int ret = register_flags(ctx, ops, uop_flags[i]);
241  if (ret < 0)
242  return ret;
243  }
244 
245  *out = (SwsCompiledOp) {0}; /* dummy value, will be immediately freed */
246  return 0;
247 }
248 
249 /* Dummy backend that just registers all seen uops */
250 static const SwsOpBackend backend_uops = {
251  .name = "uops_gen",
252  .compile = register_uops,
253 };
254 
255 static int register_all_uops(SwsContext *ctx, void *graph, SwsOpList *ops)
256 {
257  /* ff_sws_compile_pass() takes over ownership of `ops` */
259  if (!copy)
260  return AVERROR(ENOMEM);
261 
263  return ff_sws_compile_pass(graph, &backend_uops, &copy, flags, NULL, NULL);
264 }
265 
266 static const SwsFlags flags_list[] = {
267  0,
268  SWS_ACCURATE_RND, /* may insert extra 1x1 dither ops (for accurate rounding) */
269  SWS_BITEXACT, /* prevents some FMA optimizations */
271 };
272 
273 /* Limit the range of av_tree_enumerate() to only matching uop and type */
274 static int enum_type(void *opaque, void *elem)
275 {
276  const SwsUOp *a = opaque, *b = elem;
277  if (a->type != b->type)
278  return (int) b->type - a->type;
279  if (a->uop != b->uop)
280  return (int) b->uop - a->uop;
281  return 0;
282 }
283 
284 static int free_uop_key(void *opaque, void *key)
285 {
286  av_free(key);
287  return 0;
288 }
289 
290 /**
291  * Generate a set of boilerplate C preprocessor macros for describing and
292  * programmatically iterating over all possible SwsUOps.
293  *
294  * This function can be quite slow as it iterates over every possible
295  * combination of pixel formats and flags.
296  *
297  * Returns 0 or a negative error code. On success, an allocated string is
298  * returned via `out_str`, and must be av_free()'d by the caller.
299  */
300 static int sws_uops_macros_gen(char **out_str)
301 {
302  int ret;
303  struct AVTreeNode *root = NULL;
304 
305  AVBPrint bprint, *const bp = &bprint;
307 
308  /* Allocate dummy graph and context for ff_sws_compile_pass() */
309  SwsGraph *graph = ff_sws_graph_alloc();
310  if (!graph)
311  return AVERROR(ENOMEM);
312 
313  SwsContext *ctx = graph->ctx = sws_alloc_context();
314  if (!ctx) {
315  ret = AVERROR(ENOMEM);
316  goto fail;
317  }
318 
319  /* Use this to plumb the tree state through all the layers of abstraction */
320  ctx->opaque = &root;
321  ctx->scaler = SWS_SCALE_BILINEAR; /* cheaper to generate filter kernels */
322 
323  /* Register all unique uops over every relevant combination of flags */
324  for (int i = 0; i < FF_ARRAY_ELEMS(flags_list); i++) {
325  ctx->flags = flags_list[i];
328  if (ret < 0)
329  goto fail;
330  }
331 
332  #define BPRINT_STR(str) av_bprint_append_data(bp, str, strlen(str))
333  BPRINT_STR(
334 "/**\n"
335 " * This file is automatically generated. Do not edit manually.\n"
336 " * To regenerate, run: make fate-sws-uops-macros GEN=1\n"
337 " */\n"
338 "\n"
339 "#ifndef SWSCALE_UOPS_MACROS_H\n"
340 "#define SWSCALE_UOPS_MACROS_H\n"
341 "\n"
342 "/**\n"
343 " * Boilerplate helper macros, for template-based backends. These will be\n"
344 " * instantiated like this, with parameters in struct order:\n"
345 " * MACRO(__VA_ARGS__, NAME, UOP, TYPE, MASK, [PARAMS,])\n"
346 " * The _STRUCT variants pass all arguments in C struct syntax, while the\n"
347 " * plain variants give them as separate C values (e.g. for use in calls)\n"
348 " */\n"
349 "#define SWS_GLUE3(x, y, z) x ## _ ## y ## _ ## z\n"
350 "#define SWS_FOR(TYPE, UOP, MACRO, ...) \\\n"
351 " SWS_GLUE3(SWS_FOR, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
352 "#define SWS_FOR_STRUCT(TYPE, UOP, MACRO, ...) \\\n"
353 " SWS_GLUE3(SWS_FOR_STRUCT, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
354 "\n");
355 
356  SwsUOp key = { .data.opaque = bp };
357  for (key.type = SWS_PIXEL_NONE + 1; key.type < SWS_PIXEL_TYPE_NB; key.type++) {
358  for (key.uop = SWS_UOP_INVALID + 1; key.uop < SWS_UOP_TYPE_NB; key.uop++) {
359  const char *macro = uop_names[key.uop].full + sizeof("SWS_UOP_") - 1;
360  const char *prefix = pixel_types[key.type].prefix;
361  av_bprintf(bp, "#define SWS_FOR_%s%s(MACRO, ...)", prefix, macro);
363  av_bprintf(bp, "\n");
364  av_bprintf(bp, "#define SWS_FOR_STRUCT_%s%s(MACRO, ...)", prefix, macro);
366  av_bprintf(bp, "\n");
367  }
368  }
369 
370  BPRINT_STR("\n#endif /* SWSCALE_UOPS_MACROS_H */");
371  ret = av_bprint_finalize(bp, out_str);
372 
373 fail:
376  av_tree_destroy(root);
377  ff_sws_graph_free(&graph);
379  return ret;
380 }
381 
382 int main(int argc, char **argv)
383 {
384 #ifdef _WIN32
385  _setmode(_fileno(stdout), _O_BINARY);
386 #endif
387 
388  char *macros = NULL;
389  int ret = sws_uops_macros_gen(&macros);
390  if (ret >= 0)
391  puts(macros);
392  av_free(macros);
393  return ret;
394 }
register_all_uops
static int register_all_uops(SwsContext *ctx, void *graph, SwsOpList *ops)
Definition: uops_macros_gen.c:255
SWS_UOP_RW_SHUFFLE
@ SWS_UOP_RW_SHUFFLE
Definition: uops.h:147
AV_BPRINT_SIZE_UNLIMITED
#define AV_BPRINT_SIZE_UNLIMITED
uop_flags
static const SwsUOpFlags uop_flags[]
Definition: uops_macros_gen.c:231
name
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
Definition: writing_filters.txt:88
SwsGraph::ctx
SwsContext * ctx
Definition: graph.h:123
AVERROR
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
SwsUOpParams::move
SwsMoveUOp move
Definition: uops.h:250
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:625
out
static FILE * out
Definition: movenc.c:55
av_bprint_init
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition: bprint.c:69
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
av_tree_insert
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
SWS_SCALE_BILINEAR
@ SWS_SCALE_BILINEAR
bilinear filtering
Definition: swscale.h:98
SwsClearUOp::zero
SwsCompMask zero
Definition: uops.h:218
enum_type
static int enum_type(void *opaque, void *elem)
Definition: uops_macros_gen.c:274
ops.h
AVTreeNode::elem
void * elem
Definition: tree.c:28
SWS_BITEXACT
@ SWS_BITEXACT
Definition: swscale.h:178
uops_list.h
b
#define b
Definition: input.c:43
SWS_UOP_LINEAR_FMA
@ SWS_UOP_LINEAR_FMA
Definition: uops.h:176
register_uop
static int register_uop(struct AVTreeNode **root, const SwsUOp *uop)
Definition: uops_macros_gen.c:188
ops_dispatch.h
av_tree_node_alloc
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
Definition: tree.c:34
SWS_UOP_LSHIFT
@ SWS_UOP_LSHIFT
Definition: uops.h:172
SwsLinearUOp::one
uint32_t one
Definition: uops.h:222
key
const char * key
Definition: ffmpeg_mux_init.c:2971
SWS_UOP_TYPE_NB
@ SWS_UOP_TYPE_NB
Definition: uops.h:180
SwsOpBackend::name
const char * name
Definition: ops_dispatch.h:135
SWS_UOP_NAME_MAX
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
Definition: uops.h:289
av_tree_enumerate
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
ff_sws_graph_alloc
SwsGraph * ff_sws_graph_alloc(void)
Allocate an empty SwsGraph.
Definition: graph.c:817
SwsMoveUOp::num_moves
int num_moves
Definition: uops.h:205
av_memdup
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
Definition: mem.c:302
BPRINT_STR
#define BPRINT_STR(str)
macros.h
SWS_UOP_PACK
@ SWS_UOP_PACK
Definition: uops.h:171
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
register_flags
static int register_flags(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags)
Definition: uops_macros_gen.c:209
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
pixel_types
static const struct @599 pixel_types[SWS_PIXEL_TYPE_NB]
register_uops
static int register_uops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
Definition: uops_macros_gen.c:236
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
backend_uops
static const SwsOpBackend backend_uops
Definition: uops_macros_gen.c:250
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:504
SwsShuffleUOp::write_size
uint8_t write_size
Definition: uops.h:186
SwsFlags
SwsFlags
Definition: swscale.h:131
ff_sws_enum_op_lists
static 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: op_list_gen_template.c:89
SwsUOp::uop
SwsUOpType uop
Definition: uops.h:260
SWS_UOP_FLAG_PSHUFB
@ SWS_UOP_FLAG_PSHUFB
Definition: uops.h:125
UOPS_LIST
#define UOPS_LIST(ENTRY)
This file is part of FFmpeg.
Definition: uops_list.h:23
AVFormatContext::flags
int flags
Flags modifying the (de)muxer behaviour.
Definition: avformat.h:1484
main
int main(int argc, char **argv)
Definition: uops_macros_gen.c:382
prefix
char prefix[8]
Definition: uops_macros_gen.c:49
sws_uops_macros_gen
static int sws_uops_macros_gen(char **out_str)
Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating ove...
Definition: uops_macros_gen.c:300
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
AVFormatContext::opaque
void * opaque
User data.
Definition: avformat.h:1897
SwsOpBackend
Definition: ops_dispatch.h:134
generate_entry_struct
static int generate_entry_struct(void *opaque, void *key)
Definition: uops_macros_gen.c:58
fail
#define fail
Definition: test.h:478
NULL
#define NULL
Definition: coverity.c:32
SWS_PIXEL_TYPE_NB
@ SWS_PIXEL_TYPE_NB
Definition: uops.h:44
SwsUOpParams::shift
SwsShiftUOp shift
Definition: uops.h:249
UOP_NAME
#define UOP_NAME(OP, ABBR)
abbr
char abbr[32]
Definition: uops_macros_gen.c:41
SwsShuffleUOp::read_size
uint8_t read_size
Definition: uops.h:185
SwsMoveUOp::dst
int8_t dst[SWS_UOP_MOVE_MAX]
Definition: uops.h:208
free_uop_key
static int free_uop_key(void *opaque, void *key)
Definition: uops_macros_gen.c:284
AVTreeNode
Definition: tree.c:26
SwsClearUOp::one
SwsCompMask one
Definition: uops.h:217
av_tree_destroy
void av_tree_destroy(AVTreeNode *t)
Definition: tree.c:146
SwsUOp::par
SwsUOpParams par
Definition: uops.h:262
error.h
uop_names
static const struct @598 uop_names[SWS_UOP_TYPE_NB]
This file is part of FFmpeg.
ff_sws_graph_free
void ff_sws_graph_free(SwsGraph **pgraph)
Uninitialize any state associate with this filter graph and free it.
Definition: graph.c:890
SwsUOp
Definition: uops.h:257
copy
static void copy(const float *p1, float *p2, const int length)
Definition: vf_vaguedenoiser.c:186
SWS_OP_FLAG_SPLIT_MEMCPY
@ SWS_OP_FLAG_SPLIT_MEMCPY
Definition: ops_dispatch.h:178
av_bprint_finalize
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition: bprint.c:235
sws_alloc_context
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
Definition: utils.c:1032
SWS_UOP_READ_PLANAR_FV_FMA
@ SWS_UOP_READ_PLANAR_FV_FMA
Definition: uops.h:135
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
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
SWS_UOP_UNPACK
@ SWS_UOP_UNPACK
Definition: uops.h:170
tree.h
SWS_PIXEL_U32
@ SWS_PIXEL_U32
Definition: uops.h:42
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
ff_sws_uop_list_alloc
SwsUOpList * ff_sws_uop_list_alloc(void)
Definition: uops.c:197
bprint.h
flags_list
static const SwsFlags flags_list[]
Definition: uops_macros_gen.c:266
SWS_PIXEL_U8
@ SWS_PIXEL_U8
Definition: uops.h:40
SWS_UOP_LINEAR
@ SWS_UOP_LINEAR
Definition: uops.h:175
SwsUOpParams::lin
SwsLinearUOp lin
Definition: uops.h:253
SwsPackUOp::pattern
uint8_t pattern[4]
Definition: uops.h:213
op_list_gen_template.c
SwsUOp::type
SwsPixelType type
Definition: uops.h:259
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
ret
ret
Definition: filter_design.txt:187
pixfmt.h
SwsUOpList::num_ops
int num_ops
Definition: uops.h:294
SwsCompiledOp
Definition: ops_dispatch.h:101
ff_sws_uop_list_free
void ff_sws_uop_list_free(SwsUOpList **p_ops)
Definition: uops.c:183
av_bprintf
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition: bprint.c:122
generate_entry_args
static int generate_entry_args(void *opaque, void *key)
Definition: uops_macros_gen.c:126
full
char full[32]
Definition: uops_macros_gen.c:40
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
SwsLinearUOp::exact
uint32_t exact
Definition: uops.h:226
ff_sws_uop_name
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
Definition: uops.c:81
SwsDitherUOp::y_offset
uint8_t y_offset[4]
Definition: uops.h:236
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:117
SwsUOpList
Definition: uops.h:292
ff_sws_compile_pass
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.
Definition: ops_dispatch.c:751
SWS_UOP_DITHER
@ SWS_UOP_DITHER
Definition: uops.h:177
SwsUOpParams::dither
SwsDitherUOp dither
Definition: uops.h:254
mem.h
SwsGraph
Filter graph, which represents a 'baked' pixel format conversion.
Definition: graph.h:122
SWS_PIXEL_F32
@ SWS_PIXEL_F32
Definition: uops.h:43
SWS_UOP_READ_PLANAR_FV
@ SWS_UOP_READ_PLANAR_FV
Definition: uops.h:134
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
uops.h
SwsUOpFlags
uint32_t SwsUOpFlags
Definition: uops.h:121
SWS_UOP_READ_PLANAR_FH
@ SWS_UOP_READ_PLANAR_FH
Definition: uops.h:133
sws_free_context
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
Definition: utils.c:2323
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_ACCURATE_RND
@ SWS_ACCURATE_RND
Force bit-exact output.
Definition: swscale.h:177
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
SWS_OP_FLAG_DRY_RUN
@ SWS_OP_FLAG_DRY_RUN
Definition: ops_dispatch.h:175
SwsUOpParams::clear
SwsClearUOp clear
Definition: uops.h:252
SwsUOpList::ops
SwsUOp * ops
Definition: uops.h:293
swscale.h
SwsUOpParams::shuffle
SwsShuffleUOp shuffle
Definition: uops.h:247