[Digikam-devel] [Bug 149578] libjpeg JPEG subsampling setting is not user-controlable

Jean-Marc Liotier jim at liotier.org
Fri Sep 7 14:39:08 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=149578         




------- Additional Comments From jim liotier org  2007-09-07 15:39 -------
A comment by Thom Sharp on the Photo.net article gives interesting clarification of the origins and uses of various subsampling settings. I think it summarizes it quite well :

"Within the professional cinematography, video, and imaging industries, chroma subsampling is expressed using the Y:Cr:Cb notation. This notation was originally devised to convey the horizontal (not vertical) resolution ratios of the Cr (red) and Cb (blue) channels to the horizontal resolution of Y (luminance). 4:4:4, therefore, indicates the absence of horizontal subsampling (1:1), while the 4:2:2 and 4:1:1 formats indicate that the Cr and Cb channels each horizontally boast 50% (4:2:2), and 25% (4:1:1), of Y's horizontal resolution.

While less common, a 4:2:1 format also exists, yielding 2:1 horizontal Cr resolution vs. Y, and 4:1 horizontal Cb resolution vs. Y. This exploits the lower sensitivity to blue than red definition in human vision.

Unfortunately, the Y:Cr:Cb notation often causes confusion because it was "hacked" after its introduction to express vertical subsampling levels in addition to horizontal ones. For example, while 4:2:0 seems to suggest 2:1 Cr vs. Y horizontally and the total lack of Cb, it actually indicates that both Cr and Cb are present, and that each is subsampled 2:1 vs. Y horizontally *and* vertically. The reason this "makes sense" is because, in vertical subsampling, only one of the two chroma subchannels is sampled per horizontal line (co-siting). Therefore, scanline 1 contains only Cr at 50% of Y's horizontal resolution (4:2:0), while scanline 2 contains only Cb at 50% of Y's horizontal resolution (4:0:2), etc. Upon decoding, Cr and Cb are vertically interpolated to form a vertical average. But in encoded form, it's literally "4:2:0".

The 4:1:0 format uses the same technique, whereby Cr and Cb are alternately present (2:1 averaged vertical chroma resolution), and each boasts 25% (4:1) of the horizontal resolution of Y.

Summary:
- 4:4:4 (PSP 1x1 1x1 1x1) - CrH 100% - CbH 100% - CrV 100% - CbV 100%
- 4:2:2 (PSP 2x1 1x1 1x1) - CrH 50% - CbH 50% - CrV 100% - CbV 100%
- 4:1:1 (PSP 4x1 1x1 1x1) - CrH 25% - CbH 25% - CrV 100% - CbV 100%
- 4:2:0 (PSP 2x2 1x1 1x1) - CrH 50% - CbH 50% - CrV 50% - CbV 50%
- 4:1:0 (PSP 4x2 1x1 1x1) - CrH 25% - CbH 25% - CrV 50% - CbV 50% 

Uses :
- 4:4:4 - High-end imaging/cinematography processing, high quality JPEG (used by Photoshop's higher quality levels)
- 4:2:2 - D-1, D-5, D-9 (a.k.a. Digital-S), Ampex DCT, Digital Betacam, Betacam SX, DVCPRO-50, studio/high profile MPEG-2, good quality JPEG
- 4:2:0 - PAL DV, PAL DVCAM, main profile MPEG-2 (e.g. DVD, American SDTV and HDTV, SD and HD DVB), average quality JPEG (used by Photoshop's lower quality levels)
- 4:1:1 - D-7, NTSC DV, NTSC DVCAM, DVCPRO, low quality JPEG
- 4:1:0 - Some low-bandwidth video/image codecs (worse than VHS chroma)



More information about the Digikam-devel mailing list