FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP

VIP Gamma Corrector

Altera_Forum
Honored Contributor II
1,152 Views

Hi, 

 

I'm trying to find out what the VIP Gamma Corrector really does.  

 

In the application note to the UDX4 High Definition Reference Design (an627.pdf) the Gamma Corrector is used to convert from 10 bits per color to 8 bits. However, this capability is not mentioned in the VIP user guide. Also, when I add it to my SOPC Builder design I get errors if the color depth of the source to the Gamma Corrector, of the Gamma Corrector itself and the sink after the Gamma Corrector are not all set to the same color depth.  

 

So apparently the Gamma Corrector does not do any down conversion in color depth. Am I right?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
343 Views

Hi, 

 

The Gamma Corrector does not change the pixel depth (bits per pixel). It does exactly what its name says - Gamma Correction. This is a non-linear transformation of the pixel intensity to compensate for the non-linear response of displays. Look up Gamma Correction in Wikipedia for a better description. I am not aware of any VIP core that can change the pixel depth, although this is not too hard to write yourself. 

 

Regards, 

Niki
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Hi Nikki, 

 

thanks for the reply! 

So I guess the description on page 8 of an627 (UDX4 Reference Design) is an error. Or is it referring to a different Gamma Corrector? 

Thanks for the advice about gamma correction, but due to many years of experience I do know what gamma correction is. :)  

In the past years I have not seen anybody converting from gamma space to uncompressed space without increasing the color depth at the same time or converting it back into gamma space while reducing color depth. 

It's basically necessary, because the conversion to uncompressed space is decompressing the colors.  

For example: I have a DVI input and I want to scale that video to a higher resolution. Before I feed it through the scaler I would want to remove gamma, because the scaling result will be better, in part because of the increased resolution. To display the upscaled video on DVI I need to reapply gamma, thus reducing the resolution. 

Anybody I have talked to (coworkers and such) does not see the point of this Gamma Corrector, simply because input and output color depths are the same. 

But maybe we are just assuming it to be something it is not.
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

The last time I checked the gamma corrector simply gave you LUT:s to store your mapping values. It's not really a computed transformation so a lack of resolution doesn't apply. You simply exchange values to something else. Rather, you could see this as replacing the last gamma step in your previous chain. 

 

 

By the way, I don't think you can add/subtrac from gamma without being in non-linear space. The TV/display is going to assume to degamma in non-linear space anyway for further image/color manipulations. If you change gamma in linear space you won't have the desired effect I would think. 

 

Scaling and other video processing of course, in linear space.
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Yes, I think the Gamma Corrector really only gives you LUTs. If there was interpolation the bit depth would change.  

 

What do you mean by add/subtract from gamma? I'm afraid I don't quite follow. Do you mean changing the gamma value? That is, of course, always a non linear operation. Is that what you meant? 

 

Ok, so we have established that the gamma corrector is not to be used for applying gamma or removing it, thus converting from and to linear space. Or at least not for high quality applications. Doing a decompression should result in a higher bit depth, and compressing reduces the depth.
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Hi.  

add/subtract I just meant if you are e.g. 2.22 gamma and want to add 0.1 for example then you would replace the values in the LUT:s based on calculations in non-linear space..otherwise you would not reach the correct result. 

 

It might be hard to find IP that does degamma and regamma functions.. the first part exp2.22 is trivial with lut:s but coming back down is tricky. I ended up spending a lot of time getting it right and had to do it from scratch since no ip was available - at least at the time.
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Ok, I understand what you're saying.  

 

I have older IP that I might be able to salvage, only it needs to be adapted to AvalonST. That of course I can do, but since there already was a module named Gamma Corrector I figured I might not have to do the extra work. :)
0 Kudos
Reply