Please see the post "Same palette for PAL and NTSC
" at viewtopic.php?f=14&t=1813&p=9013#p9013
where this problem is discussed extensively.
Basically, because you can select the color burst orientation freely in NTSC, whereas in PAL you are restricted to 45 degree angles, you must first pick a colorburst orientation for PAL and then transform that to NTSC.
The PAL Video Player demo has the exactly correct microcode and burst value that produces exactly correct YUV colors from normal source, e.g. normal avi video files.
It's been a couple of years since I did those, but I worked out the PAL video player palette settings from the PAL video player demo
source code using the palette editor
. For PAL the proper hicolor yuv video palette is P:C4:B44:A44:Y84:N04, which results in colour burst amplitude 5.7, phase 135.0 degrees, microcode C4 BC 1C 5C. That can be translated to NTSC and becomes N:B0:B44:A44:Y84:N04, which has colour burst amplitude 5.0, phase 180.0 degrees, and the same microcode PROG: C4 BC 1C 5C. If you want stronger colors, reduce the color burst amplitude but keep phase the same (click on the colorburst vector in the palette editor to experiment).
As with the default 8-bit palette
, with these settings the same bitmap memory contents will result in similar picture colors in PAL and NTSC, and as the microcode program is the same, only the BURST_LEVEL (colorburst pixels UV bits in prototype lines) needs to be changed when switching between PAL and NTSC. This mode is UVY448, 16 bits per pixel.
Have you figured out how to use these values in your program or do you need help in deciphering what they mean?
And one more: Under what license do you publish your demo code? Would I get permission to use the ntsc.h and pal.h files and some functions from your Arduino demo, when I start selling my hardware shield and offer a software library that includes those files and functions? Of course I would add comments about the origin of those files.
Of course you can use them! Please see that there is a link to here and to VLSI webpage in the source code. But I'd like to insist that for 8-bit (256 color) mode you should use the "Default palette" (PAL:EE:A22:B22:Y44:N10, NTSC:0D:B22:A22:Y44:N10), which is described in the aforementioned post, by default. And for AVI video, please follow the microcode settings in the PAL video player demo
As our revenue comes from selling ICs and not software, we're not enforcing any specific license and our traditional answer has been that our source codes are at least free to use with whatever license as long as one of our chips is used in the product. If you need something else, please ask.
PS. Do you want the AVI video encoder? We're hesitant to distribute mencoder publicly at our web pages due to all kind of potential licensing issues, but you can do it. Mencoder as well as my additions to it (lcd1.c) is GPL.