MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 134
Send PM
Re: Sony CXA2025AS US
04/15/16 11:59 PM


EDIT: Nevermind. Now that I'm not on my laptop out in the sun I see that this is pretty bad on a calibrated monitor. But I'm still surprised at how far off the YIQ->RGB formulas are from the standard ones you see everywherw (like wikipedia).

It's interesting how far off these are from the formulas on the YIQ wikipedia page.

If you want to try out this effect now (it might be wrong if we need to do some kind of gamma correction first) you can do the following:

(1)Get the RGB->YIQ matrix from wikipedia.
(2)Get the YIQ->RGB matrix from your post

To get the full RGB->YIQ->RGB you multiply the matrices together in the correct order (YIQ->RGB)*(RGB->YIQ) and use the result in the color convolution section of the hlsl shader. Either the BGFX version or D3D will work. But you'll need to edit the hlsl.json to allow negative slider values.

For example, if I type the matrices into wolframalpha mostly correctly and copy paste the result, the result is:

(1.33737 | -0.025411 | -0.311956
0.17323 | 0.446306 | 0.380464
-0.005481 | 0.031327 | 0.974154)

So

Red from Red = 1.34
Red from Green = -0.025
Red from Blue = -0.0312
Green from Red = 0.173
Green from Green = 0.45
Green from Blue = 0.38
Blue from Red = -0.005
Blue from Green = 0.031
Blue from Blue = 0.97


This would correspond to correctly converted YIQ but then converted back to RGB with your coefficients (barring typos). It does seem to make, for example, the nes output closer to my old crt PVM. The sky is much closer in smb1 anyway. But you might need to play with the gamma settings. And lower saturation if you haven't already. It was set at 150% by default in the bgfx hlsl chain!


> Curious if anyone has insight regarding palette output, as processed through the Sony
> CXA2025AS US decoder matrix, whether it can be implemented as an option with all the
> various shader and video filter possibilities currently available for MAME (?)
>
> Vice...
> https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/video/render2x2ntsc.c
>
> ...and puNES...
> https://github.com/punesemu/puNES/blob/master/src/video/filters/nes_ntsc.c
>
> ...as well as Nestopia (Undead)...
> https://github.com/rdanbrook/nestopia/blob/master/source/nes_ntsc/demo.c
> ...has an option for it.
>
> It is also applied to (forks of) the Gens/Genesis emulator as well as a part of the
> TwoMBit-Core featuring SMS emulation for OpenEmu.
>
> When selected as a palette option, the color hues are spectacular, nailing the way
> respective console and computer systems appear when displayed on many highly utilized
> and popular computer monitors and televisions.
>
> For those interested, the conversion formula (RGB --> YIQ) for this particular
> decoder matrix is as follows:
> R = Y + 1,630 * I + 0,317 * Q
> G = Y - 0,378 * I - 0,466 * Q
> B = Y - 1,089 * I + 1,677 * Q
> Spec sheet/details are attached.

Edited by SoltanGris42 (04/16/16 06:28 AM)







Entire thread
Subject Posted by Posted on
* Sony CXA2025AS US Trebor 04/15/16 01:33 PM
. * Re: Sony CXA2025AS US SoltanGris42  04/19/16 09:07 AM
. * Re: Sony CXA2025AS US Trebor  04/19/16 01:03 PM
. * Re: Sony CXA2025AS US SoltanGris42  04/15/16 11:59 PM
. * Re: Sony CXA2025AS US Trebor  04/16/16 01:18 PM
. * Re: Sony CXA2025AS US AWJ  04/16/16 03:49 PM
. * Re: Sony CXA2025AS US anikom15  04/16/16 06:25 PM
. * Re: Sony CXA2025AS US Trebor  04/16/16 07:56 PM
. * Re: Sony CXA2025AS US anikom15  04/16/16 08:58 PM
. * Re: Sony CXA2025AS US Trebor  04/16/16 11:44 PM
. * Re: Sony CXA2025AS US anikom15  04/17/16 02:43 AM
. * Re: Sony CXA2025AS US SoltanGris42  04/17/16 01:50 AM
. * Re: Sony CXA2025AS US Trebor  04/17/16 01:11 PM
. * Re: Sony CXA2025AS US Trebor  04/16/16 04:43 PM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 500 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3103