Go to the documentation of this file.
43 #define UOP_NAME(OP, ABBR) [OP] = { #OP, ABBR },
62 AVBPrint *bp =
ref->data.opaque;
66 av_bprintf(bp,
", .type = %-13s, .uop = %-24s, .mask = 0x%x",
82 av_bprintf(bp,
", .par.swizzle.in = {%d, %d, %d, %d}",
88 av_bprintf(bp,
", .par.move.dst = {%d, %d, %d, %d, %d, %d}",
91 av_bprintf(bp,
", .par.move.src = {%d, %d, %d, %d, %d, %d}",
97 av_bprintf(bp,
", .par.pack.pattern = {%d, %d, %d, %d}",
102 av_bprintf(bp,
", .par.clear.one = 0x%x, .par.clear.zero = 0x%x",
107 av_bprintf(bp,
", .par.lin.one = 0x%x, .par.lin.zero = 0x%x",
113 av_bprintf(bp,
", .par.dither = { .y_offset = {%u, %u, %u, %u}, .size_log2 = %u }",
128 AVBPrint *bp =
ref->data.opaque;
131 av_bprintf(bp,
" \\\n MACRO(__VA_ARGS__, %-40s, %-13s, %-24s, 0x%x",
192 memset(&
key->data, 0,
sizeof(
key->data));
276 if (
a->type !=
b->type)
277 return (
int)
b->type -
a->type;
278 if (
a->uop !=
b->uop)
279 return (
int)
b->uop -
a->uop;
304 AVBPrint bprint, *
const bp = &bprint;
339 for (
int elems = 1; elems <= 4; elems++) {
340 for (
int rw = 0; rw < 2; rw++) {
354 #define BPRINT_STR(str) av_bprint_append_data(bp, str, strlen(str))
357 " * This file is automatically generated. Do not edit manually.\n"
358 " * To regenerate, run: make fate-sws-uops-macros GEN=1\n"
361 "#ifndef SWSCALE_UOPS_MACROS_H\n"
362 "#define SWSCALE_UOPS_MACROS_H\n"
365 " * Boilerplate helper macros, for template-based backends. These will be\n"
366 " * instantiated like this, with parameters in struct order:\n"
367 " * MACRO(__VA_ARGS__, NAME, UOP, TYPE, MASK, [PARAMS,])\n"
368 " * The _STRUCT variants pass all arguments in C struct syntax, while the\n"
369 " * plain variants give them as separate C values (e.g. for use in calls)\n"
371 "#define SWS_GLUE3(x, y, z) x ## _ ## y ## _ ## z\n"
372 "#define SWS_FOR(TYPE, UOP, MACRO, ...) \\\n"
373 " SWS_GLUE3(SWS_FOR, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
374 "#define SWS_FOR_STRUCT(TYPE, UOP, MACRO, ...) \\\n"
375 " SWS_GLUE3(SWS_FOR_STRUCT, TYPE, UOP)(MACRO, __VA_ARGS__)\n"
381 const char *macro =
uop_names[
key.uop].full +
sizeof(
"SWS_UOP_") - 1;
392 BPRINT_STR(
"\n#endif /* SWSCALE_UOPS_MACROS_H */");
404 int main(
int argc,
char **argv)
407 _setmode(_fileno(stdout), _O_BINARY);
static int register_all_uops(SwsContext *ctx, void *graph, SwsOpList *ops)
#define AV_BPRINT_SIZE_UNLIMITED
static const SwsUOpFlags uop_flags[]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
SwsOpList * ff_sws_op_list_duplicate(const SwsOpList *ops)
Returns a duplicate of ops, or NULL on OOM.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
static int ff_sws_uop_cmp_v(const void *a, const void *b)
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
@ SWS_SCALE_BILINEAR
bilinear filtering
static int enum_type(void *opaque, void *elem)
static int register_uop(struct AVTreeNode **root, const SwsUOp *uop)
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
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.
SwsGraph * ff_sws_graph_alloc(void)
Allocate an empty SwsGraph.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
bool ff_sws_pixel_type_is_int(SwsPixelType type)
static int register_flags(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define SWS_COMP_ELEMS(N)
static int register_uops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
#define FF_ARRAY_ELEMS(a)
static const SwsOpBackend backend_uops
static int ff_sws_enum_op_lists(SwsContext *ctx, void *opaque, 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 ...
#define UOPS_LIST(ENTRY)
This file is part of FFmpeg.
int flags
Flags modifying the (de)muxer behaviour.
static const struct @591 pixel_types[SWS_PIXEL_TYPE_NB]
int main(int argc, char **argv)
static int sws_uops_macros_gen(char **out_str)
Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating ove...
static AVFormatContext * ctx
static int generate_entry_struct(void *opaque, void *key)
#define UOP_NAME(OP, ABBR)
int8_t dst[SWS_UOP_MOVE_MAX]
static int free_uop_key(void *opaque, void *key)
static const struct @590 uop_names[SWS_UOP_TYPE_NB]
This file is part of FFmpeg.
void av_tree_destroy(AVTreeNode *t)
void ff_sws_graph_free(SwsGraph **pgraph)
Uninitialize any state associate with this filter graph and free it.
static void copy(const float *p1, float *p2, const int length)
@ SWS_OP_FLAG_SPLIT_MEMCPY
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
@ SWS_UOP_READ_PLANAR_FV_FMA
#define i(width, name, range_min, range_max)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
SwsUOpList * ff_sws_uop_list_alloc(void)
static const SwsFlags flags_list[]
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...
void ff_sws_uop_list_free(SwsUOpList **p_ops)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
static int generate_entry_args(void *opaque, void *key)
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
static int ref[MAX_W *MAX_W]
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.
Filter graph, which represents a 'baked' pixel format conversion.
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
int8_t src[SWS_UOP_MOVE_MAX]
@ SWS_ACCURATE_RND
Force bit-exact output.
Helper struct for representing a list of operations.
Main external API structure.