45#define ENTRY(fname, ...) extern void fname(void);
53#define ENTRY(fname, ...) { .func = fname, .params = __VA_ARGS__ },
77 float *coeffs =
av_malloc(num_vregs * 4 *
sizeof(
float));
86 for (
int i = 0;
i < 4;
i++) {
87 for (
int j = 0; j < 5; j++) {
88 const int jj = (j == 0) ? 4 : (j - 1);
90 coeffs[i_coeff++] = (
float)
op->lin.m[
i][jj].num /
op->lin.m[
i][jj].den;
123 const int size = 1 <<
op->dither.size_log2;
124 const int8_t *off =
op->dither.y_offset;
126 for (
int i = 0;
i < 4;
i++) {
128 max_offset =
FFMAX(max_offset, off[
i] & (
size - 1));
133 const int num_rows =
size + max_offset;
139 matrix[
i] = (
float)
op->dither.matrix[
i].num /
op->dither.matrix[
i].den;
157 if (
op->rw.frac == 3) {
160 -7, -6, -5, -4, -3, -2, -1, 0,
161 -7, -6, -5, -4, -3, -2, -1, 0,
168 if (
op->rw.frac == 3) {
171 7, 6, 5, 4, 3, 2, 1, 0,
172 7, 6, 5, 4, 3, 2, 1, 0,
217 .block_size = block_size,
241 void ff_sws_process_0001_neon(
void);
242 void ff_sws_process_0011_neon(
void);
243 void ff_sws_process_0111_neon(
void);
244 void ff_sws_process_1111_neon(
void);
251 switch (
FFMAX(read_planes, write_planes)) {
252 case 1: process_func = (
SwsOpFunc) ff_sws_process_0001_neon;
break;
253 case 2: process_func = (
SwsOpFunc) ff_sws_process_0011_neon;
break;
254 case 3: process_func = (
SwsOpFunc) ff_sws_process_0111_neon;
break;
255 case 4: process_func = (
SwsOpFunc) ff_sws_process_1111_neon;
break;
258 out->func = process_func;
static int aarch64_setup_dither(const SwsAArch64OpImplParams *p, const SwsOp *op, SwsImplResult *res)
static int aarch64_setup_linear(const SwsAArch64OpImplParams *p, const SwsOp *op, SwsImplResult *res)
static int aarch64_compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
static const struct @070174075374214234277303002223103136214276265127 ops_entries[]
SwsAArch64OpImplParams params
const SwsOpBackend backend_aarch64
static int aarch64_setup(const SwsOpList *ops, int block_size, int n, const SwsAArch64OpImplParams *p, SwsImplResult *out)
static SwsFuncPtr aarch64_lookup(const SwsAArch64OpImplParams *p)
static AVFormatContext * ctx
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static uint32_t BS_FUNC read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.
#define i(width, name, range_min, range_max)
@ SWS_BACKEND_AARCH64
Chained AArch64 NEON kernels.
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.
int(* func)(AVBPrint *dst, const char *in, const char *arg)
static atomic_int cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
int ff_sws_op_list_max_size(const SwsOpList *ops)
Returns the size of the largest pixel type used in ops.
const SwsOp * ff_sws_op_list_input(const SwsOpList *ops)
Returns the input operation for a given op list, or NULL if there is none (e.g.
int ff_sws_rw_op_planes(const SwsOp *op)
Return the number of planes involved in a read/write operation.
const SwsOp * ff_sws_op_list_output(const SwsOpList *ops)
Returns the output operation for a given op list, or NULL if there is none.
int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func, void(*free)(SwsOpPriv *), const SwsOpPriv *priv)
SwsOpChain * ff_sws_op_chain_alloc(void)
Copyright (C) 2025 Niklas Haas.
void ff_sws_op_chain_free_cb(void *ptr)
static void ff_sws_op_chain_free(SwsOpChain *chain)
void(* SwsFuncPtr)(void)
Per-kernel execution context.
int ff_sws_setup_clamp(const SwsImplParams *params, SwsImplResult *out)
int ff_sws_setup_scale(const SwsImplParams *params, SwsImplResult *out)
static void ff_op_priv_free(SwsOpPriv *priv)
int ff_sws_setup_clear(const SwsImplParams *params, SwsImplResult *out)
void(* SwsOpFunc)(const SwsOpExec *exec, const void *priv, int bx_start, int y_start, int bx_end, int y_end)
Process a given range of pixel blocks.
static int linear_num_vregs(const SwsAArch64OpImplParams *params)
#define offsetof_exec_out_bump
#define offsetof_exec_in
These values will be used by ops_asmgen to access fields inside of SwsOpExec and SwsOpImpl.
#define offsetof_exec_out
#define offsetof_exec_in_bump
#define offsetof_impl_priv
#define offsetof_impl_cont
static int convert_to_aarch64_impl(SwsContext *ctx, const SwsOpList *ops, int n, int block_size, SwsAArch64OpImplParams *out)
Convert SwsOp to a SwsAArch64OpImplParams.
#define FF_ARRAY_ELEMS(a)
SwsAArch64OpImplParams describes the parameters for an SwsUOpType operation.
Main external API structure.
void(* free)(SwsOpPriv *priv)
Compiled "chain" of operations, which can be dispatched efficiently.
void(* free[SWS_MAX_OPS+1])(SwsOpPriv *)
Copyright (C) 2026 Niklas Haas.
Helper struct for representing a list of operations.
static void error(const char *err)
Private data for each kernel.