Go to the documentation of this file.
103 vfprintf(stdout, fmt, vl);
107 int main(
int argc,
char **argv)
113 bool macros_gen =
false;
117 _setmode(_fileno(stdout), _O_BINARY);
120 for (
int i = 1;
i < argc;
i++) {
121 if (!strcmp(argv[
i],
"-help") || !strcmp(argv[
i],
"--help")) {
123 "sws_ops [options...]\n"
127 " Only test the specified destination pixel format\n"
129 " Only test the specified source pixel format\n"
131 " Enable log verbosity at given level\n"
133 " Generate helper macros\n"
137 if (!strcmp(argv[
i],
"-src")) {
142 fprintf(stderr,
"invalid pixel format %s\n", argv[
i + 1]);
146 }
else if (!strcmp(argv[
i],
"-dst")) {
151 fprintf(stderr,
"invalid pixel format %s\n", argv[
i + 1]);
155 }
else if (!strcmp(argv[
i],
"-v")) {
160 }
else if (!strcmp(argv[
i],
"-macros")) {
164 fprintf(stderr,
"bad option or argument missing (%s) see -help\n", argv[
i]);
AVPixelFormat
Pixel format.
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.
@ SWS_SCALE_BILINEAR
bilinear filtering
int main(int argc, char **argv)
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
SwsGraph * ff_sws_graph_alloc(void)
Allocate an empty SwsGraph.
static int print_ops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
void ff_sws_op_list_print(void *log, int lev, int lev_extra, const SwsOpList *ops)
Print out the contents of an operation list.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static AVFormatContext * ctx
int av_log_get_level(void)
Get the current log level.
bool ff_sws_op_list_is_noop(const SwsOpList *ops)
Returns whether an op list represents a true no-op operation, i.e.
void ff_sws_graph_free(SwsGraph **pgraph)
Uninitialize any state associate with this filter graph and free it.
void av_log_set_callback(void(*callback)(void *, int, const char *, va_list))
Set the logging callback.
static void copy(const float *p1, float *p2, const int length)
@ SWS_OP_FLAG_SPLIT_MEMCPY
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
#define i(width, name, range_min, range_max)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static void log_stdout(void *avcl, int level, const char *fmt, va_list vl)
int ff_sws_uops_macros_gen(char **out_str)
Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating ove...
#define AV_LOG_INFO
Standard information.
SwsUOpList * ff_sws_uop_list_alloc(void)
void av_log_set_level(int level)
Set the log level.
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 ...
static const SwsOpBackend backend_print
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)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
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.
void av_log_default_callback(void *ptr, int level, const char *fmt, va_list vl)
Default logging callback.
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.
static int print_passes(SwsContext *ctx, void *graph, SwsOpList *ops)
Helper struct for representing a list of operations.
Main external API structure.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.