44 for (
int i = 0;
i < 4;
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);
71 for (
int i = 0;
i < 4;
i++)
79 for (
int i = 0;
i < 4;
i++) {
80 for (
int j = 0; j < 5; j++) {
81 int jj = (j == 0) ? 4 : (j - 1);
83 mask |= 1ULL << (2 * ((5 *
i + j)));
85 mask |= 3ULL << (2 * ((5 *
i + j)));
94 for (
int i = 0;
i < 4;
i++) {
112 return (
int) pa->
uop - pb->
uop;
128 return (
int) ia -
ib;
140 return (
int) ia -
ib;
155 return (
int) ia -
ib;
180 if (!node || !
copy) {
233 .name =
"collect_ops",
247 if (
op->rw.filter.op)
344#define FUNC_NAME_WIDTH 45
345#define UOP_NAME_WIDTH 21
346#define TYPE_NAME_WIDTH 14
376 av_strlcatf(func_name,
sizeof(func_name),
"_%u_%s_%04x_neon,",
385 av_bprintf(bp,
"ENTRY(%-*s { .uop = %-*s .block_size = %2u, .type = %-*s .mask = 0x%x",
391 av_bprintf(bp,
", .par.move = { .num_moves = %d, .dst = {%d, %d, %d, %d, %d, %d}, .src = {%d, %d, %d, %d, %d, %d} }",
400 av_bprintf(bp,
", .par.pack = { .pattern = {%d, %d, %d, %d} }",
416 av_bprintf(bp,
", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
429 FILE *fp = (FILE *) opaque;
434 fprintf(fp,
"%s\n", bp.str);
443int main(
int argc,
char *argv[])
449 _setmode(_fileno(stdout), _O_BINARY);
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");
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
SwsAArch64OpImplParams params
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,...)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AV_BPRINT_SIZE_UNLIMITED
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
SwsGraph * ff_sws_graph_alloc(void)
Allocate an empty SwsGraph.
void ff_sws_graph_free(SwsGraph **pgraph)
Uninitialize any state associate with this filter graph and free it.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
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.
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
void av_tree_destroy(AVTreeNode *t)
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
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.
static const uint16_t mask[17]
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.
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
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_SPLIT_MEMCPY
static uint16_t nibble_mask(SwsCompMask mask)
#define NIBBLE_SET(mask, idx, val)
static int convert_to_aarch64_impl(SwsContext *ctx, const SwsOpList *ops, int n, int block_size, SwsAArch64OpImplParams *out)
Convert SwsOp to a SwsAArch64OpImplParams.
static void print_op(const RasmContext *rctx, AVBPrint *bp, const int *local_labels, RasmOp op)
SwsAArch64OpImplParams describes the parameters for an SwsUOpType operation.
Main external API structure.
Filter graph, which represents a 'baked' pixel format conversion.
int8_t src[SWS_UOP_MOVE_MAX]
int8_t dst[SWS_UOP_MOVE_MAX]
Helper struct for representing a list of operations.
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)
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)
static void error(const char *err)
static const uint16_t dither[8][8]
static void copy(const float *p1, float *p2, const int length)