44#define UOP_NAME(OP, ABBR) [OP] = { #OP, ABBR },
63 AVBPrint *bp =
ref->data.opaque;
67 av_bprintf(bp,
", .type = %-13s, .uop = %-24s, .mask = 0x%x",
78 av_bprintf(bp,
", .par.shuffle.clear_value = 0x%x"
79 ", .par.shuffle.read_size = %u"
80 ", .par.shuffle.write_size = %u",
91 av_bprintf(bp,
", .par.move.dst = {%d, %d, %d, %d, %d, %d}",
94 av_bprintf(bp,
", .par.move.src = {%d, %d, %d, %d, %d, %d}",
100 av_bprintf(bp,
", .par.pack.pattern = {%d, %d, %d, %d}",
105 av_bprintf(bp,
", .par.clear.one = 0x%x, .par.clear.zero = 0x%x",
110 av_bprintf(bp,
", .par.lin.one = 0x%x, .par.lin.zero = 0x%x",
116 av_bprintf(bp,
", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
134 AVBPrint *bp =
ref->data.opaque;
137 av_bprintf(bp,
" \\\n MACRO(__VA_ARGS__, %-40s, %-13s, %-24s, 0x%x",
205 memset(&
key->data, 0,
sizeof(
key->data));
290 if (
a->type !=
b->type)
291 return (
int)
b->type -
a->type;
292 if (
a->uop !=
b->uop)
293 return (
int)
b->uop -
a->uop;
321 AVBPrint bprint, *
const bp = &bprint;
327 if (!graph || !
ctx) {
364 #define BPRINT_STR(str) av_bprint_append_data(bp, str, strlen(str))
367" * This file is automatically generated. Do not edit manually.\n"
368" * To regenerate, run: make fate-sws-uops-macros GEN=1\n"
371"#ifndef SWSCALE_UOPS_MACROS_H\n"
372"#define SWSCALE_UOPS_MACROS_H\n"
375" * Boilerplate helper macros, for template-based backends. These will be\n"
376" * instantiated like this, with parameters in struct order:\n"
377" * MACRO(__VA_ARGS__, NAME, UOP, TYPE, MASK, [PARAMS,])\n"
378" * The _STRUCT variants pass all arguments in C struct syntax, while the\n"
379" * plain variants give them as separate C values (e.g. for use in calls)\n"
381"#define SWS_GLUE3(x, y, z) x ## _ ## y ## _ ## z\n"
382"#define SWS_FOR(TYPE, UOP, MACRO, ...) \\\n"
383" SWS_GLUE3(SWS_FOR, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
384"#define SWS_FOR_STRUCT(TYPE, UOP, MACRO, ...) \\\n"
385" SWS_GLUE3(SWS_FOR_STRUCT, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
391 const char *macro =
uop_names[
key.uop].full +
sizeof(
"SWS_UOP_") - 1;
402 BPRINT_STR(
"\n#endif /* SWSCALE_UOPS_MACROS_H */");
419 _setmode(_fileno(stdout), _O_BINARY);
static AVFormatContext * ctx
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)
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.
@ SWS_SCALE_BILINEAR
bilinear filtering
@ SWS_ACCURATE_RND
Force bit-exact output.
static int ff_mutex_unlock(AVMutex *mutex)
static int ff_mutex_lock(AVMutex *mutex)
static int ff_mutex_destroy(AVMutex *mutex)
static int ff_mutex_init(AVMutex *mutex, const void *attr)
SwsLut3D * ff_sws_lut3d_alloc(void)
Allocates a refstruct.
Utility Preprocessor macros.
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 ...
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
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
#define FF_ARRAY_ELEMS(a)
Main external API structure.
Filter graph, which represents a 'baked' pixel format conversion.
Append a set of operations for applying a gamut/tone mapping 3D LUT to the pixels.
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 pixel_types[SWS_PIXEL_TYPE_NB][32]
static int ref[MAX_W *MAX_W]
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...
#define UOP_NAME(OP, ABBR)
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
SwsUOpList * ff_sws_uop_list_alloc(void)
void ff_sws_uop_list_free(SwsUOpList **p_ops)
static const struct @145311200363243152256244361015041277337174162300 uop_names[SWS_UOP_TYPE_NB]
@ SWS_UOP_READ_PLANAR_FV_FMA
static int ff_sws_uop_cmp_v(const void *a, const void *b)
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
#define UOPS_LIST(ENTRY)
This file is part of FFmpeg.
static const SwsOpBackend backend_uops
static const SwsFlags flags_list[]
static int register_uops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
static int register_uop(struct EnumPriv *s, const SwsUOp *uop)
static const SwsUOpFlags uop_flags[]
static int register_flags(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags)
static int register_all_uops(SwsContext *ctx, void *graph, SwsOpList *ops)
static int free_uop_key(void *opaque, void *key)
static int sws_uops_macros_gen(char **out_str)
Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating ove...
static int enum_type(void *opaque, void *elem)
static int generate_entry_struct(void *opaque, void *key)
static int generate_entry_args(void *opaque, void *key)
static void copy(const float *p1, float *p2, const int length)