64 const char *w_expr,
const char *h_expr,
66 int *ret_w,
int *ret_h)
72 int factor_w, factor_h;
75 double var_values[
VARS_NB], res;
84 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
137 w =
av_rescale(h, inlink->
w, inlink->
h * factor_w) * factor_w;
139 h =
av_rescale(w, inlink->
h, inlink->
w * factor_h) * factor_h;
148 "Error when evaluating the expression '%s'.\n"
149 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
150 expr, w_expr, h_expr);
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)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int h
agreed upon image height
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
A link between two filters.
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.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
int w
agreed upon image width
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int format
agreed upon media format
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
static const char *const var_names[]
simple arithmetic expression evaluator