View Full Version : Default colorimetry for MPEG1 always BT.470-2 correct?
shh
17th October 2005, 18:54
Hello,
I've got a question about the colorimetry and matrix_coefficients interpretation of DGIndex.
What colorimetry is DGIndex using for MPEG1s without the picture_coding_extension? Is it correct to always use the BT.470-2 colorimetry? For NTSC _and_ PAL?
I'm asking this, because for MPEG2s there seem to be implemented a "FCC" colorimetry, what is - to my understanding - the "BT.470-2 System M" for NTSC. But for all MPEG1-streams DGIndex shows BT.470-2 as default and not "FCC" for at least NTSC-MPEG1s.
So, is DGIndex switching to BT.470-2 System M (=NTSC) for NTSC-MPEG1s or is this possibly a bug, that the program is always using BT.470-2 System B,G, even on NTSC-streams?
Wilbert
17th October 2005, 22:09
I'm asking this, because for MPEG2s there seem to be implemented a "FCC" colorimetry, what is - to my understanding - the "BT.470-2 System M" for NTSC.
Just curious. Where did you get this information? I see that in table 6-7 (Color Primaries) of the MPEG-2 specs they mention "BT.470-2 System M" (value 4). In table 6-9 (Matrix Coefficients) they call it FCC (also value 4). Does it mean that they are equal?
shh
18th October 2005, 08:09
I also read that tables and still don't know if "BT.470-2 System M" and "FCC" are the same. DGIndex cut's away if System M or System B,G is used, and therefore I don't know if DGIndex is differentiating between NTSC- and PAL-tables.
I think FCC should be used for NTSC-MPEG1s and not the (probably PAL) BT.470-2.
This page (http://scanline.ca/ycbcr/) about color-coding only shows me three different models what's confusing me a bit more:
ITU-R BT.601
ITU-R BT.709
SMPTE 240M
Btw, why is the matrix_coeffizients value used for color-correction (YUV -> YUY2) and not the value from color_primaries? :confused:
tritical
18th October 2005, 19:54
The matrix_coefficients value is only used for the conversion to rgb, and dgindex/dgdecode only does a conversion to rgb in 3 cases:
1.) display in dgindex
2.) upconv=2 in dgdecode
3.) dgvfapi frameserving
There are four different sets of coefficients that are used:
if (matrix == 7) // SMPTE 240M (1987)
else if (matrix == 6 || matrix == 5) // SMPTE 170M/ITU-R BT.470-2 -- BT.601
else if (matrix == 4) // FCC
else // ITU-R Rec.709 (1990) -- BT.709
you can see the coefficients used in avisynthapi.cpp of dgdecode or mpeg2dec.c of dgindex. Though they are in special forms for the mmx conversion routine.
The colour_primaries and transfer_characteristics values are not used by dgindex or dgdecode. AFAIK, those values are intended to be used for device dependent color conversions... i.e. you know the display devices color primaries and transfer characteristics. In that case, you would convert yuv to r'g'b' using the matrix_coefficients values, then convert the gamma corrected r'g'b' to rgb using the source transfer function. Finally, you convert rgb to xyz using the source's color primaries. Once you are in xyz, you do the inverse operation using the color primaries and transfer characteristics of the display device to get back to r'g'b'.
As to whether matrix=5 or matrix=4 should be used for ntsc mpeg1 I don't know :D... but the difference between the two is pretty small.
hkazemi
21st January 2008, 10:18
I've compiled a summary to hopefully consolidate the threads and address the confusion over colorspace and the usage of Colormatrix. It is available at http://forum.doom9.org/showthread.php?t=133982#post1090068
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.