Gamma correction

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

bhamadicharef
Atariator
Atariator
Posts: 23
Joined: Tue Jul 18, 2017 8:31 am
Location: Singapore

Re: Gamma correction

Postby bhamadicharef » Fri Oct 11, 2019 7:29 am

The ADV7513 does not seem to have Gamma correction
https://www.analog.com/en/products/adv7513.html
Brahim HAMADI CHAREF:: Singapore

paulbnl
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Oct 24, 2018 9:43 am

Re: Gamma correction

Postby paulbnl » Fri Oct 11, 2019 5:22 pm

The ADV dsp is just basic multiplication/division so it is not suitable for gamma correction.

Can we re-use the scaler's 8bit palette to use as LUT?

ghogan42
Atari maniac
Atari maniac
Posts: 98
Joined: Wed Oct 17, 2018 7:27 pm

Re: Gamma correction

Postby ghogan42 » Fri Oct 11, 2019 10:13 pm

paulbnl wrote:The ADV dsp is just basic multiplication/division so it is not suitable for gamma correction.

Can we re-use the scaler's 8bit palette to use as LUT?


Grabolosaure told me months ago that it can be used for that.

I asked him about fully gamma correct blending for the upscaling (requires gamma LUT at the beginning of the scaler and again at the end at output resolution). He said no because it would require more hardware in the scaler and would not be worth it.

But gamma like you have implemented he said could be done. Or maybe he has done? I don't remember.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5390
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Gamma correction

Postby Sorgelig » Fri Oct 11, 2019 11:09 pm

"No" doesn't always means it's impossible. Sometimes it requires unreasonably high resources and of course more timing violations and hence instability.

Also, scaler is for scaled HDMI video. It won't work with direct video.
My original idea is to put gamma control to core side (not in framework). So each core will deal with instability separately. 256 bytes in logic with quadruple address decoder is quite large logic area!

actually gamma correction could be made inside the VDP/PPU on palette level. So it could be a free solution. May be not so flexible. But with several choices for palette correction could be done.

Threepwood
Atari maniac
Atari maniac
Posts: 79
Joined: Thu Jan 10, 2019 10:06 am

Re: Gamma correction

Postby Threepwood » Sat Oct 19, 2019 3:28 pm

Just downloaded the update with gamma correction in the main branch. Congratulations, it works great!

Will it be possible to add this to all cores over time?

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5390
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Gamma correction

Postby Sorgelig » Sat Oct 19, 2019 3:46 pm

paulbnl did a great job in refactoring the code, so now it uses BRAM and minimum logic and therefore is good to integrate.

But in general, I still don't see much use of that. In most cases well adjusted brightness and contrast on a good quality monitor provides a great picture without gamma corrections.
Many small monitors (<13") today are produced mostly by unknown cost saving companies and have garbage quality of color level representation. I have several such monitors.

Threepwood
Atari maniac
Atari maniac
Posts: 79
Joined: Thu Jan 10, 2019 10:06 am

Re: Gamma correction

Postby Threepwood » Sat Oct 19, 2019 4:05 pm

Sorgelig wrote:paulbnl did a great job in refactoring the code, so now it uses BRAM and minimum logic and therefore is good to integrate.


That's awesome to hear!

Sorgelig wrote:But in general, I still don't see much use of that. In most cases well adjusted brightness and contrast on a good quality monitor provides a great picture without gamma corrections.


Well, we covered this already extensively in this thread. No LCD offers the necessary gamma corrections and thus it is not a case of "just buy a better monitor", besides the article pualbnl linked written by byuu covers the issue quite well. No matter what, thank you and all involved for integrating this feature, it is very appreciated.

Sorgelig wrote:Many small monitors (<13") today are produced mostly by unknown cost saving companies and have garbage quality of color level representation. I have several such monitors.


Take a look at monitors by https://www.beetronics.co.uk/ They sell industrial grade small screens with IPS panels. I have their 15" 4:3 IPS (Model 15VGM), which is gorgeous.

paulbnl
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Oct 24, 2018 9:43 am

Re: Gamma correction

Postby paulbnl » Sat Oct 19, 2019 5:40 pm

Sorgelig also suggested to add per component gamma correction so it is now also possible to put 3 comma separated values per line instead of 1 if you would want to adjust colors separately.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5390
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Gamma correction

Postby Sorgelig » Sat Oct 19, 2019 5:55 pm

Threepwood wrote:Take a look at monitors by https://www.beetronics.co.uk/ They sell industrial grade small screens with IPS panels. I have their 15" 4:3 IPS (Model 15VGM), which is gorgeous.

In many cases "professional monitor" means some specific feature and completely disregards many other features. I've bough Lilliput monitor which is also called "professional" It has many buttons and rockers on face plate, it comes with sunshade and battery options, It has many digital and analog inputs. So it pretends to be a professional but:
- glossy screen - only this option should remove this monitor from professional category.
- it doesn't lock to input frame rate. So it's locked internally to 60Hz regardless input frequency.
- dark levels are quite rubbish regardless the settings.
Otherwise it's professional :mrgreen:

JamesF
Captain Atari
Captain Atari
Posts: 155
Joined: Sat Dec 15, 2018 6:46 am

Re: Gamma correction

Postby JamesF » Sat Oct 19, 2019 7:37 pm

Attached Polynomial Gamma with 2.3 to 3.0 cure below 50% input in 0.1 jumps, and above that is your native gamma.
Looks fantastic, please try.
You do not have the required permissions to view the files attached to this post.

Threepwood
Atari maniac
Atari maniac
Posts: 79
Joined: Thu Jan 10, 2019 10:06 am

Re: Gamma correction

Postby Threepwood » Sat Oct 19, 2019 8:08 pm

Sorgelig wrote:In many cases "professional monitor" means some specific feature and completely disregards many other features. I've bough Lilliput monitor which is also called "professional" It has many buttons and rockers on face plate, it comes with sunshade and battery options, It has many digital and analog inputs. So it pretends to be a professional but:
- glossy screen - only this option should remove this monitor from professional category.
- it doesn't lock to input frame rate. So it's locked internally to 60Hz regardless input frequency.
- dark levels are quite rubbish regardless the settings.
Otherwise it's professional :mrgreen:


I know, that is why I recommend you the beetronics monitors I mentioned ;) Mine has many inputs (including BNC), matte quality IPS, 4:3, metal frame including mount rails, is firmware updateable, has a remote and I can use my 60Hz modded SEGA Master System in 50Hz and 60Hz with it directly without conversion or upscaling (the display tells you the mode, PAL or PAL-60 automatically). Ain't a cheap display, though.

JamesF wrote:Attached Polynomial Gamma with 2.3 to 3.0 cure below 50% input in 0.1 jumps, and above that is your native gamma.


Cool, will give them a test later :)


Return to “MiSTer”

Who is online

Users browsing this forum: D33zel and 5 guests