
Note: Updated Lurker's Guide available (but not this page!)This page belongs to the old 1990s SGI Lurker's Guide. As of 2008, several of the Lurker's Guide pages have been updated for HDTV and for modern OS platforms like Windows and Mac. This particular page is not one of those, but you can see what new stuff is available here. Thanks!
The section of the packings document called "Sampling Pattern Definitions" described the 4:2:0 sampling pattern.
There are two libraries which can represent data in this format: the the DM (digital media library), via DM_IMAGE_PACKING_CbYCrYYY, and the CL (Compression Library), via CL_FORMAT_YCbCr422DC (DC stands for "Duplicate Chroma"). The CL representation looks exactly like a 4:2:2 packing, except that each pair of image lines has identical Cr,Cb values. An example:
Say we have an image which is 4 pixels wide and 2 pixels high:
1 2 3 4 5 6 7 8
Encoding that with the 420 DM_IMAGE_PACKING_CbYCrYYY packing, I'd get this in memory (increasing mem address):
byte[ 0] = Cb(center of 1256) byte[ 1] = Y(1) byte[ 2] = Cr(center of 1256) byte[ 3] = Y(2) byte[ 4] = Y(5) byte[ 5] = Y(6) byte[ 6] = Cb(center of 3478) byte[ 7] = Y(3) byte[ 8] = Cr(center of 3478) byte[ 9] = Y(4) byte[10] = Y(7) byte[11] = Y(8)
With the CL_FORMAT_YCbCr422DC packing, what I get instead is this:
byte[ 0] = Cb(center of 1256) byte[ 1] = Y(1) byte[ 2] = Cr(center of 1256) byte[ 3] = Y(2) byte[ 4] = Cb(center of 3478) byte[ 5] = Y(3) byte[ 6] = Cr(center of 3478) byte[ 7] = Y(4) byte[ 8] = Cb(center of 1256) AGAIN -- duplicate byte[ 9] = Y(5) byte[10] = Cr(center of 1256) AGAIN -- duplicate byte[11] = Y(6) byte[12] = Cb(center of 3478) AGAIN -- duplicate byte[13] = Y(7) byte[14] = Cr(center of 3478) AGAIN -- duplicate byte[15] = Y(8)Say the image lines are numbered 0,1,2,3,4,.... If you are using CL_FORMAT_YCbCr422DC and the chroma on lines 0,2,4,6,... is not identical to that on lnies 1,3,5,7,..., then it is an error.
| Like It? | Like what you see on this site? Want to see more in the future?
| ||||||||||
| Google Ads | |||||||||||
| Shameless Plugs | If you find this information useful or entertaining, consider browsing these shameless plugs for things that me and my friends to do earn a living. | ||||||||||
![]() | mapfling.com: free custom maps with your own labels Party? Meeting? Request a map, label it yourself, and easily fling it to your friends! | ||||||||||
![]() | world's stupidest everything See some of the worst the world has to offer, and add some of your own! World's Stupidest Holiday and Birthday Presents - stupidest-presents.com | ||||||||||
![]() | lurkertech: video tech and diversions Buzzword bingo, bill the borg, MEZ, lurker's guide to video, and Thai, oh my! | ||||||||||
![]() | slice-of-thai.com Tasty morsels of information on Thai food, language, culture, and general silliness. | ||||||||||
![]() | thailand fever I co-authored this bilingual cultural guidebook to Thai-Western romantic relationships. | ||||||||||
![]() | thai-english software dictionary Check out my Thai-English, English-Thai dictionary for Palm OS® PDAs. | ||||||||||
![]() | allaboutpai.com A site about Pai, my peaceful home in the mountains of Northern Thailand. | ||||||||||
![]() | thailand your way Travel with my friend Nang, who is a great nature, birding, and cultural guide. | ||||||||||
![]() | jeed illustration My English-fluent Thai friend Jeed is a freelance illustrator who is available for hire. | ||||||||||
| Copyright | All text and images copyright 1999-2008 Chris Pirazzi unless otherwise indicated. | ||||||||||