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

Hampa Hug hampa at hampa.ch
Sat Oct 18 22:31:16 CEST 2003


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.

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).

Hampa



More information about the MPlayer-dev-eng mailing list