[FFmpeg-cvslog] vf_scale: Add an option to pass the scaler params
Luca Barbato
git at videolan.org
Mon Aug 31 10:08:08 CEST 2015
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Aug 25 23:04:12 2015 +0200| [b1abd2aaf91be249f24cb74db9c205d9e4ca9da6] | committer: Luca Barbato
vf_scale: Add an option to pass the scaler params
Reported-By: zehan at magicpony.technology
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1abd2aaf91be249f24cb74db9c205d9e4ca9da6
---
libavfilter/vf_scale.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 73ea9d2..65cf632 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -79,6 +79,7 @@ typedef struct ScaleContext {
*/
int w, h;
unsigned int flags; ///sws flags
+ double param[2]; // sws params
int hsub, vsub; ///< chroma subsampling
int slice_y; ///< top of current output slice
@@ -238,7 +239,7 @@ static int config_props(AVFilterLink *outlink)
else {
scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
outlink->w, outlink->h, outlink->format,
- scale->flags, NULL, NULL, NULL);
+ scale->flags, NULL, NULL, scale->param);
if (!scale->sws)
return AVERROR(EINVAL);
}
@@ -300,6 +301,8 @@ static const AVOption options[] = {
{ "w", "Output video width", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str = "iw" }, .flags = FLAGS },
{ "h", "Output video height", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str = "ih" }, .flags = FLAGS },
{ "flags", "Flags to pass to libswscale", OFFSET(flags_str), AV_OPT_TYPE_STRING, { .str = "bilinear" }, .flags = FLAGS },
+ { "param0", "Scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, FLAGS },
+ { "param1", "Scaler param 1", OFFSET(param[1]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, FLAGS },
{ NULL },
};
More information about the ffmpeg-cvslog
mailing list