mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavfi: tweak display aspect ratio variables in pad and scale filters
Previously, "dar" and "a" were documented like "input display aspect ratio", but their actual value was "in_w/in_h". In order to avoid to break scripts which rely on the "a" variable, the patch keeps the same semantics but fixes the corresponding docs, and fixes the semantics of the recently added "dar" variable, which now correctly expresses the input Display Aspect Ratio value as "(inw_w/in_h)*sar".
This commit is contained in:
parent
0e29c4f761
commit
61d55fda2b
@ -1184,12 +1184,15 @@ same as @var{out_w} and @var{out_h}
|
|||||||
x and y offsets as specified by the @var{x} and @var{y}
|
x and y offsets as specified by the @var{x} and @var{y}
|
||||||
expressions, or NAN if not yet specified
|
expressions, or NAN if not yet specified
|
||||||
|
|
||||||
@item dar, a
|
@item a
|
||||||
input display aspect ratio, same as @var{iw} / @var{ih}
|
same as @var{iw} / @var{ih}
|
||||||
|
|
||||||
@item sar
|
@item sar
|
||||||
input sample aspect ratio
|
input sample aspect ratio
|
||||||
|
|
||||||
|
@item dar
|
||||||
|
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
|
||||||
|
|
||||||
@item hsub, vsub
|
@item hsub, vsub
|
||||||
horizontal and vertical chroma subsample values. For example for the
|
horizontal and vertical chroma subsample values. For example for the
|
||||||
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
|
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
|
||||||
@ -1289,12 +1292,15 @@ the output (cropped) width and heigth
|
|||||||
@item ow, oh
|
@item ow, oh
|
||||||
same as @var{out_w} and @var{out_h}
|
same as @var{out_w} and @var{out_h}
|
||||||
|
|
||||||
@item dar, a
|
@item a
|
||||||
input display aspect ratio, same as @var{iw} / @var{ih}
|
same as @var{iw} / @var{ih}
|
||||||
|
|
||||||
@item sar
|
@item sar
|
||||||
input sample aspect ratio
|
input sample aspect ratio
|
||||||
|
|
||||||
|
@item dar
|
||||||
|
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
|
||||||
|
|
||||||
@item hsub, vsub
|
@item hsub, vsub
|
||||||
horizontal and vertical chroma subsample values. For example for the
|
horizontal and vertical chroma subsample values. For example for the
|
||||||
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
|
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define LIBAVFILTER_VERSION_MAJOR 2
|
#define LIBAVFILTER_VERSION_MAJOR 2
|
||||||
#define LIBAVFILTER_VERSION_MINOR 27
|
#define LIBAVFILTER_VERSION_MINOR 27
|
||||||
#define LIBAVFILTER_VERSION_MICRO 3
|
#define LIBAVFILTER_VERSION_MICRO 4
|
||||||
|
|
||||||
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
|
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
|
||||||
LIBAVFILTER_VERSION_MINOR, \
|
LIBAVFILTER_VERSION_MINOR, \
|
||||||
|
@ -45,8 +45,9 @@ static const char *var_names[] = {
|
|||||||
"out_h", "oh",
|
"out_h", "oh",
|
||||||
"x",
|
"x",
|
||||||
"y",
|
"y",
|
||||||
"a", "dar",
|
"a",
|
||||||
"sar",
|
"sar",
|
||||||
|
"dar",
|
||||||
"hsub",
|
"hsub",
|
||||||
"vsub",
|
"vsub",
|
||||||
NULL
|
NULL
|
||||||
@ -62,8 +63,9 @@ enum var_name {
|
|||||||
VAR_OUT_H, VAR_OH,
|
VAR_OUT_H, VAR_OH,
|
||||||
VAR_X,
|
VAR_X,
|
||||||
VAR_Y,
|
VAR_Y,
|
||||||
VAR_A, VAR_DAR,
|
VAR_A,
|
||||||
VAR_SAR,
|
VAR_SAR,
|
||||||
|
VAR_DAR,
|
||||||
VAR_HSUB,
|
VAR_HSUB,
|
||||||
VAR_VSUB,
|
VAR_VSUB,
|
||||||
VARS_NB
|
VARS_NB
|
||||||
@ -158,9 +160,10 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
|
var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
|
||||||
var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
|
var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
|
||||||
var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
|
var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
|
||||||
var_values[VAR_DAR] = var_values[VAR_A] = (float) inlink->w / inlink->h;
|
var_values[VAR_A] = (float) inlink->w / inlink->h;
|
||||||
var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
|
var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
|
||||||
(float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
|
(float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
|
||||||
|
var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];
|
||||||
var_values[VAR_HSUB] = 1<<pad->hsub;
|
var_values[VAR_HSUB] = 1<<pad->hsub;
|
||||||
var_values[VAR_VSUB] = 1<<pad->vsub;
|
var_values[VAR_VSUB] = 1<<pad->vsub;
|
||||||
|
|
||||||
|
@ -39,8 +39,9 @@ static const char *var_names[] = {
|
|||||||
"in_h", "ih",
|
"in_h", "ih",
|
||||||
"out_w", "ow",
|
"out_w", "ow",
|
||||||
"out_h", "oh",
|
"out_h", "oh",
|
||||||
"a", "dar",
|
"a",
|
||||||
"sar",
|
"sar",
|
||||||
|
"dar",
|
||||||
"hsub",
|
"hsub",
|
||||||
"vsub",
|
"vsub",
|
||||||
NULL
|
NULL
|
||||||
@ -54,8 +55,9 @@ enum var_name {
|
|||||||
VAR_IN_H, VAR_IH,
|
VAR_IN_H, VAR_IH,
|
||||||
VAR_OUT_W, VAR_OW,
|
VAR_OUT_W, VAR_OW,
|
||||||
VAR_OUT_H, VAR_OH,
|
VAR_OUT_H, VAR_OH,
|
||||||
VAR_A, VAR_DAR,
|
VAR_A,
|
||||||
VAR_SAR,
|
VAR_SAR,
|
||||||
|
VAR_DAR,
|
||||||
VAR_HSUB,
|
VAR_HSUB,
|
||||||
VAR_VSUB,
|
VAR_VSUB,
|
||||||
VARS_NB
|
VARS_NB
|
||||||
@ -160,9 +162,10 @@ static int config_props(AVFilterLink *outlink)
|
|||||||
var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
|
var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
|
||||||
var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
|
var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
|
||||||
var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
|
var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
|
||||||
var_values[VAR_DAR] = var_values[VAR_A] = (float) inlink->w / inlink->h;
|
var_values[VAR_A] = (float) inlink->w / inlink->h;
|
||||||
var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
|
var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
|
||||||
(float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
|
(float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
|
||||||
|
var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];
|
||||||
var_values[VAR_HSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_w;
|
var_values[VAR_HSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_w;
|
||||||
var_values[VAR_VSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
|
var_values[VAR_VSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user