[FFmpeg-devel] [PATCH] Change default behaviour of scale filter from 'progressive' to 'auto'
Tim Nicholson
nichot20 at yahoo.com
Fri Mar 30 11:51:28 CEST 2012
When the option of interlaced aware scaling was first introduced interlace detection
was poor. This has been improved, and this proposed patch changes the default behaviour
of the filter to depend upon the auto detected value, bringing it into line with
many other options whose default value is -1 (auto).
>From 4d1ad96e209b18bdf86530d153a6a5acbc5aab8a Mon Sep 17 00:00:00 2001
From: Tim Nicholson <Tim.Nicholson at bbc.co.uk>
Date: Fri, 30 Mar 2012 10:43:46 +0100
Subject: [PATCH] Make default setting of parameter interl=-1 (auto)
Previously default was 0 (progressive), but interlace detection has been
improved in 648e55ff, and this makes the behaviour consistent with other
options that use 1|0|-1 with -1 the default.
---
doc/filters.texi | 7 +++++--
libavfilter/vf_scale.c | 4 +++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index 2091242..0ab5a02 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -2222,7 +2222,7 @@ can be used to test the monowhite pixel format descriptor definition.
@section scale
-Scale the input video to @var{width}:@var{height}[:@var{interl}=@{1|-1@}] and/or convert the image format.
+Scale the input video to @var{width}:@var{height}[:@var{interl}=@{1|0|-1@}] and/or convert the image format.
The scale filter forces the output display aspect ratio to be the same
of the input, by changing the output sample aspect ratio.
@@ -2276,12 +2276,15 @@ Valid values for the optional parameter @var{interl} are:
@item 1
force interlaced aware scaling
+ at item 0
+force progressive scaling
+
@item -1
select interlaced aware scaling depending on whether the source frames
are flagged as interlaced or not
@end table
-Unless @var{interl} is set to one of the above options, interlaced scaling will not be used.
+The default value for @var{interl} is -1 (auto).
Some examples follow:
@example
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 692e2c5..d429e36 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -93,7 +93,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
if (p) scale->flags = strtoul(p+6, NULL, 0);
if(strstr(args,"interl=1")){
scale->interlaced=1;
- }else if(strstr(args,"interl=-1"))
+ }else if(strstr(args,"interl=0")){
+ scale->interlaced=0;
+ }else
scale->interlaced=-1;
}
--
1.7.7
--
Tim
More information about the ffmpeg-devel
mailing list