FFmpeg
Loading...
Searching...
No Matches
sws_ops_aarch64.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 Ramiro Polla
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#include <stdio.h>
22
23#include "libavutil/avassert.h"
24#include "libavutil/bprint.h"
25#include "libavutil/mem.h"
26#include "libavutil/tree.h"
27#include "libswscale/graph.h"
28#include "libswscale/ops.h"
32
34
35#ifdef _WIN32
36#include <io.h>
37#include <fcntl.h>
38#endif
39
40/*********************************************************************/
41static uint16_t clear_to_mask(const SwsClearUOp *clear)
42{
43 uint16_t mask = 0;
44 for (int i = 0; i < 4; i++) {
45 if (clear->zero & SWS_COMP(i)) {
46 /* no-op */
47 } else if (clear->one & SWS_COMP(i)) {
48 NIBBLE_SET(mask, i, 1);
49 } else {
50 NIBBLE_SET(mask, i, 0xf);
51 }
52 }
53 return mask;
54}
55
56static uint64_t move_to_mask(const SwsMoveUOp *move)
57{
58 uint64_t mask = 0;
59 for (int i = 0; i < move->num_moves; i++) {
60 uint8_t dst = move->dst[i] < 0 ? 0xf : move->dst[i];
61 uint8_t src = move->src[i] < 0 ? 0xf : move->src[i];
62 uint64_t pair = src | (dst << 4);
63 mask |= pair << (i * 8);
64 }
65 return mask;
66}
67
68static uint16_t pack_to_mask(const SwsPackUOp *pack)
69{
70 uint16_t mask = 0;
71 for (int i = 0; i < 4; i++)
72 NIBBLE_SET(mask, i, pack->pattern[i]);
73 return mask;
74}
75
76static uint64_t linear_to_mask(const SwsLinearUOp *linear)
77{
78 uint64_t mask = 0;
79 for (int i = 0; i < 4; i++) {
80 for (int j = 0; j < 5; j++) {
81 int jj = (j == 0) ? 4 : (j - 1);
82 if (linear->one & SWS_MASK(i, jj))
83 mask |= 1ULL << (2 * ((5 * i + j)));
84 else if (!(linear->zero & SWS_MASK(i, jj)))
85 mask |= 3ULL << (2 * ((5 * i + j)));
86 }
87 }
88 return mask;
89}
90
92{
93 uint16_t mask = 0;
94 for (int i = 0; i < 4; i++) {
95 if (p->mask & SWS_COMP(i)) {
96 NIBBLE_SET(mask, i, dither->y_offset[i]);
97 } else {
98 NIBBLE_SET(mask, i, 0xf);
99 }
100 }
101 return mask;
102}
103
104static int aarch64_op_impl_cmp(const void *a, const void *b)
105{
106 const SwsAArch64OpImplParams *pa = (const SwsAArch64OpImplParams *) a;
107 const SwsAArch64OpImplParams *pb = (const SwsAArch64OpImplParams *) b;
108 const SwsUOpParams *para = &pa->par;
109 const SwsUOpParams *parb = &pb->par;
110
111 if (pa->uop != pb->uop)
112 return (int) pa->uop - pb->uop;
113
114 switch (pa->uop) {
115 case SWS_UOP_PERMUTE:
116 case SWS_UOP_COPY: {
117 uint64_t ia = move_to_mask(&para->move);
118 uint64_t ib = move_to_mask(&parb->move);
119 if (ia != ib)
120 return (int64_t) (ia - ib) < 0 ? -1 : 1;
121 break;
122 }
123 case SWS_UOP_UNPACK:
124 case SWS_UOP_PACK: {
125 uint16_t ia = pack_to_mask(&para->pack);
126 uint16_t ib = pack_to_mask(&parb->pack);
127 if (ia != ib)
128 return (int) ia - ib;
129 break;
130 }
131 case SWS_UOP_LSHIFT:
132 case SWS_UOP_RSHIFT:
133 if (para->shift.amount != parb->shift.amount)
134 return (int) para->shift.amount - parb->shift.amount;
135 break;
136 case SWS_UOP_CLEAR: {
137 uint16_t ia = clear_to_mask(&para->clear);
138 uint16_t ib = clear_to_mask(&parb->clear);
139 if (ia != ib)
140 return (int) ia - ib;
141 break;
142 }
143 case SWS_UOP_LINEAR:
144 case SWS_UOP_LINEAR_FMA: {
145 uint64_t ia = linear_to_mask(&para->lin);
146 uint64_t ib = linear_to_mask(&parb->lin);
147 if (ia != ib)
148 return (int64_t) (ia - ib) < 0 ? -1 : 1;
149 break;
150 }
151 case SWS_UOP_DITHER: {
152 uint16_t ia = dither_to_mask(pa, &para->dither);
153 uint16_t ib = dither_to_mask(pb, &parb->dither);
154 if (ia != ib)
155 return (int) ia - ib;
156 if (para->dither.size_log2 != parb->dither.size_log2)
157 return (int) para->dither.size_log2 - parb->dither.size_log2;
158 break;
159 }
160 }
161
162 if (pa->block_size != pb->block_size)
163 return (int) pa->block_size - pb->block_size;
164 if (pa->type != pb->type)
165 return (int) pa->type - pb->type;
166 if (pa->mask != pb->mask)
167 return (int) pa->mask - pb->mask;
168
169 return 0;
170}
171
172/*********************************************************************/
173/* Insert the SwsAArch64OpImplParams structure into the AVTreeNode. */
175{
176 int ret = 0;
177
178 struct AVTreeNode *node = av_tree_node_alloc();
180 if (!node || !copy) {
181 ret = AVERROR(ENOMEM);
182 goto error;
183 }
185 if (!node)
186 copy = NULL;
187
188error:
189 av_free(node);
190 av_free(copy);
191 return ret;
192}
193
196{
197 struct AVTreeNode **root = (struct AVTreeNode **) ctx->opaque;
198 int ret;
199
201 if (!uops)
202 return AVERROR(ENOMEM);
203
204 const SwsUOpFlags flags = (ctx->flags & SWS_BITEXACT) ? 0 : SWS_UOP_FLAG_FMA;
205 ret = ff_sws_ops_translate(ctx, ops, flags, uops);
206 if (ret == AVERROR(ENOTSUP)) {
207 ret = 0;
208 goto end;
209 }
210 if (ret < 0)
211 goto end;
212
213 /* Use at most two full vregs during the widest precision section */
214 int block_size = (uops->pixel_size_max == 4) ? 8 : 16;
215
216 for (int i = 0; i < uops->num_ops; i++) {
218 convert_to_aarch64_impl(&uops->ops[i], block_size, &params);
220 if (ret < 0)
221 goto end;
222 if (params.uop == SWS_UOP_LINEAR_FMA && params.type == SWS_PIXEL_F32) {
223 /**
224 * Generate both sets of linear op functions that do use
225 * and do not use fmla (selected by SWS_BITEXACT).
226 */
229 if (ret < 0)
230 goto end;
231 }
232 }
233
234 *out = (SwsCompiledOp) { 0 };
235 ret = 0;
236
237end:
239 return ret;
240}
241
243 .name = "collect_ops",
244 .compile = collect_ops_compile,
245};
246
247/*********************************************************************/
248static int register_op(SwsContext *ctx, void *opaque, SwsOpList *ops)
249{
250 /* Skip ops lists which include filtering, since this is still not
251 * supported. */
252 for (int i = 0; i < ops->num_ops; i++) {
253 const SwsOp *op = &ops->ops[i];
254 switch (op->op) {
255 case SWS_OP_READ:
256 case SWS_OP_WRITE:
257 if (op->rw.filter.op)
258 return 0;
259 break;
260 case SWS_OP_FILTER_H:
261 case SWS_OP_FILTER_V:
262 return 0;
263 }
264 }
265
266 /* ff_sws_compile_pass() takes over ownership of `ops` */
268 if (!copy)
269 return AVERROR(ENOMEM);
270
273}
274
275/*********************************************************************/
276static const char op_type_names[SWS_UOP_TYPE_NB][16] = {
277 [SWS_UOP_READ_BIT ] = "read_bit",
278 [SWS_UOP_READ_NIBBLE ] = "read_nibble",
279 [SWS_UOP_READ_PACKED ] = "read_packed",
280 [SWS_UOP_READ_PLANAR ] = "read_planar",
281 [SWS_UOP_WRITE_BIT ] = "write_bit",
282 [SWS_UOP_WRITE_NIBBLE ] = "write_nibble",
283 [SWS_UOP_WRITE_PACKED ] = "write_packed",
284 [SWS_UOP_WRITE_PLANAR ] = "write_planar",
285 [SWS_UOP_SWAP_BYTES ] = "swap_bytes",
286 [SWS_UOP_PERMUTE ] = "permute",
287 [SWS_UOP_COPY ] = "copy",
288 [SWS_UOP_UNPACK ] = "unpack",
289 [SWS_UOP_PACK ] = "pack",
290 [SWS_UOP_LSHIFT ] = "lshift",
291 [SWS_UOP_RSHIFT ] = "rshift",
292 [SWS_UOP_CLEAR ] = "clear",
293 [SWS_UOP_TO_U8 ] = "to_u8",
294 [SWS_UOP_TO_U16 ] = "to_u16",
295 [SWS_UOP_TO_U32 ] = "to_u32",
296 [SWS_UOP_TO_F32 ] = "to_f32",
297 [SWS_UOP_EXPAND_PAIR ] = "expand_pair",
298 [SWS_UOP_EXPAND_QUAD ] = "expand_quad",
299 [SWS_UOP_MIN ] = "min",
300 [SWS_UOP_MAX ] = "max",
301 [SWS_UOP_SCALE ] = "scale",
302 [SWS_UOP_LINEAR ] = "linear",
303 [SWS_UOP_LINEAR_FMA ] = "linear_fma",
304 [SWS_UOP_DITHER ] = "dither",
305};
306
307static const char pixel_type_names[SWS_PIXEL_TYPE_NB][4] = {
308 [SWS_PIXEL_U8 ] = "u8",
309 [SWS_PIXEL_U16] = "u16",
310 [SWS_PIXEL_U32] = "u32",
311 [SWS_PIXEL_F32] = "f32",
312};
313
314static const char uop_types[SWS_UOP_TYPE_NB][32] = {
315 [SWS_UOP_READ_BIT ] = "SWS_UOP_READ_BIT",
316 [SWS_UOP_READ_NIBBLE ] = "SWS_UOP_READ_NIBBLE",
317 [SWS_UOP_READ_PACKED ] = "SWS_UOP_READ_PACKED",
318 [SWS_UOP_READ_PLANAR ] = "SWS_UOP_READ_PLANAR",
319 [SWS_UOP_WRITE_BIT ] = "SWS_UOP_WRITE_BIT",
320 [SWS_UOP_WRITE_NIBBLE ] = "SWS_UOP_WRITE_NIBBLE",
321 [SWS_UOP_WRITE_PACKED ] = "SWS_UOP_WRITE_PACKED",
322 [SWS_UOP_WRITE_PLANAR ] = "SWS_UOP_WRITE_PLANAR",
323 [SWS_UOP_SWAP_BYTES ] = "SWS_UOP_SWAP_BYTES",
324 [SWS_UOP_PERMUTE ] = "SWS_UOP_PERMUTE",
325 [SWS_UOP_COPY ] = "SWS_UOP_COPY",
326 [SWS_UOP_UNPACK ] = "SWS_UOP_UNPACK",
327 [SWS_UOP_PACK ] = "SWS_UOP_PACK",
328 [SWS_UOP_LSHIFT ] = "SWS_UOP_LSHIFT",
329 [SWS_UOP_RSHIFT ] = "SWS_UOP_RSHIFT",
330 [SWS_UOP_CLEAR ] = "SWS_UOP_CLEAR",
331 [SWS_UOP_TO_U8 ] = "SWS_UOP_TO_U8",
332 [SWS_UOP_TO_U16 ] = "SWS_UOP_TO_U16",
333 [SWS_UOP_TO_U32 ] = "SWS_UOP_TO_U32",
334 [SWS_UOP_TO_F32 ] = "SWS_UOP_TO_F32",
335 [SWS_UOP_EXPAND_PAIR ] = "SWS_UOP_EXPAND_PAIR",
336 [SWS_UOP_EXPAND_QUAD ] = "SWS_UOP_EXPAND_QUAD",
337 [SWS_UOP_MIN ] = "SWS_UOP_MIN",
338 [SWS_UOP_MAX ] = "SWS_UOP_MAX",
339 [SWS_UOP_SCALE ] = "SWS_UOP_SCALE",
340 [SWS_UOP_LINEAR ] = "SWS_UOP_LINEAR",
341 [SWS_UOP_LINEAR_FMA ] = "SWS_UOP_LINEAR_FMA",
342 [SWS_UOP_DITHER ] = "SWS_UOP_DITHER",
343};
344
345static const char pixel_types[SWS_PIXEL_TYPE_NB][32] = {
346 [SWS_PIXEL_U8 ] = "SWS_PIXEL_U8",
347 [SWS_PIXEL_U16] = "SWS_PIXEL_U16",
348 [SWS_PIXEL_U32] = "SWS_PIXEL_U32",
349 [SWS_PIXEL_F32] = "SWS_PIXEL_F32",
350};
351
352static void serialize_op(AVBPrint *bp, const SwsAArch64OpImplParams *params)
353{
354#define FUNC_NAME_WIDTH 45
355#define UOP_NAME_WIDTH 21
356#define TYPE_NAME_WIDTH 14
357
358 const SwsUOpParams *par = &params->par;
359
360 char func_name[FUNC_NAME_WIDTH + 2];
361 snprintf(func_name, sizeof(func_name), "ff_sws_%s", op_type_names[params->uop]);
362 switch (params->uop) {
363 case SWS_UOP_PERMUTE:
364 case SWS_UOP_COPY:
365 av_strlcatf(func_name, sizeof(func_name), "_%012" PRIx64, move_to_mask(&par->move));
366 break;
367 case SWS_UOP_UNPACK:
368 case SWS_UOP_PACK:
369 av_strlcatf(func_name, sizeof(func_name), "_%04x", pack_to_mask(&par->pack));
370 break;
371 case SWS_UOP_LSHIFT:
372 case SWS_UOP_RSHIFT:
373 av_strlcatf(func_name, sizeof(func_name), "_%u", par->shift.amount);
374 break;
375 case SWS_UOP_CLEAR:
376 av_strlcatf(func_name, sizeof(func_name), "_%04x", clear_to_mask(&par->clear));
377 break;
378 case SWS_UOP_LINEAR:
380 av_strlcatf(func_name, sizeof(func_name), "_%010" PRIx64, linear_to_mask(&par->lin));
381 break;
382 case SWS_UOP_DITHER:
383 av_strlcatf(func_name, sizeof(func_name), "_%04x_%u", dither_to_mask(params, &par->dither), par->dither.size_log2);
384 break;
385 }
386 av_strlcatf(func_name, sizeof(func_name), "_%u_%s_%04x_neon,",
387 params->block_size, pixel_type_names[params->type], nibble_mask(params->mask));
388
389 char uop_name[UOP_NAME_WIDTH + 2];
390 snprintf(uop_name, sizeof(uop_name), "%s,", uop_types[params->uop]);
391
392 char type_name[TYPE_NAME_WIDTH + 2];
393 snprintf(type_name, sizeof(type_name), "%s,", pixel_types[params->type]);
394
395 av_bprintf(bp, "ENTRY(%-*s { .uop = %-*s .block_size = %2u, .type = %-*s .mask = 0x%x",
396 FUNC_NAME_WIDTH, func_name, UOP_NAME_WIDTH, uop_name,
397 params->block_size, TYPE_NAME_WIDTH, type_name, params->mask);
398 switch (params->uop) {
399 case SWS_UOP_PERMUTE:
400 case SWS_UOP_COPY:
401 av_bprintf(bp, ", .par.move = { .num_moves = %d, .dst = {%d, %d, %d, %d, %d, %d}, .src = {%d, %d, %d, %d, %d, %d} }",
402 par->move.num_moves,
403 par->move.dst[0], par->move.dst[1], par->move.dst[2],
404 par->move.dst[3], par->move.dst[4], par->move.dst[5],
405 par->move.src[0], par->move.src[1], par->move.src[2],
406 par->move.src[3], par->move.src[4], par->move.src[5]);
407 break;
408 case SWS_UOP_UNPACK:
409 case SWS_UOP_PACK:
410 av_bprintf(bp, ", .par.pack = { .pattern = {%d, %d, %d, %d} }",
411 par->pack.pattern[0], par->pack.pattern[1],
412 par->pack.pattern[2], par->pack.pattern[3]);
413 break;
414 case SWS_UOP_LSHIFT:
415 case SWS_UOP_RSHIFT:
416 av_bprintf(bp, ", .par.shift = { .amount = %u }", par->shift.amount);
417 break;
418 case SWS_UOP_CLEAR:
419 av_bprintf(bp, ", .par.clear = { .one = 0x%0x, .zero = 0x%0x }", par->clear.one, par->clear.zero);
420 break;
421 case SWS_UOP_LINEAR:
423 av_bprintf(bp, ", .par.lin = { .one = 0x%x, .zero = 0x%x }", par->lin.one, par->lin.zero);
424 break;
425 case SWS_UOP_DITHER:
426 av_bprintf(bp, ", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
427 par->dither.y_offset[0], par->dither.y_offset[1],
428 par->dither.y_offset[2], par->dither.y_offset[3],
429 par->dither.size_log2);
430 break;
431 }
432 av_bprintf(bp, " })");
433}
434
435/* Serialize SwsAArch64OpImplParams for one function. */
436static int print_op(void *opaque, void *elem)
437{
439 FILE *fp = (FILE *) opaque;
440
441 AVBPrint bp;
443 serialize_op(&bp, params);
444 fprintf(fp, "%s\n", bp.str);
446
448
449 return 0;
450}
451
452/*********************************************************************/
453int main(int argc, char *argv[])
454{
455 struct AVTreeNode *root = NULL;
456 int ret = 1;
457
458#ifdef _WIN32
459 _setmode(_fileno(stdout), _O_BINARY);
460#endif
461
463 if (!ctx)
464 goto fail;
465
466 SwsGraph *graph = ff_sws_graph_alloc();
467 if (!graph)
468 goto fail;
469
470 graph->ctx = ctx;
471 ctx->opaque = &root;
472
475
476 /**
477 * Generate a C file with all the unique function parameter entries
478 * collected by aarch64_enum_ops().
479 */
480 printf("/*\n");
481 printf(" * This file is automatically generated. Do not edit manually.\n");
482 printf(" * To regenerate, run: make fate-sws-ops-entries-aarch64 GEN=1\n");
483 printf(" */\n");
484 printf("\n");
486
487 ff_sws_graph_free(&graph);
488
489fail:
492 return ret;
493}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:97
SwsAArch64OpImplParams params
Definition ops.c:51
static FILE * out
static AVFormatContext * ctx
simple assert() macros that are a bit more flexible than ISO C assert().
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
Definition avstring.c:103
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition bprint.c:121
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition bprint.c:68
AVBPrint public header.
#define AV_BPRINT_SIZE_UNLIMITED
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define ib(width, name)
Definition cbs_h264.c:65
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
__device__ int printf(const char *,...)
int main
Definition dovi_rpuenc.c:38
SwsGraph * ff_sws_graph_alloc(void)
Allocate an empty SwsGraph.
Definition graph.c:872
void ff_sws_graph_free(SwsGraph **pgraph)
Uninitialize any state associate with this filter graph and free it.
Definition graph.c:948
#define fail
Definition test.h:479
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition bprint.c:234
#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:408
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:1051
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
Definition utils.c:2374
@ SWS_BITEXACT
Definition swscale.h:178
int a
#define b
Definition input.c:43
static int linear(InterplayACMContext *s, unsigned ind, unsigned col)
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
static const uint16_t mask[17]
Definition lzw.c:38
Memory handling functions.
char * root
Definition mscl.c:248
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:668
@ SWS_OP_FILTER_V
Definition ops.h:64
@ SWS_OP_FILTER_H
Definition ops.h:63
@ SWS_OP_WRITE
Definition ops.h:41
@ SWS_OP_READ
Definition ops.h:40
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
static uint16_t nibble_mask(SwsCompMask mask)
Definition ops_impl.h:34
#define NIBBLE_SET(mask, idx, val)
Definition ops_impl.h:32
static void convert_to_aarch64_impl(const SwsUOp *uop, int block_size, SwsAArch64OpImplParams *out)
NOTE: This file is #include'd directly by both the NEON backend and the sws_ops_aarch64 tool.
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
static void print_op(const RasmContext *rctx, AVBPrint *bp, const int *local_labels, RasmOp op)
Definition rasm_print.c:227
void * elem
Definition tree.c:28
SwsAArch64OpImplParams describes the parameters for an SwsUOpType operation.
Definition ops_impl.h:47
SwsUOpParams par
Definition ops_impl.h:52
SwsPixelType type
Definition ops_impl.h:50
SwsCompMask one
Definition uops.h:247
SwsCompMask zero
Definition uops.h:248
Main external API structure.
Definition swscale.h:227
uint8_t size_log2
Definition uops.h:267
uint8_t y_offset[4]
Definition uops.h:266
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:253
uint32_t one
Definition uops.h:252
int8_t src[SWS_UOP_MOVE_MAX]
Definition uops.h:239
int num_moves
Definition uops.h:235
int8_t dst[SWS_UOP_MOVE_MAX]
Definition uops.h:238
Helper struct for representing a list of operations.
Definition ops.h:297
SwsOp * ops
Definition ops.h:298
int num_ops
Definition ops.h:299
Definition ops.h:241
uint8_t pattern[4]
Definition uops.h:243
uint8_t amount
Definition uops.h:229
SwsUOp * ops
Definition uops.h:329
int pixel_size_max
Definition uops.h:335
int num_ops
Definition uops.h:330
#define TYPE_NAME_WIDTH
static const char uop_types[SWS_UOP_TYPE_NB][32]
static int aarch64_collect_op(const SwsAArch64OpImplParams *params, struct AVTreeNode **root)
static const char pixel_type_names[SWS_PIXEL_TYPE_NB][4]
static int print_op(void *opaque, void *elem)
static int register_op(SwsContext *ctx, void *opaque, SwsOpList *ops)
static void serialize_op(AVBPrint *bp, const SwsAArch64OpImplParams *params)
static const char op_type_names[SWS_UOP_TYPE_NB][16]
static int aarch64_op_impl_cmp(const void *a, const void *b)
static uint16_t pack_to_mask(const SwsPackUOp *pack)
static uint64_t move_to_mask(const SwsMoveUOp *move)
#define UOP_NAME_WIDTH
static const char pixel_types[SWS_PIXEL_TYPE_NB][32]
static const SwsOpBackend backend_collect
static uint64_t linear_to_mask(const SwsLinearUOp *linear)
static uint16_t dither_to_mask(const SwsAArch64OpImplParams *p, const SwsDitherUOp *dither)
static int collect_ops_compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
static uint16_t clear_to_mask(const SwsClearUOp *clear)
#define FUNC_NAME_WIDTH
#define av_free(p)
static void error(const char *err)
#define src
Definition vp8dsp.c:248
A tree container.
SwsMoveUOp move
Definition uops.h:284
SwsClearUOp clear
Definition uops.h:286
SwsDitherUOp dither
Definition uops.h:288
SwsLinearUOp lin
Definition uops.h:287
SwsShiftUOp shift
Definition uops.h:283
SwsPackUOp pack
Definition uops.h:285
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:618
SwsUOpList * ff_sws_uop_list_alloc(void)
Definition uops.c:174
void ff_sws_uop_list_free(SwsUOpList **p_ops)
Definition uops.c:160
uint32_t SwsUOpFlags
Definition uops.h:147
@ SWS_PIXEL_F32
Definition uops.h:45
@ SWS_PIXEL_U32
Definition uops.h:44
@ SWS_PIXEL_U16
Definition uops.h:43
@ SWS_PIXEL_TYPE_NB
Definition uops.h:46
@ SWS_PIXEL_U8
Definition uops.h:42
#define SWS_COMP(X)
Definition uops.h:122
#define SWS_MASK(I, J)
Definition uops.h:259
@ SWS_UOP_TO_U8
Definition uops.h:187
@ SWS_UOP_PACK
Definition uops.h:200
@ SWS_UOP_PERMUTE
Definition uops.h:179
@ SWS_UOP_EXPAND_QUAD
Definition uops.h:186
@ SWS_UOP_READ_PLANAR
Definition uops.h:161
@ SWS_UOP_WRITE_PLANAR
Definition uops.h:170
@ SWS_UOP_READ_NIBBLE
Definition uops.h:166
@ SWS_UOP_MAX
Definition uops.h:196
@ SWS_UOP_READ_BIT
Definition uops.h:167
@ SWS_UOP_SWAP_BYTES
Definition uops.h:183
@ SWS_UOP_MIN
Definition uops.h:195
@ SWS_UOP_LINEAR
Definition uops.h:204
@ SWS_UOP_RSHIFT
Definition uops.h:202
@ SWS_UOP_COPY
Definition uops.h:180
@ SWS_UOP_WRITE_NIBBLE
Definition uops.h:172
@ SWS_UOP_LINEAR_FMA
Definition uops.h:205
@ SWS_UOP_SCALE
Definition uops.h:193
@ SWS_UOP_WRITE_PACKED
Definition uops.h:171
@ SWS_UOP_WRITE_BIT
Definition uops.h:173
@ SWS_UOP_READ_PACKED
Definition uops.h:165
@ SWS_UOP_EXPAND_PAIR
Definition uops.h:185
@ SWS_UOP_TO_U16
Definition uops.h:188
@ SWS_UOP_DITHER
Definition uops.h:206
@ SWS_UOP_TYPE_NB
Definition uops.h:210
@ SWS_UOP_CLEAR
Definition uops.h:203
@ SWS_UOP_TO_U32
Definition uops.h:189
@ SWS_UOP_UNPACK
Definition uops.h:199
@ SWS_UOP_TO_F32
Definition uops.h:190
@ SWS_UOP_LSHIFT
Definition uops.h:201
@ SWS_UOP_FLAG_FMA
Definition uops.h:150
static const uint16_t dither[8][8]
Definition vf_gradfun.c:46
static void copy(const float *p1, float *p2, const int length)