[FFmpeg-devel] [PATCH] Change default behaviour of scale filter from 'progressive' to 'auto'

Tim Nicholson nichot20 at yahoo.com
Mon Apr 2 12:02:58 CEST 2012


On 02/04/12 09:21, Carl Eugen Hoyos wrote:
> Tim Nicholson <nichot20 <at> yahoo.com> writes:
>[..]
> 
>> So I would challenge the "all material" in your statement.
> 
> What I see here is: All material is signalled as being interlaced, 
> (nearly) all movies and all series (as opposed to "studio based 
> material") are (visually) progressive.
> What is wrong about this?
> 

Well I find lot of "series" are studio based and therefore often
interlaced, that was all.

I think we agree on the important point though, that you cannot tell
from the flag the material content. However the progressive material
will all have been handled as interlaced throughout the entire broadcast
chain. Is it so bad for it to continue to be handled that way?

>>> I suspect who works with interlaced material knows it 
>>> and can set the scaling correctly.
>>>
>>
>> Whilst this is true there is one major snafu in the current 
>> arrangement, and that is that quite often in a filterchain 
>> a scale filter gets auto inserted between other filters, 
>> and by default handles material progressively.
>> Therefore when building filtergraphs one has to be very
>> careful to forced add scale filters with interlace enabled at every
>> place where a scale filter would otherwise be auto inserted.
> 
> I had not realised this.
> 
>> It is much neater, and leads to clearer filtergraphs, 
>> if one could force the interlace type at the start of 
>> a filterchain using 'setfield' and leave the rest of 
>> the chain containing just the required filters for the
>> actual required function.
> 
> Isn't this a different approach than what your patch does?
> 

I don't not believe so. But I may have misunderstood the way the filter
functions.

With my proposal unless the filter is specifically given an interl
parameter it should honour the interlace flag of the media, and
therefore in the case of being auto inserted will use the appropriate
settings, which may have been forcibly set my the setfield filter.

>> Handling PSF material as interlaced can mean that non optimal
>> interpolation is used, but the material is not otherwise damaged.
>> However the reverse of handling interlaced as progressive can 
>> render material unusable.
> 
> I absolutely may be wrong but I thought when handling interlaced 
> as progressive the problem is immediately visible but when 

True.

> handling progressive as interlaced the material gets permanently 
> damaged in a way that is not immediately obvious.

Depending upon what process is applied to the material the "damage" can
vary from none, to a reduction in interpolation quality due to skipping
alternate lines when scaling an image when this is unnecessary. As I
mentioned earlier, in broadcast systems it is usual for all progressive
material to be PSF and handled as interlaced throughout its life.

I think its only really an issue when it comes to getting the maximum
possible quality achievable through scaling. I am going to look closely
at the fate samples just to check that the only issue is this resolution
loss due to the 1080i material being scaled as i even though it contains
progressive material.

It might be worth noting that one of the *todo*'s of the scale filter is
make it configurable instead of the current fixed bilinear approach, so
currently there is room for improvement anyway.

-- 
Tim


More information about the ffmpeg-devel mailing list