Go to the documentation of this file.
45 bool has_filters =
false;
105 for (
int i = 0;
i < 4;
i++) {
106 for (
int j = 0; j < 5; j++)
115 for (
int i = 0;
i < 4;
i++)
119 for (
int i = 0;
i < 4;
i++)
124 for (
int i = 0;
i < 4;
i++)
125 op->dither.y_offset[
i] =
op->dither.y_offset[
i] >= 0 ? 0 : -1;
162 vfprintf(stdout, fmt, vl);
166 int main(
int argc,
char **argv)
170 bool summarize =
false;
174 _setmode(_fileno(stdout), _O_BINARY);
177 for (
int i = 1;
i < argc;
i++) {
178 if (!strcmp(argv[
i],
"-help") || !strcmp(argv[
i],
"--help")) {
180 "sws_ops [options...]\n"
184 " Only test the specified destination pixel format\n"
186 " Only test the specified source pixel format\n"
188 " Enable log verbosity at given level\n"
190 " Summarize operation types, instead of printing op lists\n"
194 if (!strcmp(argv[
i],
"-src")) {
199 fprintf(stderr,
"invalid pixel format %s\n", argv[
i + 1]);
203 }
else if (!strcmp(argv[
i],
"-dst")) {
208 fprintf(stderr,
"invalid pixel format %s\n", argv[
i + 1]);
212 }
else if (!strcmp(argv[
i],
"-v")) {
217 }
else if (!strcmp(argv[
i],
"-summarize")) {
221 fprintf(stderr,
"bad option or argument missing (%s) see -help\n", argv[
i]);
static void error(const char *err)
int ff_sws_enum_ops(SwsContext *ctx, void *opaque, enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt, int(*cb)(SwsContext *ctx, void *opaque, SwsOp *op))
Helper function to enumerate over all possible operations, under the current set of options in ctx,...
AVPixelFormat
Pixel format.
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)
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
int main(int argc, char **argv)
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
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 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_BPRINT_SIZE_AUTOMATIC
#define SWS_COMP_TEST(mask, X)
static int print_and_free_summary(void *opaque, void *key)
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 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.
Rational number (pair of numerator and denominator).
void av_tree_destroy(AVTreeNode *t)
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)
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.
#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
static void log_stdout(void *avcl, int level, const char *fmt, va_list vl)
void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op)
Describe an operation in human-readable form.
#define AV_LOG_INFO
Standard information.
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
static int print_ops(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
static int cmp_str(const void *a, const void *b)
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.
static int register_op(SwsContext *ctx, void *opaque, SwsOp *op)
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.