[MPlayer-dev-eng] [PATCH] -vf combdetect: crude detection of interlaced sources

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Aug 2 20:22:15 CEST 2010


On Mon, Aug 02, 2010 at 08:05:23PM +0200, Steinar H. Gunderson wrote:
> On Mon, Aug 02, 2010 at 06:39:05PM +0200, Reimar Döffinger wrote:
> > But even for detecting combing it should be quite simple to do a lot
> > better, e.g. by comparing C(line i, line i+1) to C(line i, line i+2) where
> > C is the covariance.
> 
> Or even simpler, since we're bikeshedding anyway: Compare, for each x,
> sum(even lines) and sum(odd lines). As far as I can see, this is exactly
> equivalent to checking the strength of the frequency bin at the Nyquist
> frequency and comparing it to the DC strength (DC would be sum_odd +
> sum_even, Nyquist frequency would be sum_odd - sum_even).

Will fail to detect combing due to vertical movement (though the
"current" algorithm also will not work too well for that).
However I think the proposed solution should work quite well to detect
obvious interlacing artefacts.
Except that it will have some false positives for thin diagonal lines.
Against that comparing not just against above/below but also above and
below left/right might help, but it probably does not matter much in
practice.
There is only one suggestion I would really like to suggest since it
simplifies and speeds up the code:
Change the condition to
if (d1*d2 > vf->priv->limit)
    combed++;


More information about the MPlayer-dev-eng mailing list