[MPlayer-dev-eng] eq2 "gamma" correcture

Michael Niedermayer michaelni at gmx.at
Sat Oct 18 23:29:30 CEST 2003


Hi

On Saturday 18 October 2003 22:31, Hampa Hug wrote:
> Michael Niedermayer wrote:
> > why is eq2 performing gamma correcture in YUV space??? this is wrong even
> > if the gamma correcture is the same for all channels
> > hint: xr^c + yg^c + zb^c != y^c = (xr + yg + zb)^c
>
> Right, I'm aware of that:
>
> On Wed, 25 Sep 2002 06:38:31 +0200 Hampa Hug wrote:
> > This patch adds a new software equalizer to mplayer. It can adjust
> > brightness/contrast as well as gamma. Some notes:
> >
> > - All operations are done on the Y channel only. This is not
> >   technically correct, but it produces decent results.
sorry i forgot that mail ...

>
> To be correct, gamma correction would have to be done in the
> color space of the output device, which typically is some
> form of RGB.
>
> The thing is, that gamma correction in RGB is slower. It's at
> least three times as slow for the actual correction plus there
> may be extra color space conversions involved.
>
> An acceptable compromise might be for eq2 to perform gamma
> correction in RGB if its input is RGB anyway.
>
> While we're at it: The contrast adjustment as performed by
> both eq and eq2 is not technically correct either (for
> similar reasons). I don't think that's a problem because
> the results differ from the correct correction (;-)) only
> for extreme values (such as contrast=0.0).
yes, but the only thing missing for correctness is to scale the UV by contrast 
too

      R        16        Y             16
A *c( G ) + ( 128 ) = c( U ) + (1-c)( 128 )
      B       128        V            128

so for correct contrast just set saturation=contrast

[...]
-- 
Michael
level[i]= get_vlc(); i+=get_vlc();		(violates patent EP0266049)
median(mv[y-1][x], mv[y][x-1], mv[y+1][x+1]);	(violates patent #5,905,535)
buf[i]= qp - buf[i-1];				(violates patent #?)
for more examples, see http://mplayerhq.hu/~michael/patent.html
stop it, see http://petition.eurolinux.org & http://petition.ffii.org/eubsa/en



More information about the MPlayer-dev-eng mailing list