PAL color palette emulation
Moderator: Moderators
- HardWareMan
- Posts: 209
- Joined: Mon Jan 01, 2007 11:12 am
Re: PAL color palette emulation
Ok. 250MHz sample rate video capture
3 full frames. Still huge oversample. Anyway, you can restore all phase info from it.
Ask your answers.
3 full frames. Still huge oversample. Anyway, you can restore all phase info from it.
Ask your answers.
Last edited by HardWareMan on Sun Dec 23, 2018 9:18 am, edited 1 time in total.
Re: PAL color palette emulation
Correction: by colorburst we see better that it's still a 6 line period, on actual image they indeed look like 3.
- HardWareMan
- Posts: 209
- Joined: Mon Jan 01, 2007 11:12 am
Re: PAL color palette emulation
I have increased the clarity of the picture with 250MHz samplerate. Now it is possible to specify the phase of each of the colors, and the phase shift relative to the scanlines.
I remind you that PAL has 180 degrees shift in R-Y channel each scanline. And subcarrier has some shift to scanline too. But it still multiple to whole frame and looks like steady dot net.
WOW...
I remind you that PAL has 180 degrees shift in R-Y channel each scanline. And subcarrier has some shift to scanline too. But it still multiple to whole frame and looks like steady dot net.
WOW...
Code: Select all
BURST ______------______------______------______------
x1 _------______------______------______------_____
x2 __------______------______------______------____
x3 ___------______------______------______------___
x4 ____------______------______------______------__
x5 _____------______------______------______------_
x6 ______------______------______------______------ < BURST PHASE
x7 -______------______------______------______-----
x8 --______------______------______------______----
x9 ---______------______------______------______---
xA ----______------______------______------______--
xB -----______------______------______------______-
xC ------______------______------______------______
6 and not 7.WIKI wrote: PAL color burst is believed to alternate between 7 (-U+V) and A (-U-V), so hue is rotated by 15° from NTSC.
Last edited by HardWareMan on Sun Dec 23, 2018 9:15 am, edited 1 time in total.
Re: PAL color palette emulation
Is the rest of the sentence still accurate?HardWareMan wrote:6 and not 7.WIKI wrote:PAL color burst is believed to alternate between 7 (-U+V) and A (-U-V), so hue is rotated by 15° from NTSC.
i.e. is this edit correct:
PAL color burst has been found to alternate between 6 (-U+V) and A (-U-V), so hue is rotated by 15° from NTSC.
Re: PAL color palette emulation
I guess it means 6 on one line and 6 on the next line, which is the same phase as A on the previous line because it flips around 8. And because it flips around 8 (not 8½ as believed before), there's no hue shift unless your TV is misinterpreting it due to the scanline period not matching the 64 μs delay line period or due to the 120/240 swing not matching the expected 135/225 swing.
- HardWareMan
- Posts: 209
- Joined: Mon Jan 01, 2007 11:12 am
Re: PAL color palette emulation
I think 7 and A goes to 6 and 9 for alternating. And tepples right: for decoder every scanline have the same phase shift for every hue, because it affected to burst and hue together.
PS I've just thinking. x6 is pure red. And if I remember it right the color burst must be R-Y phase. Because PLL of decoder use it for fine tune own generator and R-Y alternating by 180 degrees each scanline for better phase stabilization by eliminate phase error wich NTSC don't have. So, it quite logical.
PS I've just thinking. x6 is pure red. And if I remember it right the color burst must be R-Y phase. Because PLL of decoder use it for fine tune own generator and R-Y alternating by 180 degrees each scanline for better phase stabilization by eliminate phase error wich NTSC don't have. So, it quite logical.
Re: PAL color palette emulation
Colorburst is at hues -U-V and -U+V, neither of which is really red.... it's more nearly orange.
Red "should" be 14° towards -U from +V, (and yellow 12° towards +V from -U), neither 45° as in the PAL colorburst.
Then again, shade 6 isn't a very pure red...
Red "should" be 14° towards -U from +V, (and yellow 12° towards +V from -U), neither 45° as in the PAL colorburst.
Then again, shade 6 isn't a very pure red...
- rainwarrior
- Posts: 8735
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: PAL color palette emulation
After trying out the PAL emulation that was in FCEUX r3112, and trying to understand what the pictures in this thread mean, I am curious about these checkerboard patterns. Is the picture supposed to be downsampled? Can you see these patterns on a PAL TV? (I can't seem to see them in videos of PAL NES footage people have on youtube, etc.)
Example from the filter, and the same image downsampled: Is the end result supposed to be the one on the right?
Example from the filter, and the same image downsampled: Is the end result supposed to be the one on the right?
Re: PAL color palette emulation
I asnwered in the other thread, but how are you downsampling it? Color borders look quite nice (unless that's what my filter does).
- rainwarrior
- Posts: 8735
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: PAL color palette emulation
Why did you answer my question from here in the other thread? (link to answer) My question in the other thread is asking about the existence of tools, not for a description of how PAL works. I asked about the moire patterns here, not there.
The downsampling I used in that picture was just a simple 3:1 horizontal blend (i.e. scale down to 256 pixels wide averaging every 3, then scaled back up with linear interpolation). Any colour artifacts at the edges of shapes are due to patterns in your filter's output.
I just did that as a test to see what it would look like. I never see moire patterns on other people's captures and photographs of PAL NES stuff, I've only seen them in this thread, which is what's confusing to me. I get that you're subdividing the signal into 3 parts per pixel to emulate how the PAL colour is generated, but isn't this missing some critical final bandlimiting step of some sort to smooth it back out into flat colours?
The kind of stuff I see in video captures like this one of Battletoads makes sense to me. Flat areas look like a flat colour, and the edges of shapes get corrupted, similar to how NTSC does but with a different pattern to it than NTSC has.
Where do the capture pictures in this thread of moire patterns come from? Is your capture device special, or designed for higher frequency devices? Do these patterns appear on regular PAL TVs in some cases, or are we only seeing them in this thread because you are doing something special to reveal them?
The downsampling I used in that picture was just a simple 3:1 horizontal blend (i.e. scale down to 256 pixels wide averaging every 3, then scaled back up with linear interpolation). Any colour artifacts at the edges of shapes are due to patterns in your filter's output.
I just did that as a test to see what it would look like. I never see moire patterns on other people's captures and photographs of PAL NES stuff, I've only seen them in this thread, which is what's confusing to me. I get that you're subdividing the signal into 3 parts per pixel to emulate how the PAL colour is generated, but isn't this missing some critical final bandlimiting step of some sort to smooth it back out into flat colours?
The kind of stuff I see in video captures like this one of Battletoads makes sense to me. Flat areas look like a flat colour, and the edges of shapes get corrupted, similar to how NTSC does but with a different pattern to it than NTSC has.
Where do the capture pictures in this thread of moire patterns come from? Is your capture device special, or designed for higher frequency devices? Do these patterns appear on regular PAL TVs in some cases, or are we only seeing them in this thread because you are doing something special to reveal them?
Re: PAL color palette emulation
I took rainwarrior's "Example from the filter" and did this in GIMP:
- Nearest neighbor scale by one-third vertically
- Crop to 756x239, taking into account the PAL PPU's blanking of the left and right 2 pixels
- Pad back to 768x240
- Notice that flat areas in the filter output have a repeating horizontal pattern of period 4
- Convolve horizontally with a box filter that notches out period 4 patterns: [1 1 1 1]/4
- Linear scale to 704x240 and then nearest neighbor scale to 704x480 (to nearly correct 11:8 PAR)
Re: PAL color palette emulation
Stretching the image horizontally by 3 was initially suggested by HardWareMan to simplify the calculations, so all my attempts were relying on that method. The first revisions of the filter also have an erroneous 4 scanline pattern instead of a 6 scanline one. I think I fixed it in later revisions.
This stretching approach, however, resulted in wrong samplerate that I mentioned. Hence the exact pattern didn't match the one from a tuner or from a TV, even though without notch filter it did look close to an SVideo capture for an untrained eye.
SVideo doesn't apply the notch filter by design, because it's supposed to get Luma and Chroma already separated. NES doesn't output that, but if we plug it into the SVideo channel, we can clearly see the exact pattern of the moire and study/simulate it first. Then we can either smooth the picture out in some way or just cancel the moire rendering for flat areas. I think that's how Blargg's filter does that.
Now here's a pack of all the shot's we've done, both from TV and from our tuners. My tuner is the USB one, the weakest, but it shows some things accurate enough to compare to, tuners from Eugene and HardWareMan are Avermedia, so they produce a picture similar to what you see at GDQ marathons.
https://www.dropbox.com/s/lsvh4nql4m3tssr/shots.7z?dl=0
This stretching approach, however, resulted in wrong samplerate that I mentioned. Hence the exact pattern didn't match the one from a tuner or from a TV, even though without notch filter it did look close to an SVideo capture for an untrained eye.
That's because everyone uses the Composite channel to obtain the signal from the console, and because of that, on flat areas, all the colors of the pattern get mixed together. Notch is done by applying some latency to every color, so they bleed together all the time. On flat areas more or less the same color pattern repeats, so they smoothly mix together. But for color edges, it becomes a few pixels of shades of one color, then a few pixels of shades of the other color, and only then it might start repeating. So those don't mix together as well, in the end you see the moire artifacts.I never see moire patterns on other people's captures and photographs of PAL NES stuff, I've only seen them in this thread, which is what's confusing to me.
SVideo doesn't apply the notch filter by design, because it's supposed to get Luma and Chroma already separated. NES doesn't output that, but if we plug it into the SVideo channel, we can clearly see the exact pattern of the moire and study/simulate it first. Then we can either smooth the picture out in some way or just cancel the moire rendering for flat areas. I think that's how Blargg's filter does that.
Now here's a pack of all the shot's we've done, both from TV and from our tuners. My tuner is the USB one, the weakest, but it shows some things accurate enough to compare to, tuners from Eugene and HardWareMan are Avermedia, so they produce a picture similar to what you see at GDQ marathons.
https://www.dropbox.com/s/lsvh4nql4m3tssr/shots.7z?dl=0
- rainwarrior
- Posts: 8735
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: PAL color palette emulation
Ahh, thank you. That explains what I'm looking at.feos wrote:NES doesn't output that, but if we plug it into the SVideo channel, we can clearly see the exact pattern of the moire and study/simulate it first.
Cool!feos wrote:Now here's a pack of all the shot's we've done
Re: PAL color palette emulation
I'm currently updating the archive, put there a video by mistake. If you haven't yet started downloading, wait a few minutes.
Re: PAL color palette emulation
PPU UA6538 tv-tuner captures, s-video and composite various tests:
http://hwm.us.to/emustuff/Capture/6538_Shots/
http://hwm.us.to/emustuff/Capture/6538_Shots_aver305/
http://hwm.us.to/emustuff/Capture/6538_Tests/
OSC Captures (by HardWareMan):
http://hwm.us.to/emustuff/Capture/6538_OscCapture/
http://hwm.us.to/emustuff/Capture/6538_Shots/
http://hwm.us.to/emustuff/Capture/6538_Shots_aver305/
http://hwm.us.to/emustuff/Capture/6538_Tests/
OSC Captures (by HardWareMan):
http://hwm.us.to/emustuff/Capture/6538_OscCapture/
Last edited by Eugene.S on Sun Apr 26, 2020 5:11 am, edited 3 times in total.