Go to the documentation of this file.
53 static const bool unused[4] = {
false,
false,
false,
false };
63 for (
int i = 0;
i < 4;
i++) {
64 for (
int j = 0; j < 5; j++)
72 for (
int i = 0;
i < 4;
i++)
77 for (
int i = 0;
i < 4;
i++)
78 op->dither.y_offset[
i] =
op->dither.y_offset[
i] >= 0 ? 0 : -1;
115 vfprintf(stdout, fmt, vl);
119 int main(
int argc,
char **argv)
123 bool summarize =
false;
127 _setmode(_fileno(stdout), _O_BINARY);
130 for (
int i = 1;
i < argc;
i++) {
131 if (!strcmp(argv[
i],
"-help") || !strcmp(argv[
i],
"--help")) {
133 "sws_ops [options...]\n"
137 " Only test the specified destination pixel format\n"
139 " Only test the specified source pixel format\n"
141 " Enable log verbosity at given level\n"
143 " Summarize operation types, instead of printing op lists\n"
147 if (!strcmp(argv[
i],
"-src")) {
152 fprintf(stderr,
"invalid pixel format %s\n", argv[
i + 1]);
156 }
else if (!strcmp(argv[
i],
"-dst")) {
161 fprintf(stderr,
"invalid pixel format %s\n", argv[
i + 1]);
165 }
else if (!strcmp(argv[
i],
"-v")) {
170 }
else if (!strcmp(argv[
i],
"-summarize")) {
174 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
static int print_ops(SwsContext *const ctx, void *opaque, SwsOpList *ops)
void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const bool unused[4])
Describe an operation in human-readable form.
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.
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.
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
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 av_log_set_callback(void(*callback)(void *, int, const char *, va_list))
Set the logging callback.
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)
#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 ...
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)
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.
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
Helper struct for representing a list of operations.
static const bool unused[4]
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.