History

vf_pad: add support for a "sar" variable

Also add a "dar" alias for "a", for avoiding confusion with sar/dar.

Stefano Sabatini committed 15 years ago

Commit 0bf02fb1 parent 01151a23 files · +12 −5Browse files

Unified · Split

3 files
  1. doc/filters.texi +4 −1
  2. libavfilter/avfilter.h +1 −1
  3. libavfilter/vf_pad.c +7 −3
doc/filters.texi+4−1
@@ -1129,9 +1129,12 @@ same as @var{out_w} and @var{out_h} · 1128 unmodified lines
11291129 x and y offsets as specified by the @var{x} and @var{y}
11301130 expressions, or NAN if not yet specified
11311131
1132−@item a
1132+@item dar, a
11331133 input display aspect ratio, same as @var{iw} / @var{ih}
11341134
1135+@item sar
1136+input sample aspect ratio
1137+
11351138 @item hsub, vsub
11361139 horizontal and vertical chroma subsample values. For example for the
11371140 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
libavfilter/avfilter.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030
3131 #define LIBAVFILTER_VERSION_MAJOR 2
3232 #define LIBAVFILTER_VERSION_MINOR 24
33−#define LIBAVFILTER_VERSION_MICRO 2
33+#define LIBAVFILTER_VERSION_MICRO 3
3434
3535 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
3636 LIBAVFILTER_VERSION_MINOR, \
libavfilter/vf_pad.c+7−3
@@ -45,7 +45,8 @@ static const char *var_names[] = { · 44 unmodified lines
4545 "out_h", "oh",
4646 "x",
4747 "y",
48− "a",
48+ "a", "dar",
49+ "sar",
4950 "hsub",
5051 "vsub",
5152 NULL
@@ -61,7 +62,8 @@ enum var_name { · 9 unmodified lines
6162 VAR_OUT_H, VAR_OH,
6263 VAR_X,
6364 VAR_Y,
64− VAR_A,
65+ VAR_A, VAR_DAR,
66+ VAR_SAR,
6567 VAR_HSUB,
6668 VAR_VSUB,
6769 VARS_NB
@@ -156,7 +158,9 @@ static int config_input(AVFilterLink *inlink) · 88 unmodified lines
156158 var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
157159 var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
158160 var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
159− var_values[VAR_A] = (float) inlink->w / inlink->h;
161+ var_values[VAR_DAR] = var_values[VAR_A] = (float) inlink->w / inlink->h;
162+ var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
163+ (float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
160164 var_values[VAR_HSUB] = 1<<pad->hsub;
161165 var_values[VAR_VSUB] = 2<<pad->vsub;
162166

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t