64 #if FF_API_OLD_FILTER_OPTS
75 #if FF_API_OLD_FILTER_OPTS
79 "num:den syntax is deprecated, please use num/den or named options instead\n");
101 #define OFFSET(x) offsetof(AspectContext, x)
102 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
118 double var_values[
VARS_NB], res;
121 var_values[
VAR_W] = inlink->
w;
122 var_values[
VAR_H] = inlink->
h;
123 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
141 "Error when evaluating the expression '%s'\n", s->
ratio_expr);
144 if (aspect_ratio->
num < 0 || aspect_ratio->
den <= 0) {
146 "Invalid string '%s' for aspect ratio\n", s->
ratio_expr);
152 #if CONFIG_SETDAR_FILTER
162 #if FF_API_OLD_FILTER_OPTS
167 #if FF_API_OLD_FILTER_OPTS
174 s->
dar.
den * inlink->
w, INT_MAX);
184 inlink->
w, inlink->
h, old_dar.
num, old_dar.
den, old_sar.
num, old_sar.
den,
190 static const AVOption setdar_options[] = {
194 #if FF_API_OLD_FILTER_OPTS
197 {
"max",
"set max value for nominator or denominator in the ratio",
OFFSET(max),
AV_OPT_TYPE_INT, {.i64=100}, 1, INT_MAX,
FLAGS },
203 static const AVFilterPad avfilter_vf_setdar_inputs[] = {
207 .config_props = setdar_config_props,
213 static const AVFilterPad avfilter_vf_setdar_outputs[] = {
226 .priv_class = &setdar_class,
227 .
inputs = avfilter_vf_setdar_inputs,
228 .
outputs = avfilter_vf_setdar_outputs,
233 #if CONFIG_SETSAR_FILTER
242 #if FF_API_OLD_FILTER_OPTS
247 #if FF_API_OLD_FILTER_OPTS
256 inlink->
w, inlink->
h, old_sar.
num, old_sar.
den, old_dar.
num, old_dar.
den,
262 static const AVOption setsar_options[] = {
266 #if FF_API_OLD_FILTER_OPTS
269 {
"max",
"set max value for nominator or denominator in the ratio",
OFFSET(max),
AV_OPT_TYPE_INT, {.i64=100}, 1, INT_MAX,
FLAGS },
275 static const AVFilterPad avfilter_vf_setsar_inputs[] = {
279 .config_props = setsar_config_props,
285 static const AVFilterPad avfilter_vf_setsar_outputs[] = {
298 .priv_class = &setsar_class,
299 .
inputs = avfilter_vf_setsar_inputs,
300 .
outputs = avfilter_vf_setsar_outputs,
int av_parse_ratio(AVRational *q, const char *str, int max, int log_offset, void *log_ctx)
Parse str and store the parsed ratio in q.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static const char *const var_names[]
static void compute_dar(AVRational *dar, AVRational sar, int w, int h)
#define AV_LOG_WARNING
Something somehow does not look correct.
static const AVFilterPad outputs[]
Main libavfilter public API header.
int h
agreed upon image height
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int get_aspect_ratio(AVFilterLink *inlink, AVRational *aspect_ratio)
#define AV_LOG_VERBOSE
Detailed information.
A filter pad used for either input or output.
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.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
static av_cold int init(AVFilterContext *ctx)
int w
agreed upon image width
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
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
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
rational number numerator/denominator
const char * name
Filter name.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterLink ** outputs
array of pointers to output links
common internal and external API header
AVFilterContext * dst
dest filter
#define AVFILTER_DEFINE_CLASS(fname)
static int filter_frame(AVFilterLink *link, AVFrame *frame)
simple arithmetic expression evaluator