diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-05-07 09:20:45 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-05-07 09:20:45 +0000 |
commit | 8155bbc944c314fc202d31b0e4a3c77b8efc8dde (patch) | |
tree | f4a35793bf7c71e36bba715d52e5d43f0843ff36 /libavfilter | |
parent | cb0061d4530858b5715c21da0d6a94a931fb5913 (diff) | |
download | ffmpeg-8155bbc944c314fc202d31b0e4a3c77b8efc8dde.tar.gz |
Support setting flags for sws.
Originally committed as revision 23041 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_scale.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index a6b50ac16b..7a0994fe97 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -36,6 +36,7 @@ typedef struct { * -1 = keep original aspect */ int w, h; + unsigned int flags; ///sws flags int hsub, vsub; ///< chroma subsampling int slice_y; ///< top of current output slice @@ -46,8 +47,11 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) { ScaleContext *scale = ctx->priv; - if (args) + scale->flags = SWS_BILINEAR; + if (args){ sscanf(args, "%d:%d", &scale->w, &scale->h); + sscanf(strstr(args,"flags="), "flags=%i", &scale->flags); + } /* sanity check params */ if (scale->w < -1 || scale->h < -1) { @@ -124,7 +128,7 @@ static int config_props(AVFilterLink *outlink) /* TODO: make algorithm configurable */ scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format, outlink->w, outlink->h, outlink->format, - SWS_BILINEAR, NULL, NULL, NULL); + scale->flags, NULL, NULL, NULL); av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n", outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name); |