Sorry for the extremely late reply, but I had to resurrect some code to make a meaningful response.
IMHO, the major issue with creating test patterns is verifying their accuracy. After all, they are to be used for calibration, so it's imperative that they are accurate (and traceable).
For all of the patterns on my website, I used a direct to YCbCr technique. Since I'm a software guy (well, I'm really a hardware guy, but I know how to write code), I just wrote C programs to create the patterns. For example, here's the code for REC709 colorbars:
Code:
/*
4:2:2 YCbCr (UYVY) REC709 color bars
*/
#include
#include
#define TRUE 1
#define FALSE 0
unsigned char buffer422[1920 * 1088 * 2];
int main(int argc, char **argv)
{
FILE *fpout;
unsigned int i, j, index = 0;
unsigned char y, cb, cr;
if (argc != 2) {
fprintf(stderr, "usage: bars709 \
");
exit(-1);
}
/*--- open binary file (for parsing) ---*/
fpout = fopen(argv[1], "wb");
if (fpout == 0) {
fprintf(stderr, "Cannot open output file <%s>\
", argv[1]);
exit(-1);
}
for(j = 0; j < 720; j++) {
for(i = 0; i < 4; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 180;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 168;
cr = 136;
cb = 44;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 145;
cr = 44;
cb = 147;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 133;
cr = 52;
cb = 63;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 63;
cr = 204;
cb = 193;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 51;
cr = 212;
cb = 109;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 28;
cr = 120;
cb = 212;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 4; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
}
for(j = 0; j < 96; j++) {
for(i = 0; i < 4; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 28;
cr = 120;
cb = 212;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 63;
cr = 204;
cb = 193;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 145;
cr = 44;
cb = 147;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 180;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 4; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
}
for(j = 0; j < 264; j++) {
for(i = 0; i < 4; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < (136 * 2); i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 7;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 136; i++) {
y = 25;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < (136 * 2); i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
for(i = 0; i < 4; i++) {
y = 16;
cr = 128;
cb = 128;
buffer422[index++] = cb;
buffer422[index++] = y;
buffer422[index++] = cr;
buffer422[index++] = y;
}
}
fwrite(&buffer422[0], 1, 1920 * 1080 * 2, fpout);
fclose(fpout);
return 0;
}
The program creates a YCbCr file (in UYVY 4:2:2 format) that can be fed directly to an uncompressed file server that I use with my hardware MPEG-2 HD encoder. The file is also compatible with AVIsynth, using the "RawSource" plugin.
Of course, most folks won't be willing to take this approach. Many don't even have a C compiler on their Windows machine. So an approach that works with an image editor is required.
When I helped out on the GetGray disc, I developed a program to convert .tga files created in Photoshop to YCbCr files. I've updated the code to do REC709 for HD images, and it can be downloaded here:
http://www.w6rz.net/rgbtouyvy.zip
The program expects video RGB (16 - 235) values so that below black and above white patterns can be created.
So the workflow is:
1) Create a 1920x1080 RGB image in Photoshop (or some other image editor)
2) Save to 24-bit Targa (.tga) format.
3) Convert to YCbCr with rgbtouyvy
rgbtouyvy 1920 1080 test.tga test.yuv
4) Create an AVIsynth script that uses the "RawSource" command to read the .yuv file
5) Encode a clip with your favorite AVIsynth compatible MPEG-2 encoder.
6) Author the HD-DVD
Ron