lurkertech.com Lurker's Guide CL_FORMAT_YCbCr422DC and DM_IMAGE_PACKING_CbYCrYYY

Support
This Site
I work on this site in my off hours. Please help me to push aside my day job and work on it more by supporting the site in one of these ways:
donate now   Donate Now
Use your credit card or PayPal to donate in support of the site.

get anything at all from amazon.com
Use this link to Amazon—you pay the same, this site gets 4% from Amazon.
get a cool thai-english software dictionary
Learn Thai with my Thai-English English-Thai Talking Dictionary for Windows PCs.
get a cool thai-english paper dictionary
Don't leave home without the Thai-English English-Thai Compact Dictionary I co-authored.
get thailand fever
I co-authored this bilingual cultural guidebook to Thai-Western romantic relationships.

Submit
This Site
Like what you see?
Help spread the word using these social bookmarking sites:
StumbleUpon
del.icio.us
del.icio.us

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!

CL_FORMAT_YCbCr422DC and DM_IMAGE_PACKING_CbYCrYYY

By Chris Pirazzi.

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.

Support
This Site
I work on this site in my off hours. Please help me to push aside my day job and work on it more by supporting the site in one of these ways:
donate now   Donate Now
Use your credit card or PayPal to donate in support of the site.

get anything at all from amazon.com
Use this link to Amazon—you pay the same, this site gets 4% from Amazon.
get a cool thai-english software dictionary
Learn Thai with my Thai-English English-Thai Talking Dictionary for Windows PCs.
get a cool thai-english paper dictionary
Don't leave home without the Thai-English English-Thai Compact Dictionary I co-authored.
get thailand fever
I co-authored this bilingual cultural guidebook to Thai-Western romantic relationships.
CopyrightAll text and images copyright 1999-2010 Chris Pirazzi unless otherwise indicated.