@PlainOldPants
It took awhile, but I did eventually work through the last few pages of the Parker paper well enough to understand converting from “axis & gain” notation to a R’G’B’ to R’G’B’ correction matrix, or back the other way. Hopefully this will prove useful for you, or at least for someone:
In both cases we need a few constants.
The NTSC white balance factors (often truncated to 0.299, 0.586, 0.114):
- Wr = 0.298911657927057
- Wg = 0.586610718748869
- Wb = 0.114477623324074
The Y’UV scaling factors:
- Udownscale = 0.492111
- Vdownscale = 0.877283
The inverse Y’UV scaling factors:
- Uupscale = 1/Udownscale = 2.03206187221989
- Vupscale = 1/Vdownscale = 1.13988302520395
MatrixB (2x2):
(1-Wr)/Vupscale, -Wr/Uupscale
-Wg/Vupscale, -Wg/Uupscale
We also need MatrixBInverse, the inverse of MatrixB.
To Convert R’G’B’ to R’G’B’ Correction Matrix to “Axis & Gain”:
Assume we have a 3x3 R’G’B’ to R’G’B’ correction matrix we want to embody as a demodulator:
Krr, Krg, Krb
Kgr, Kgg, Kgb
Kbr, Kbg, Kbb
Define:
MatrixCr (1x2):
Krr – Wr
Krg – Wg
MatrixCg (1x2):
Kgr – Wr
Kgg – Wg
Matrix Cb (1x2):
Kbr – Wr
KBg – Wg
Compute:
- [[yr], [xr]] = MatrixBInverse * MatrixCr
- [[yg], [xg]] = MatrixBInverse * MatrixCg
- [[yb], [xb]] = MatrixBInverse * MatrixCb
Convert the coordinates xr, yr to polar form to get the angle and gain for red.
red_gain = sqrt(xr^2 + yr^2)
red_angle = atan(yr/xr)
You may need to correct the quadrant that atan() spits out. (Blue should be near 0 degrees, red near 90, and green near 235.) Also remember radians vs degrees.
Repeat for green and blue, and that’s it.
To Convert “Axis & Gain” to R’G’B’ to R’G’B’ Correction Matrix:
First, figure out if the gain values have been normalized. If the gain for blue is already around 2, you’re good to go. If the gain for blue is 1.0 and the angle for blue is 0 degrees, then multiply all the gains by Uupscale. If the gain for blue is 1.0 and the angle for blue is not 0 degrees, then you haven’t been given enough information and the data sheet author should be beaten.
Convert from polar to Cartesian coordinates:
xr = red_gain * cos(red_angle); yr = red_gain * sin(red_angle)
Repeat for green and blue.
Compute:
- MatrixCr = MatrixB * [[yr], [xr]]
- MatrixCg = MatrixB * [[yg], [xg]]
- MatrixCb = MatrixB * [[yb], [xb]]
Add [[Wr],[Wg]] to each of MatrixCr,g,b to recover Krr and Krg, Kgr and Kgg, and Kbr and Kbg, respectively. (See definitions of MatrixCr,g,b above.)
Finally recover:
- Krb = 1 - (Krr + Krg)
- Kgb = 1 - (Kgr + Kgg)
- Kbb = 1 - (Kbr + Kbg)
Which gets you to a 3x3 R’G’B’ to R’G’B’ correction matrix:
Krr, Krg, Krb
Kgr, Kgg, Kgb
Kbr, Kbg, Kbb
This is really neat for a couple reasons. First, converting the demodulator’s behavior into a R’G’B’ to R’G’B’ matrix means that we can have a really fast implementation that’s just multiplying by a hardcoded matrix. Second, the fact that our only operation is an invertible matrix means that we should be able to find gamut boundaries for the gamut of “all the colors (via a given trio of phosphors) that this demodulator can output given every valid input,” and we can use that for a gamut compression algorithm rather than the gamut of “all the colors this trio of phosphors can produce.” I’m really excited to try that out.
We’re still missing a few puzzle pieces though.
One open question is “What about Japan?” Japan used a different white point, so doing things “right” would have meant building a different series of modulators/demodulators with different constants for white balance and UV scaling. But, did they? It would have been cheaper and easier to use the same hardware across the board, and you can use any wrong constants you like and they’ll drop out so long you use them in both directions. Several things point towards the provisional conclusion that Japan just used the same modulators/demodulators domestically as US units:
- I have not, as yet, seen any Japan-only modulators/demodulators using the 9300K+27MPCD balance.
- The fact that chips like CXA2025AS exist, with US and Japan modes that seemingly differ only by axis and gain.
- Parker also does some examples for the Japanese white point, using the same white balance and UV scaling constants.
- US Patent 4,167,750 discusses axis and gain for the Japanese white point, without ever mentioning the use of different white balance and UV scaling constants.
Another big open question is “Which set of phosphors was paired with which demodulator chip?” I’ve made a small amount of headway here. It’s not hard to find Sony service manuals that tell you that a particular demodulator chip and tube were used in the same unit. The problem is finding the phosphor chromaticities for a specific model of trinitron tube. Thus far I’ve had no luck doing this.
I’ve a few thoughts on other topics, but no time to write them down now.