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
200 /* Use at most two full vregs during the widest precision section */
201 int block_size = (ff_sws_op_list_max_size(ops) == 4) ? 8 : 16;
202
203 for (int i = 0; i < ops->num_ops; i++) {
205 ret = convert_to_aarch64_impl(ctx, ops, i, block_size, &params);
206 if (ret == AVERROR(ENOTSUP))
207 continue;
208 if (ret < 0)
209 goto end;
210 ret = aarch64_collect_op(&params, root);
211 if (ret < 0)
212 goto end;
213 if (params.uop == SWS_UOP_LINEAR_FMA) {
214 /**
215 * Generate both sets of linear op functions that do use
216 * and do not use fmla (selected by SWS_BITEXACT).
217 */
219 ret = aarch64_collect_op(&params, root);
220 if (ret < 0)
221 goto end;
222 }
223 }
224
225 *out = (SwsCompiledOp) { 0 };
226 ret = 0;
227
228end:
229 return ret;
230}
231
233 .name = "collect_ops",
234 .compile = collect_ops_compile,
235};
236
237/*********************************************************************/
238static int register_op(SwsContext *ctx, void *opaque, SwsOpList *ops)
239{
240 /* Skip ops lists which include filtering, since this is still not
241 * supported. */
242 for (int i = 0; i < ops->num_ops; i++) {
243 const SwsOp *op = &ops->ops[i];
244 switch (op->op) {
245 case SWS_OP_READ:
246 case SWS_OP_WRITE:
247 if (op->rw.filter.op)
248 return 0;
249 break;
250 case SWS_OP_FILTER_H:
251 case SWS_OP_FILTER_V:
252 return 0;
253 }
254 }
255
256 /* ff_sws_compile_pass() takes over ownership of `ops` */
258 if (!copy)
259 return AVERROR(ENOMEM);
260
263}
264
265/*********************************************************************/
266static const char op_type_names[SWS_UOP_TYPE_NB][16] = {
267 [SWS_UOP_READ_BIT ] = "read_bit",
268 [SWS_UOP_READ_NIBBLE ] = "read_nibble",
269 [SWS_UOP_READ_PACKED ] = "read_packed",
270 [SWS_UOP_READ_PLANAR ] = "read_planar",
271 [SWS_UOP_WRITE_BIT ] = "write_bit",
272 [SWS_UOP_WRITE_NIBBLE ] = "write_nibble",
273 [SWS_UOP_WRITE_PACKED ] = "write_packed",
274 [SWS_UOP_WRITE_PLANAR ] = "write_planar",
275 [SWS_UOP_SWAP_BYTES ] = "swap_bytes",
276 [SWS_UOP_PERMUTE ] = "permute",
277 [SWS_UOP_COPY ] = "copy",
278 [SWS_UOP_UNPACK ] = "unpack",
279 [SWS_UOP_PACK ] = "pack",
280 [SWS_UOP_LSHIFT ] = "lshift",
281 [SWS_UOP_RSHIFT ] = "rshift",
282 [SWS_UOP_CLEAR ] = "clear",
283 [SWS_UOP_TO_U8 ] = "to_u8",
284 [SWS_UOP_TO_U16 ] = "to_u16",
285 [SWS_UOP_TO_U32 ] = "to_u32",
286 [SWS_UOP_TO_F32 ] = "to_f32",
287 [SWS_UOP_EXPAND_PAIR ] = "expand_pair",
288 [SWS_UOP_EXPAND_QUAD ] = "expand_quad",
289 [SWS_UOP_MIN ] = "min",
290 [SWS_UOP_MAX ] = "max",
291 [SWS_UOP_SCALE ] = "scale",
292 [SWS_UOP_LINEAR ] = "linear",
293 [SWS_UOP_LINEAR_FMA ] = "linear_fma",
294 [SWS_UOP_DITHER ] = "dither",
295};
296
297static const char pixel_type_names[SWS_PIXEL_TYPE_NB][4] = {
298 [SWS_PIXEL_U8 ] = "u8",
299 [SWS_PIXEL_U16] = "u16",
300 [SWS_PIXEL_U32] = "u32",
301 [SWS_PIXEL_F32] = "f32",
302};
303
304static const char uop_types[SWS_UOP_TYPE_NB][32] = {
305 [SWS_UOP_READ_BIT ] = "SWS_UOP_READ_BIT",
306 [SWS_UOP_READ_NIBBLE ] = "SWS_UOP_READ_NIBBLE",
307 [SWS_UOP_READ_PACKED ] = "SWS_UOP_READ_PACKED",
308 [SWS_UOP_READ_PLANAR ] = "SWS_UOP_READ_PLANAR",
309 [SWS_UOP_WRITE_BIT ] = "SWS_UOP_WRITE_BIT",
310 [SWS_UOP_WRITE_NIBBLE ] = "SWS_UOP_WRITE_NIBBLE",
311 [SWS_UOP_WRITE_PACKED ] = "SWS_UOP_WRITE_PACKED",
312 [SWS_UOP_WRITE_PLANAR ] = "SWS_UOP_WRITE_PLANAR",
313 [SWS_UOP_SWAP_BYTES ] = "SWS_UOP_SWAP_BYTES",
314 [SWS_UOP_PERMUTE ] = "SWS_UOP_PERMUTE",
315 [SWS_UOP_COPY ] = "SWS_UOP_COPY",
316 [SWS_UOP_UNPACK ] = "SWS_UOP_UNPACK",
317 [SWS_UOP_PACK ] = "SWS_UOP_PACK",
318 [SWS_UOP_LSHIFT ] = "SWS_UOP_LSHIFT",
319 [SWS_UOP_RSHIFT ] = "SWS_UOP_RSHIFT",
320 [SWS_UOP_CLEAR ] = "SWS_UOP_CLEAR",
321 [SWS_UOP_TO_U8 ] = "SWS_UOP_TO_U8",
322 [SWS_UOP_TO_U16 ] = "SWS_UOP_TO_U16",
323 [SWS_UOP_TO_U32 ] = "SWS_UOP_TO_U32",
324 [SWS_UOP_TO_F32 ] = "SWS_UOP_TO_F32",
325 [SWS_UOP_EXPAND_PAIR ] = "SWS_UOP_EXPAND_PAIR",
326 [SWS_UOP_EXPAND_QUAD ] = "SWS_UOP_EXPAND_QUAD",
327 [SWS_UOP_MIN ] = "SWS_UOP_MIN",
328 [SWS_UOP_MAX ] = "SWS_UOP_MAX",
329 [SWS_UOP_SCALE ] = "SWS_UOP_SCALE",
330 [SWS_UOP_LINEAR ] = "SWS_UOP_LINEAR",
331 [SWS_UOP_LINEAR_FMA ] = "SWS_UOP_LINEAR_FMA",
332 [SWS_UOP_DITHER ] = "SWS_UOP_DITHER",
333};
334
335static const char pixel_types[SWS_PIXEL_TYPE_NB][32] = {
336 [SWS_PIXEL_U8 ] = "SWS_PIXEL_U8",
337 [SWS_PIXEL_U16] = "SWS_PIXEL_U16",
338 [SWS_PIXEL_U32] = "SWS_PIXEL_U32",
339 [SWS_PIXEL_F32] = "SWS_PIXEL_F32",
340};
341
342static void serialize_op(AVBPrint *bp, const SwsAArch64OpImplParams *params)
343{
344#define FUNC_NAME_WIDTH 45
345#define UOP_NAME_WIDTH 21
346#define TYPE_NAME_WIDTH 14
347
348 const SwsUOpParams *par = &params->par;
349
350 char func_name[FUNC_NAME_WIDTH + 2];
351 snprintf(func_name, sizeof(func_name), "ff_sws_%s", op_type_names[params->uop]);
352 switch (params->uop) {
353 case SWS_UOP_PERMUTE:
354 case SWS_UOP_COPY:
355 av_strlcatf(func_name, sizeof(func_name), "_%012" PRIx64, move_to_mask(&par->move));
356 break;
357 case SWS_UOP_UNPACK:
358 case SWS_UOP_PACK:
359 av_strlcatf(func_name, sizeof(func_name), "_%04x", pack_to_mask(&par->pack));
360 break;
361 case SWS_UOP_LSHIFT:
362 case SWS_UOP_RSHIFT:
363 av_strlcatf(func_name, sizeof(func_name), "_%u", par->shift.amount);
364 break;
365 case SWS_UOP_CLEAR:
366 av_strlcatf(func_name, sizeof(func_name), "_%04x", clear_to_mask(&par->clear));
367 break;
368 case SWS_UOP_LINEAR:
370 av_strlcatf(func_name, sizeof(func_name), "_%010" PRIx64, linear_to_mask(&par->lin));
371 break;
372 case SWS_UOP_DITHER:
373 av_strlcatf(func_name, sizeof(func_name), "_%04x_%u", dither_to_mask(params, &par->dither), par->dither.size_log2);
374 break;
375 }
376 av_strlcatf(func_name, sizeof(func_name), "_%u_%s_%04x_neon,",
377 params->block_size, pixel_type_names[params->type], nibble_mask(params->mask));
378
379 char uop_name[UOP_NAME_WIDTH + 2];
380 snprintf(uop_name, sizeof(uop_name), "%s,", uop_types[params->uop]);
381
382 char type_name[TYPE_NAME_WIDTH + 2];
383 snprintf(type_name, sizeof(type_name), "%s,", pixel_types[params->type]);
384
385 av_bprintf(bp, "ENTRY(%-*s { .uop = %-*s .block_size = %2u, .type = %-*s .mask = 0x%x",
386 FUNC_NAME_WIDTH, func_name, UOP_NAME_WIDTH, uop_name,
387 params->block_size, TYPE_NAME_WIDTH, type_name, params->mask);
388 switch (params->uop) {
389 case SWS_UOP_PERMUTE:
390 case SWS_UOP_COPY:
391 av_bprintf(bp, ", .par.move = { .num_moves = %d, .dst = {%d, %d, %d, %d, %d, %d}, .src = {%d, %d, %d, %d, %d, %d} }",
392 par->move.num_moves,
393 par->move.dst[0], par->move.dst[1], par->move.dst[2],
394 par->move.dst[3], par->move.dst[4], par->move.dst[5],
395 par->move.src[0], par->move.src[1], par->move.src[2],
396 par->move.src[3], par->move.src[4], par->move.src[5]);
397 break;
398 case SWS_UOP_UNPACK:
399 case SWS_UOP_PACK:
400 av_bprintf(bp, ", .par.pack = { .pattern = {%d, %d, %d, %d} }",
401 par->pack.pattern[0], par->pack.pattern[1],
402 par->pack.pattern[2], par->pack.pattern[3]);
403 break;
404 case SWS_UOP_LSHIFT:
405 case SWS_UOP_RSHIFT:
406 av_bprintf(bp, ", .par.shift = { .amount = %u }", par->shift.amount);
407 break;
408 case SWS_UOP_CLEAR:
409 av_bprintf(bp, ", .par.clear = { .one = 0x%0x, .zero = 0x%0x }", par->clear.one, par->clear.zero);
410 break;
411 case SWS_UOP_LINEAR:
413 av_bprintf(bp, ", .par.lin = { .one = 0x%x, .zero = 0x%x }", par->lin.one, par->lin.zero);
414 break;
415 case SWS_UOP_DITHER:
416 av_bprintf(bp, ", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
417 par->dither.y_offset[0], par->dither.y_offset[1],
418 par->dither.y_offset[2], par->dither.y_offset[3],
419 par->dither.size_log2);
420 break;
421 }
422 av_bprintf(bp, " })");
423}
424
425/* Serialize SwsAArch64OpImplParams for one function. */
426static int print_op(void *opaque, void *elem)
427{
429 FILE *fp = (FILE *) opaque;
430
431 AVBPrint bp;
433 serialize_op(&bp, params);
434 fprintf(fp, "%s\n", bp.str);
436
438
439 return 0;
440}
441
442/*********************************************************************/
443int main(int argc, char *argv[])
444{
445 struct AVTreeNode *root = NULL;
446 int ret = 1;
447
448#ifdef _WIN32
449 _setmode(_fileno(stdout), _O_BINARY);
450#endif
451
453 if (!ctx)
454 goto fail;
455
456 SwsGraph *graph = ff_sws_graph_alloc();
457 if (!graph)
458 goto fail;
459
460 graph->ctx = ctx;
461 ctx->opaque = &root;
462
465
466 /**
467 * Generate a C file with all the unique function parameter entries
468 * collected by aarch64_enum_ops().
469 */
470 printf("/*\n");
471 printf(" * This file is automatically generated. Do not edit manually.\n");
472 printf(" * To regenerate, run: make fate-sws-ops-entries-aarch64 GEN=1\n");
473 printf(" */\n");
474 printf("\n");
475 av_tree_enumerate(root, stdout, NULL, print_op);
476
477 ff_sws_graph_free(&graph);
478
479fail:
480 av_tree_destroy(root);
482 return ret;
483}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
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: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 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: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
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.
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 ...
int ff_sws_op_list_max_size(const SwsOpList *ops)
Returns the size of the largest pixel type used in ops.
Definition ops.c:791
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
Definition ops.c:673
@ 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 int convert_to_aarch64_impl(SwsContext *ctx, const SwsOpList *ops, int n, int block_size, SwsAArch64OpImplParams *out)
Convert SwsOp to a SwsAArch64OpImplParams.
@ 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
#define snprintf
Definition snprintf.h:34
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: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
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
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
SwsOp * ops
Definition ops.h:294
int num_ops
Definition ops.h:295
Definition ops.h:237
uint8_t pattern[4]
Definition uops.h:215
uint8_t amount
Definition uops.h:201
#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:256
SwsClearUOp clear
Definition uops.h:258
SwsDitherUOp dither
Definition uops.h:260
SwsLinearUOp lin
Definition uops.h:259
SwsShiftUOp shift
Definition uops.h:255
SwsPackUOp pack
Definition uops.h:257
@ 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_U8
Definition uops.h:41
#define SWS_COMP(X)
Definition uops.h:97
#define SWS_MASK(I, J)
Definition uops.h:231
@ SWS_UOP_TO_U8
Definition uops.h:159
@ SWS_UOP_PACK
Definition uops.h:172
@ SWS_UOP_PERMUTE
Definition uops.h:151
@ SWS_UOP_EXPAND_QUAD
Definition uops.h:158
@ SWS_UOP_READ_PLANAR
Definition uops.h:133
@ SWS_UOP_WRITE_PLANAR
Definition uops.h:142
@ SWS_UOP_READ_NIBBLE
Definition uops.h:138
@ SWS_UOP_MAX
Definition uops.h:168
@ SWS_UOP_READ_BIT
Definition uops.h:139
@ SWS_UOP_SWAP_BYTES
Definition uops.h:155
@ SWS_UOP_MIN
Definition uops.h:167
@ SWS_UOP_LINEAR
Definition uops.h:176
@ SWS_UOP_RSHIFT
Definition uops.h:174
@ SWS_UOP_COPY
Definition uops.h:152
@ SWS_UOP_WRITE_NIBBLE
Definition uops.h:144
@ SWS_UOP_LINEAR_FMA
Definition uops.h:177
@ SWS_UOP_SCALE
Definition uops.h:165
@ SWS_UOP_WRITE_PACKED
Definition uops.h:143
@ SWS_UOP_WRITE_BIT
Definition uops.h:145
@ SWS_UOP_READ_PACKED
Definition uops.h:137
@ SWS_UOP_EXPAND_PAIR
Definition uops.h:157
@ SWS_UOP_TO_U16
Definition uops.h:160
@ SWS_UOP_DITHER
Definition uops.h:178
@ SWS_UOP_TYPE_NB
Definition uops.h:182
@ SWS_UOP_CLEAR
Definition uops.h:175
@ SWS_UOP_TO_U32
Definition uops.h:161
@ SWS_UOP_UNPACK
Definition uops.h:171
@ SWS_UOP_TO_F32
Definition uops.h:162
@ SWS_UOP_LSHIFT
Definition uops.h:173
static const uint16_t dither[8][8]
Definition vf_gradfun.c:46
static void copy(const float *p1, float *p2, const int length)