Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st December 2007, 02:37   #1  |  Link
six13
Registered User
 
Join Date: Apr 2007
Posts: 102
HCenc 22 and Colorimetry

Can someone please expaline this to me? I was reading some posts by Boulder and jdobbs at doom9 and was trying to understand if using this setting with HCenc 22 would benefit my output.

My source is a NTSC Sat. rec SD TV interlaced capture recorded with MS Media Center and the .dvr-ms file is converted to MPEG2 for demuxing and authoring to process with DVD-RB and HCenc 22.

(1) Considering my source would this benfit my output and if so which setting to start with?

(2) Would this feature benfit a progressice DVD rip source and if so which setting to start with? I would alter HCenc with the GUI.

Thanks to everyone.
six13 is offline   Reply With Quote
Old 1st December 2007, 19:57   #2  |  Link
hwjohn
Registered User
 
Join Date: Nov 2007
Posts: 28
Quote:
Originally Posted by six13 View Post
Can someone please expaline this to me? I was reading some posts by Boulder and jdobbs at doom9 and was trying to understand if using this setting with HCenc 22 would benefit my output.

My source is a NTSC Sat. rec SD TV interlaced capture recorded with MS Media Center and the .dvr-ms file is converted to MPEG2 for demuxing and authoring to process with DVD-RB and HCenc 22.

(1) Considering my source would this benfit my output and if so which setting to start with?

(2) Would this feature benfit a progressice DVD rip source and if so which setting to start with? I would alter HCenc with the GUI.

Thanks to everyone.
I'm no expert, but here goes. Correct me if I'm wrong.

The option sets a flag in the bitstream that indicates which standard (BT. 601 or BT. 709) that the playback device should use to decode colors. A lot of playback devices just ignore the flag because, like lots of other flags, it is not required and is usually unreliable at best (people doing the encoding don't set it correctly). Most playback devices will use the resolution as a clue to what standard to use, with SD resolutions normally using 601 and HD resolutions normally using 709.

If you want to set the flag for SD content, use 601. For HD content (720p, 1080i), use 709.

What happens if the player gets it wrong? Most players will simply use the wrong matrix to decode the colors and, in simple terms, the color will be incorrect.
hwjohn is offline   Reply With Quote
Old 2nd December 2007, 22:08   #3  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by six13 View Post

(1) Considering my source would this benfit my output and if so which setting to start with?

(2) Would this feature benfit a progressice DVD rip source and if so which setting to start with? I would alter HCenc with the GUI.
1 - colorimetry is important only when YCbCr<>RGB conversion is done. So if player have other than RGB output there is nothing to do with colorimetry.

2 - when You do some conversion withou changing colorimetry ie whole processing is taken in YCbCr color space then at the output You need copy source colorimetry ie source colorimtry must be the same as in source ie Your DVD. If during ripping You chnge colorspace from YCbCr (eg YV12, YUY2 etc) to the RGB You must set the same color space as used during conversion YCbCr<>RGB.
pandy is offline   Reply With Quote
Old 3rd December 2007, 02:59   #4  |  Link
hwjohn
Registered User
 
Join Date: Nov 2007
Posts: 28
Quote:
Originally Posted by pandy View Post
1 - colorimetry is important only when YCbCr<>RGB conversion is done. So if player have other than RGB output there is nothing to do with colorimetry..
That is true, but there is always a conversion from YCbCr>RGB during playback. This normally takes place in the TV, unless your source device has the option to output RGB. If the TV or the source device uses the wrong color matrix to decode the YCbCr signal, then you get the wrong RGB values at the display (hence the wrong colors).

Quote:
Originally Posted by pandy View Post
2 - when You do some conversion withou changing colorimetry ie whole processing is taken in YCbCr color space then at the output You need copy source colorimetry ie source colorimtry must be the same as in source ie Your DVD. If during ripping You chnge colorspace from YCbCr (eg YV12, YUY2 etc) to the RGB You must set the same color space as used during conversion YCbCr<>RGB.
That is correct also. AFAIK, almost all SD content uses 601 and all HD content uses 709, so that should aid in matching the colorimetry to the source.
hwjohn is offline   Reply With Quote
Old 3rd December 2007, 16:44   #5  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by hwjohn View Post
That is true, but there is always a conversion from YCbCr>RGB during playback. This normally takes place in the TV, unless your source device has the option to output RGB. If the TV or the source device uses the wrong color matrix to decode the YCbCr signal, then you get the wrong RGB values at the display (hence the wrong colors).
Yes, bigest problem is typical YPbPr connections (by RCA) - in modern video equipment - simply receiver of video don't know anything about colorspace of source.


Quote:
Originally Posted by hwjohn View Post
That is correct also. AFAIK, almost all SD content uses 601 and all HD content uses 709, so that should aid in matching the colorimetry to the source.
Yes, we can have only hope that all manufacturers follows this rule.
pandy is offline   Reply With Quote
Old 3rd December 2007, 18:52   #6  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,341
We had a lengthy discussion about this in this subforum. I still haven't seen any evidence one way or another (except that many players are assuming Rec.601 for SD and Rec.709 for HD stuff). So:
Quote:
That is correct also. AFAIK, almost all SD content uses 601
Where is your evidence of this statement?
Wilbert is offline   Reply With Quote
Old 4th December 2007, 07:08   #7  |  Link
hwjohn
Registered User
 
Join Date: Nov 2007
Posts: 28
Quote:
Originally Posted by Wilbert View Post

Where is your evidence of this statement?
Well, it depends on what you want evidence of. If you want evidence that every SD DVD ever authored uses BT 601, then I don't suppose you could prove that (or that it is even true). That is why I prefaced my statement with AFAIK.

You have already given some proof to my statement; most (if not all) display devices "guess" 601 for SD, and 709 for HD. I doubt that this was done on a whim. Here is also a link about YCbCr from wikipedia:

http://en.wikipedia.org/wiki/YCbCr

You will notice that they reference 601 as SD and 709 as HD. You can find this type of "assumption" all over the place, just do a Google search.

Also, the three primary colors defined by Rec 601 are within the gamut defined by the primary colors in Rec 709 (in other words, the entire 601 gamut is contained within the 709 gamut). Every SDTV I have ever heard of targets the primaries as defined in Rec 601 (notice I say targets, many of them are off because of poor design). Likewise, every HDTV I have ever heard of uses Rec 709 primaries. It wouldn't make sense for SD DVD to use Rec 601 primaries and a Rec 709 color decoding matrix.

Unless you are going to track down the author of the material you are wishing to encode, you may never know what space was actually used. Since we have to make a guess at something, we might as well guess what the rest of the world is guessing (including huge manufacturers such as Sony) and hope that it is right. I can't say for sure, but I'd be willing to bet that the large majority (90%+)of DVDs were originally encoded using 601.

If you want some more evidence I'll try to round it up.

Has there been some evidence shown to the contrary? I'm not all about being correct to feed my ego; if there is evidence that what I'm saying is wrong, I would rather be corrected and learn something than think I was right and be ignorant
hwjohn is offline   Reply With Quote
Old 4th December 2007, 11:17   #8  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by Wilbert View Post
Where is your evidence of this statement?
evidence is a practice, plenty of broadcasters use various analog SD sources - these sources works mostly (if not all) in the bt.601 color space.
pandy is offline   Reply With Quote
Old 4th December 2007, 19:36   #9  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,341
Quote:
You will notice that they reference 601 as SD and 709 as HD. You can find this type of "assumption" all over the place, just do a Google search.
Yes, i know. But does it follow from the dvd specs?

Quote:
Has there been some evidence shown to the contrary?
Yes, the 1995 version of the MPEG-2 specs, but I don't want to repeat the discussion we had in this thread:
http://forum.doom9.org/showthread.php?t=131169

I only want to know what the dvd specs say about this.
Wilbert is offline   Reply With Quote
Old 4th December 2007, 23:15   #10  |  Link
hwjohn
Registered User
 
Join Date: Nov 2007
Posts: 28
Quote:
Originally Posted by Wilbert View Post
Yes, i know. But does it follow from the dvd specs?


Yes, the 1995 version of the MPEG-2 specs, but I don't want to repeat the discussion we had in this thread:
http://forum.doom9.org/showthread.php?t=131169

I only want to know what the dvd specs say about this.

It looks like a lot of that discussion came from this statement that jdobbs found (evidently in an old MPEG2 spec):

Quote:
In the case that sequence_display_extension() is not present in the bitstream or colour_description is zero
the chromaticity is assumed to be that corresponding to colour_primaries having the value 1
The most recent version of that spec appears to have been re-written to say:

Quote:
In the case that sequence_display_extension() is not present in the bitstream or colour_description is zero
the chromacity is assumed to be implicity defined by the application.
The same goes for decoding matrix.

I can't find any mention of that first quote in the newest specs, but maybe I am missing it. I don't know why it would have been changed. Maybe no one was obeying it. I'll ask someone who probably knows for sure and, if he answers, get back to you.
hwjohn is offline   Reply With Quote
Old 6th December 2007, 04:23   #11  |  Link
DrP
Registered User
 
Join Date: Jan 2003
Posts: 159
Quote:
Originally Posted by pandy View Post
evidence is a practice, plenty of broadcasters use various analog SD sources - these sources works mostly (if not all) in the bt.601 color space.
Just to prove there are alternate realities, in my small part of the world all FTA networks (Seven, SC10, WIN, ABC, SBS) transmit BT.709 for SD and HD except for WIN which transmits BT.470 G2 for SD, at least that's what dgindex says.
DrP is offline   Reply With Quote
Old 6th December 2007, 14:18   #12  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by DrP View Post
Just to prove there are alternate realities, in my small part of the world all FTA networks transmit BT.709 for SD and HD except for WIN which transmits BT.470 G2 for SD, at least that's what dgindex says.
Probably they use digital libraries and digital broadcast studio - accordingly to the europen broadcast allmast all (if not all) measurements signal are 601 - this is historic relation when broadcast studios was only in analog. In analog (ie not DTV) only 601 is used.
pandy is offline   Reply With Quote
Old 10th December 2007, 06:42   #13  |  Link
hwjohn
Registered User
 
Join Date: Nov 2007
Posts: 28
Well, I asked a guy who is the most knowledgeable person about compression I know (he currently engineers hardware for Motorola cable boxes I think). He basically said that he didn't know why the 1995 spec said what is says.

He did say that when a DVD does signal the decoding matrix, that he has never seen one signal 709. He said that everyone he has every seen (which is likely a bunch) has signaled 601. Two examples he gave were I Robot and Borat.

I know that this isn't exactly conclusive evidence, but when the flag isn't signaled then there really isn't any way to know. Based on all the evidence I (and others) have found, one should assume that DVD is Rec 601 when the flag is not set. You are basically taking a very good, educated guess. Chances are if you flag it as 709 and the player actually reads and uses the flag, then you will be using the wrong decoding matrix and thus the wrong colors.

If the original 1995 spec was correct, then I don't suppose they would have changed it. I have a feeling it was changed because they realized that playback devices would be decoding the vast majority of DVDs incorrectly by following the spec.
hwjohn is offline   Reply With Quote
Old 11th December 2007, 12:13   #14  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97N, 77.56E
Posts: 135
Here is some information I found in "Video Demystified". Seems to suggest BT.709 is not the default for DVDs.
Quote:
Sequence Display Extension:

Color_primaries
This optional 8-bit codeword describes the chromaticity coordinates of the source primaries, as shown in table. If sequence_display_extension is not present, or color_description = 0, the indicated default value must be used. This information may be used to adjust the color processing after MPEG-2 decoding to compensate for the color primaries of the display.
Code:
-----------------------------------------------------------------------------------
|    Color Primaries     |    Code     |          Application Default               |
|------------------------|-------------|--------------------------------------------|
| forbidden              |  0000 0000  |                                            |
| BT.709, SMPTE 274M     |  0000 0001  | MPEG-2, ATSC, DVB 25Hz HDTV, DVB 30Hz HDTV |
| unspecified            |  0000 0010  |                                            |
| reserved               |  0000 0011  |                                            |
| BT.470 system M        |  0000 0100  | DVD-Video 30 Hz                            |
| BT.470 system B, G, I  |  0000 0101  | DVD-Video 25 Hz, DVB 25Hz SDTV             |
| SMPTE 170M             |  0000 0110  | DVD-Video 30 Hz, DVB 30Hz SDTV             |
| SMPTE 240M             |  0000 0111  |                                            |
| reserved               |  0000 1000  |                                            |
| :                      |      :      |                                            |
| reserved               |  1111 1111  |                                            |
 -----------------------------------------------------------------------------------
ariga is offline   Reply With Quote
Old 11th December 2007, 22:46   #15  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,341
Quote:
If the original 1995 spec was correct, then I don't suppose they would have changed it. I have a feeling it was changed because they realized that playback devices would be decoding the vast majority of DVDs incorrectly by following the spec.
Like i said in the other thread, they have changed that in the 2000 update of the (MPEG-2) specs:

Quote:
I'm reading "ITU-T Rec.H262 (2000 E)". All the ITU-T docs are available for free since a short while:

http://www.itu.int/rec/T-REC-H.262/en

The relevant quote (page 44) says something different (than the 1995 version):

In the case that sequence_display_extension() is not present in the bitstream or colour_description is zero the matrix
coefficients are assumed to be implicitly defined by the application.
http://forum.doom9.org/showthread.ph...33#post1061333

Quote:
Here is some information I found in "Video Demystified". Seems to suggest BT.709 is not the default for DVDs.
Thanks for posting this. I wanted to buy this book myself, but haven't done so yet.

Yes, it's says that BT.601 is the application default for DVD. Looking at the 2000 update of the MPEG-2 specs, this means that BT.601 needs to be assumed if the sequence_delay_extension field is not present.

Do they give any explicit comment about the case that "if the sequence_delay_extension field is not present"?

Last edited by Wilbert; 11th December 2007 at 22:51.
Wilbert is offline   Reply With Quote
Old 11th December 2007, 23:40   #16  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
That table gives the defaults that apply when the extension is absent or color_description = 0.
Guest is offline   Reply With Quote
Old 12th December 2007, 11:00   #17  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97N, 77.56E
Posts: 135
Quote:
Originally Posted by Wilbert View Post
Do they give any explicit comment about the case that "if the sequence_delay_extension field is not present"?
I guess neuron2 just answered that. (?)

There is no information specific to DVDs or what a DVD player should do when the header/field is present.

Last edited by ariga; 12th December 2007 at 11:07.
ariga is offline   Reply With Quote
Old 20th January 2008, 23:05   #18  |  Link
hkazemi
Registered User
 
Join Date: Jan 2008
Posts: 63
Quote:
Originally Posted by Wilbert View Post
Like i said in the other thread, they have changed that in the 2000 update of the (MPEG-2) specs:


http://forum.doom9.org/showthread.ph...33#post1061333


Thanks for posting this. I wanted to buy this book myself, but haven't done so yet.

Yes, it's says that BT.601 is the application default for DVD. Looking at the 2000 update of the MPEG-2 specs, this means that BT.601 needs to be assumed if the sequence_delay_extension field is not present.

Do they give any explicit comment about the case that "if the sequence_delay_extension field is not present"?
I believe instead of 'sequence_delay_extension' you meant 'sequence_display_extension'.

Just for kicks, ATSC standard on page 18 (http://www.atsc.org/standards/a_81.pdf ) talks about colorimetry and the assumptions to make when 'sequence_display_extension' does not tell you what to do:
"The values for color_primaries, transfer_characteristics, and matrix_coefficients shall be explicitly indicated in the sequence_display_extension. While all values for color_primaries, transfer_characteristics, and matrix_coefficients defined in Tables 6-7, 6-8, and 6-9 of ISO/IEC 13818-2 [16, 18] are allowed in the transmitted bit stream, it is noted that ITU-R BT.709 [27] and SMPTE 170M are the most likely to be in common use.

Note: Some previously-encoded legacy material may not have the colorimetry (i.e., color_primaries, transfer_characteristics, and matrix_coefficients) explicitly indicated in the sequence_display_extension, in which case the colorimetry is most likely ITU-R BT.709 for all formats except those formats with vertical_size_value = 480, which are most likely to have colorimetry according to SMPTE 170M."
hkazemi is offline   Reply With Quote
Old 21st January 2008, 04:00   #19  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
That table gives the defaults that apply when the extension is absent or color_description = 0.
sorry but that is incorrect.

having finally heard back from a person who is in the professional encoder industry(no i will not say who) i have more reliable information.

the table is actually the limitation of what you can use. in other words if you set the sequence_display_extension to bt.709 for dvd it is illegal. that doesnt mean it will not play etc it just means that it is not supported and any player that strictly follows the specs is more likely just to ignore it as if no value was set at all.

as for what is used i was told he could not see any specific instructions of what must be used, so he assumed the manufacturer(for hardware) is able to choose from those which he uses for "to RGB" conversion.

now for PAL there is only 1 option, BT.470 system B, G, I listed so i assume this is what should be used.

however for NTSC there is actually 2, BT.470 system M and SMPTE 170M, so either could be used.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)

Last edited by dragongodz; 21st January 2008 at 04:07.
dragongodz is offline   Reply With Quote
Old 21st January 2008, 10:16   #20  |  Link
hkazemi
Registered User
 
Join Date: Jan 2008
Posts: 63
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.ph...82#post1090068
hkazemi is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.