Go to the documentation of this file.
58 const char *w_expr,
const char *h_expr,
60 int *ret_w,
int *ret_h)
67 double var_values[
VARS_NB], res;
75 (
double)
inlink->sample_aspect_ratio.num /
inlink->sample_aspect_ratio.den : 1;
98 eval_w = (
int) res == 0 ?
inlink->w : (
int) res;
107 "Error when evaluating the expression '%s'.\n"
108 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
109 expr, w_expr, h_expr);
114 int *ret_w,
int *ret_h,
115 int force_original_aspect_ratio,
int force_divisible_by)
118 int factor_w, factor_h;
134 if (
w < 0 &&
h < 0) {
150 if (force_original_aspect_ratio) {
153 * force_divisible_by;
155 * force_divisible_by;
157 if (force_original_aspect_ratio == 1) {
160 if (force_divisible_by > 1) {
162 w =
w / force_divisible_by * force_divisible_by;
163 h =
h / force_divisible_by * force_divisible_by;
168 if (force_divisible_by > 1) {
170 w = (
w + force_divisible_by - 1) / force_divisible_by * force_divisible_by;
171 h = (
h + force_divisible_by - 1) / force_divisible_by * force_divisible_by;
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
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
int ff_scale_eval_dimensions(void *log_ctx, const char *w_expr, const char *h_expr, AVFilterLink *inlink, AVFilterLink *outlink, int *ret_w, int *ret_h)
Parse and evaluate string expressions for width and height.
A link between two filters.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
int format
agreed upon media format
static const char *const var_names[]
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int ff_scale_adjust_dimensions(AVFilterLink *inlink, int *ret_w, int *ret_h, int force_original_aspect_ratio, int force_divisible_by)
Transform evaluated width and height obtained from ff_scale_eval_dimensions into actual target width ...
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.