[MPlayer-users] Re: How to sharpen the decoded images

Rich Felker dalias at aerifal.cx
Sat Dec 10 03:14:37 CET 2005


On Sat, Dec 10, 2005 at 12:37:03AM +0100, Dominik 'Rathann' Mierzejewski wrote:
> On Friday, 09 December 2005 at 18:53, Rich Felker wrote:
> > On Fri, Dec 09, 2005 at 11:24:58AM +0100, R.Ivarson wrote:
> > > Vladimir Mosgalin wrote:
> > > 
> > > (..)
> > > >Try unsharp=l3x3:1
> > > >play with options to get desirable results.
> > > 
> > > Hi Vladimir!
> > > 
> > > Thanks for this good tip. Adding the following line to my config file
> > >   vf-add=unsharp=l3x3:1
> > > does exactly what I've been searching for! Now Mplayer's even nicer to look 
> > > at. :-)
> > > 
> > > Lovely. All the best,
> > 
> > Actually it's very ugly, like any linear filter. But if your eyes are
> > naive enough to keep thinking it looks good, enjoy while you can! :)
> 
> What would you recommend instead? I have some anime which is very badly
> encoded (no, not Slayers ;)) and I'd like to recompress it using some
> heavy pp and hqdn3d filtering, which leaves the image kind of... soft, so
> I need to sharpen it up a bit. And yes, I know it's a bad idea to start
> with, but please bear with me.

Any linear filter that doesn't just blur will give very nasty
artifacts at edges. That is, if you have an edge between light gray
and dark gray, a sharpening filter will 'sharpen' it by making the
light gray pixels closest to the boundary whiter and the dark gray
pixels closest to the boundary blacker. This creates a nasty "halo"
effect, and can also be interpreted as related to ringing/gibbs (if
you look in the frequency domain).

So how to fix this? The only possible solution is a nonlinear filter.
Rather than just lightening or darkening pixels it should warp the
image in some way to make the edge transitions more narrow without
ever exceeding the original extrema. There's some warp-based sharpener
for avisynth that people use, I think, but I may be wrong. MPlayer has
no such filter.

In any case, sharpening makes the codec perform much worse, so it's
usually better to postpone sharpening until playback time.

Rich





More information about the MPlayer-users mailing list