FFmpeg
Loading...
Searching...
No Matches
ops_impl_conv.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/**
22 * NOTE: This file is #include'd directly by both the NEON backend and
23 * the sws_ops_aarch64 tool.
24 */
25
26#include "libavutil/error.h"
27
28#include "ops_impl.h"
29
30/**
31 * Convert SwsUOp to a SwsAArch64OpImplParams. Read the comments regarding
32 * SwsAArch64OpImplParams in ops_impl.h for more information.
33 */
34static void convert_to_aarch64_impl(const SwsUOp *uop, int block_size,
36{
37 out->uop = uop->uop;
38 out->mask = uop->mask;
39 out->type = uop->type;
40 out->block_size = block_size;
41 out->par = uop->par;
42
43 /**
44 * Deduplicate params to prevent identical CPS functions from being
45 * instantiated multiple times under different names.
46 */
47 switch (out->uop) {
48 case SWS_UOP_PERMUTE:
49 case SWS_UOP_COPY: {
50 /* Recompute mask taking identity swizzle into account */
51 out->mask = 0;
52 for (int i = 0; i < out->par.move.num_moves; i++) {
53 int dst = out->par.move.dst[i];
54 if (dst >= 0)
55 out->mask |= SWS_COMP(dst);
56 }
57
58 /* The element size and type don't matter. */
59 out->block_size = block_size * ff_sws_pixel_type_size(out->type);
60 out->type = SWS_PIXEL_U8;
61 break;
62 }
64 /* par.lin.exact is currently unused by asmgen_op_linear(). */
65 out->par.lin.exact = 0;
66 break;
67 default:
68 break;
69 }
70}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:97
static FILE * out
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
error code definitions
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.
SwsAArch64OpImplParams describes the parameters for an SwsUOpType operation.
Definition ops_impl.h:47
Definition uops.h:292
SwsCompMask mask
Definition uops.h:296
SwsUOpType uop
Definition uops.h:295
SwsUOpParams par
Definition uops.h:297
SwsPixelType type
Definition uops.h:294
@ SWS_PIXEL_U8
Definition uops.h:42
#define SWS_COMP(X)
Definition uops.h:122
@ SWS_UOP_PERMUTE
Definition uops.h:179
@ SWS_UOP_COPY
Definition uops.h:180
@ SWS_UOP_LINEAR_FMA
Definition uops.h:205
static av_const int ff_sws_pixel_type_size(SwsPixelType type)
Definition uops.h:51