Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

# Difference between revisions of "The Pixel Rosetta Stone: Packings and Colorspaces"

Assembled by Chris Pirazzi. Information provided by folks throughout the company, including Brian Beach, David Blythe, Nelson Bolyard, Terry Crane, Patricia Creek, Hilton Goldstein, Bent Hagemark, Angela Lai, Michael Minakami, Paul Ning, Michael Portuesi, Mark Segal, Paul Spencer, Mike Travis, Ashok Yerneni, and several mailing lists.

This document has two goals:

• Describe all of the current VL packings.
• Describe the current OpenGL, IRIS GL, DM, and CL packings which overlap with the VL packings or are otherwise useful to video developers.

## Introduction

### Tower of Babel?

Your first question is probably "Which of these zillions of packings are useful?" Each of these packings has some reason to exist, but the three most commonly used packings are:

• Good ol' 4-byte-per-pixel OpenGL RGBA.
• Implemented on all VL and OpenGL devices.
• 2-byte-per-pixel 4:2:2 sampled YCrCb.
• Implemented on all VL devices (watch out for colorspace issues).
• The older 4-byte-per-pixel IRIS GL ABGR.</a>
• Implemented on all VL and IRIS GL devices up to IRIX 5.3.

### Packing vs. Colorspace

</a> In our model, all images have four components,

numbered 1 through 4.

A packing

• determines which of the four components are sampled.
• determines the sampling pattern (4:4:4, 4:2:2, etc.), which specifies where and how often each component of the image is sampled.
• allocates a certain number of bits to represent the component samples, and positions those samples along with possible padding in memory. Each sample is an unsigned number.

A colorspace

• determines the color of each of the components. two choices:

 Our Component Number "rgba" color set "vyua" color set (meaningful only in this document) 1 2 3 4 r g b a v / Cr y u / Cb a

• specifies a canonical minimum and maximum value for each component. There are two choices (full-range vs. headroom-range), described in The Colorspaces below.

See The Colorspaces below for further information about color set and range, and how to identify which

In most SGI libraries, a single token encodes both colorspace and packing. For the VL of divo and beyond, the two parameters are specified separately (using VL_PACKING and VL_COLORSPACE).

## Packings

### How to Read the Packing Diagrams

</a> In the diagrams below,

• As you move from left to right along the diagram,
• Each byte goes from the most significant bit to the least significant bit.
• The bytes increase in memory address by 1.
• Component samples go from most significant bit to least significant bit.
• We show the smallest repeating spatial pattern of component samples that is a multiple of 8 bits wide.
• No additional padding or alignment is to be inferred. For example, this 24-bit-per-pixel diagram indicates 3-byte quantities packed together in memory. The values are not padded out to 32 bit boundaries.
• When an "x" ("don't care") appears in a bit of the diagram, it means:
• Readers may get any garbage in the bit.
• Writers may leave the bit as garbage.
• When a "0" appears in a bit of the diagram, it means:
• Readers may assume the bit is zero.
• Writers must zero out the bit.
• Exception: writers in a memory-to-video VL path may leave the bit as garbage.
• The packing really defines a bit layout for the abstract components 1, 2, 3, 4, but for convenience we have filled the component slots with the "rgba" or "vyua" color set where appropriate. See The Colorspaces below for more information.
• For packings which use 4:2:2 or 4:2:0 sampling, we also show the spatial location of each component sample. We indicate "left" and "right" for 4:2:2, and "top left," "top right," "bottom left," "bottom right," and "center" for 4:2:0. Our diagrams assume row-major, left-to-right ordering of pixels in memory.
• Following each packing diagram is a list of comments and library tokens which refer to that packing. We list the color set ("rgba" or "vyua") and the library ("VL," "OpenGL," "IRIS GL," "DM," or "CL") for each library token. "DM" refers to the tokens in `/usr/lib/dmedia/dm_image.h`, which are used by several libraries (libdmedia (dmParams, dmIC, dmColor), libmoviefile, libmovieplay, and others). See <a href="#colorspaces">The Colorspaces</a> below for more information.
• We indicate which packings are supported by which VL devices. "Supported by xxx hardware" means the xxx device natively transfers data of that packing in real-time. "Supported by xxx software" means the xxx device's VL software implementation will automatically convert pixels from a native device format into that packing, which may or may not happen in real time.

### Pixel Packings, Sorted by Width

</a>

#### 8 Bit Pixel Packings

Pixel 1
Byte 1
yyyyyyyy
• (vyua) Monochrome/luma-only signal
• (vyua) Supported by vino hardware
• (vyua) Supported by ev1 software
• (vyua) Supported by ev3 software for single-link i/o
• (vyua) Supported by divo hardware
• (vyua) (DM) DM_IMAGE_PACKING_LUMINANCE
• (vyua) (CL) CL_FORMAT_GRAYSCALE
• (vyua) (VL) VL_PACKING_4_8 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_Y_8_P
• (vyua) (OpenGL) GL_LUMINANCE GL_UNSIGNED_BYTE
• (vyua) (IRIS GL) PM_LUMINANCE PM_UNSIGNED_BYTE on RealityEngine

Pixel 1
Byte 1
bbgggrrr
• (rgba) Supported by vino hardware
• (rgba) Supported by Newport (indy) graphics and XL graphics hardware
• (rgba) Supported by ev1 software
• (rgba) Supported by ev3 software for single-link i/o
• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_BGR233
• (rgba) (CL) CL_FORMAT_BGR233
• (rgba) (VL) VL_PACKING_R444_332 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RGB_332_P
• (rgba) (IRIS GL) PM_SIZE=9 on Newport, XL

Pixel 1
Byte 1
rrrbbggg
• (rgba) Obsolete: used with Indigo Entry graphics and Starter Video.
• (rgba) Pixmode man page incorrectly describes this packing.
• (rgba) (DM) DM_IMAGE_PACKING_RBG323
• (rgba) (CL) CL_FORMAT_RBG323
• (rgba) (VL) VL_PACKING_X444_332 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RBG_323
• (rgba) (IRIS GL) PM_SIZE=8 on Indigo Entry

Pixel 1
Byte 1
rrrgggbb
• (rgba) Supported by O2 (CRM) graphics
• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_RGB332
• (rgba) (VL) VL_PACKING_444_332 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (OpenGL) GL_RGB GL_UNSIGNED_BYTE_3_3_2_EXT

#### 12 Bit Pixel Packings

Pixels 1-4
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6
uuuuuuuuyyyyyyyyvvvvvvvvyyyyyyyyyyyyyyyyyyyyyyyy
center top left center top right bottom left bottom right
• (vyua) 4:2:0 sampling as in MPEG and H.261
• (vyua) the CL also has a 4:2:0 packing: check out CL_FORMAT_YCbCr422DC.

#### 16 Bit Pixel Packings

Pixel 1
Byte 1Byte 2
yyyyyyyyaaaaaaaa
• (vyua) Luminance/Alpha packing supported by colorspace library and GL
• (vyua) (DM) DM_IMAGE_PACKING_LUMINANCE_ALPHA
• (vyua) (OpenGL) GL_LUMINANCE_ALPHA GL_UNSIGNED_BYTE
• (vyua) (IRIS GL) PM_LUMINANCEA PM_UNSIGNED_BYTE on RealityEngine

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4
vvvvvvvvyyyyyyyyuuuuuuuuyyyyyyyy
left right
• (vyua) Rarely used. 4:2:2 sampling.
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_242_8 + VL_COLORSPACE_{CCIR,YUV}

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4
uuuuuuuuyyyyyyyyvvvvvvvvyyyyyyyy
left right
• (vyua) Most commonly used <a href="#4:2:2">4:2:2</a> packing.
• (vyua) Supported by vino hardware
• (vyua) Supported by ev1 software
• (vyua) Supported by ev3 hardware for single link i/o
• (vyua) Supported by sirius hardware
• (vyua) Supported by mvp hardware
• (vyua) Supported by divo hardware
• (vyua) Supported by O2 (CRM) graphics hardware. For OpenGL examples, check out <a href="/web/19970616230543/http://reality.sgi.com/cpirazzi_esd/lg/ogl.video.html">Displaying In-Memory Video using OpenGL</a> and <a href="/web/19970616230543/http://reality.sgi.com/cpirazzi_esd/lg/dmbuffer/render_on_video.html">Rendering graphics onto video.</a>
• (vyua) (DM) DM_IMAGE_PACKING_CbYCrY
• (vyua) (CL) CL_FORMAT_YCbCr422
• (vyua) (VL) VL_PACKING_R242_8 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_YVYU_422_8
• (vyua) (CL) CL_FORMAT_YCbCr422DC: actually a <a href="#4:2:0">4:2:0</a> packing. <a href="420.html">Click here</a> for info.
• (vyua) (OpenGL) GL_YCRCB_422_SGIX GL_UNSIGNED_BYTE

Pixel 1
Byte 1Byte 2
arrrrrgggggbbbbb
• (rgba) Supported by O2 (CRM) graphics hardware for pbuffers and textures, but not glDrawPixels(). Even though the token DM_IMAGE_PACKING_XRGB1555 is used, the upper bit is really alpha.
• (rgba) Supported by mvp hardware
• (rgba) Supported by divo hardware
• (rgba) Quicktime file 16-bit uncompressed format with alpha.
• (rgba) (DM) DM_IMAGE_PACKING_XRGB1555
• (rgba) (VL) VL_PACKING_X4444_5551 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_ARGB_1555

<a name="Packing 10">

Pixel 1
Byte 1Byte 2
rrrrrgggggbbbbba

</a>

• (rgba) Apparently Useless. Not supported by any graphics or video hardware.
• (rgba) (DM) DM_IMAGE_PACKING_RGBA5551
• (rgba) (OpenGL) GL_RGBA GL_UNSIGNED_SHORT_5_5_5_1_EXT

<a name="565"> <a name="Packing 11">

Pixel 1
Byte 1Byte 2
rrrrrggggggbbbbb

</a>

• (rgba) Supposedly common in the PC world.
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_444_5_6_5 + VL_COLORSPACE_{RGB,RP175}

</a>

#### 24 Bit Pixel Packings

<a name="Packing 12">

Pixel 1
Byte 1Byte 2Byte 3
rrrrrrrrggggggggbbbbbbbb
vvvvvvvvyyyyyyyyuuuuuuuu

</a>

• (rgba) Supported by divo hardware
• (rgba) Supported by Octane ev3 hardware for dual-link RGB i/o
• (rgba) (DM) DM_IMAGE_PACKING_RGB
• (rgba) (VL) VL_PACKING_444_8 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_BGR_8_P
• (rgba) (OpenGL) GL_RGB GL_UNSIGNED_BYTE
• (rgba) (IRIS GL) PM_RGB PM_UNSIGNED_BYTE on RealityEngine
• (vyua) Supported by ev3 hardware for dual-link YCrCb i/o
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_444_8 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_UYV_8_P

<a name="24example"> <a name="Packing 13">

Pixel 1
Byte 1Byte 2Byte 3
bbbbbbbbggggggggrrrrrrrr
uuuuuuuuyyyyyyyyvvvvvvvv

</a>

• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_BGR
• (rgba) (CL) CL_FORMAT_BGR
• (rgba) (VL) VL_PACKING_R444_8 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RGB_8_P
• (rgba) (IRIS GL) PM_BGR PM_UNSIGNED_BYTE on RealityEngine
• (vyua) Supported by divo hardware
• (vyua) (DM) DM_IMAGE_PACKING_CbYCr
• (vyua) (CL) CL_FORMAT_YCbCr
• (vyua) (VL) VL_PACKING_R444_8 + VL_COLORSPACE_{CCIR,YUV}

</a> <a name="Packing 14">

Pixel 1
Byte 1Byte 2Byte 3
rrrrrrggggggbbbbbbaaaaaa
vvvvvvyyyyyyuuuuuuaaaaaa

</a>

• (rgba) 6 bits per pixel
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_4444_6 + VL_COLORSPACE_{RGB,RP175}
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_4444_6 + VL_COLORSPACE_{CCIR,YUV}

#### OpenGL-Like 32-bit Packings:

```<a name="opengl">
```

<a name="Packing 15">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
rrrrrrrrggggggggbbbbbbbbaaaaaaaa
vvvvvvvvyyyyyyyyuuuuuuuuaaaaaaaa

</a>

• (rgba) Default OpenGL Packing
• (rgba) Supported by ev1 software (A is 0)
• (rgba) Supported by ev3 software for single-link i/o (A is 0)
• (rgba) Supported by ev3 hardware for dual-link RGBA i/o
• (rgba) Supported by sirius hardware
• (rgba) Supported by mvp hardware (A is a settable constant)
• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_RGBA
• (rgba) (VL) VL_PACKING_4444_8 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_ABGR_8
• (rgba) (OpenGL) GL_RGBA GL_UNSIGNED_BYTE (the default)
• (rgba) (IRIS GL) PM_RGBA PM_UNSIGNED_BYTE on RealityEngine
• (vyua) Supported by ev3 hardware for dual-link YCrCbA i/o
• (vyua) Supported by sirius hardware
• (vyua) Supported by mvp hardware (A is a settable constant)
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_4444_8 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_AUYV_4444_8 or VL_PACKING_AUYV_8

```</a>
```

<a name="Packing 16">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
rrrrrrrrggggggggbbbbbbbbxxxxxxxx

</a>

• (rgba) Use DM_IMAGE_PACKING_RGBA instead of DM_IMAGE_PACKING_RGBX unless you specifically want to inform a piece of software (such as dmColor) not to spend processing time on the alpha channel.
• (rgba) (DM) DM_IMAGE_PACKING_RGBX

#### IRIS GL-Like 32-bit Packings:

```<a name="irisgl">
<a name="VL_PACKING_RGBA_8">
<a name="VL_PACKING_YUVA_4444_8">
```

<a name="Packing 17">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
aaaaaaaabbbbbbbbggggggggrrrrrrrr
aaaaaaaauuuuuuuuyyyyyyyyvvvvvvvv

</a>

• (rgba) Default IRIS GL Packing
• (rgba) Supported by vino hardware (A is a settable constant)
• (rgba) Supported by ev1 software (A is 0)
• (rgba) Supported by ev3 software for single-link i/o (A is 0)
• (rgba) Supported by ev3 hardware for dual-link RGBA i/o
• (rgba) Supported by sirius hardware
• (rgba) Supported by mvp hardware (A is a settable constant)
• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_ABGR
• (rgba) (CL) CL_FORMAT_ABGR
• (rgba) (VL) VL_PACKING_R4444_8 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RGBA_8
• (rgba) (OpenGL) GL_ABGR_EXT GL_UNSIGNED_BYTE
• (rgba) (IRIS GL) PM_ABGR PM_UNSIGNED_BYTE (the default)
• (vyua) Supported by ev3 hardware for dual-link YCrCbA i/o. Non-full-size (cropped or zoomed) output may have green padding on some Octane ev3 models.
• (vyua) Supported by sirius hardware
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R4444_8 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_YUVA_4444_8

```</a>
</a>
</a>
```

<a name="Packing 18">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
xxxxxxxxbbbbbbbbggggggggrrrrrrrr
xxxxxxxxuuuuuuuuyyyyyyyyvvvvvvvv

</a>

• (rgba) Use DM_IMAGE_PACKING_ABGR instead of DM_IMAGE_PACKING_XBGR unless you specifically want to inform a piece of software (such as dmColor) not to spend processing time on the alpha channel.
• (rgba) Often interchangeable with <a href="#irisgl">Default IRIS GL Packing</a>
• (rgba) Supported by ev1 software
• (rgba) Supported by ev3 software for single-link i/o
• (rgba) Supported by ev3 hardware for dual-link RGBA i/o
• (rgba) Supported by sirius hardware
• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_XBGR
• (rgba) (CL) CL_FORMAT_XBGR
• (rgba) (VL) VL_PACKING_R0444_8 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RGB_8
• (vyua) Supported by ev3 hardware for dual-link YCrCbA i/o
• (vyua) Supported by sirius hardware
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R0444_8 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_YUV_444_8

#### Unusual 32-bit Packings:

<a name="Packing 19">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
aaaaaaaarrrrrrrrggggggggbbbbbbbb

</a>

• (rgba) Quicktime 32-bit uncompressed format with alpha.
• (rgba) (DM) DM_IMAGE_PACKING_ARGB

<a name="Packing 20">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
xxxxxxxxrrrrrrrrggggggggbbbbbbbb
xxxxxxxxvvvvvvvvyyyyyyyyuuuuuuuu

</a>

• (rgba) Quicktime file 32-bit uncompressed format without alpha
• (rgba) Supported by divo hardware
• (rgba) (DM) DM_IMAGE_PACKING_XRGB
• (rgba) (VL) VL_PACKING_0444_8 + VL_COLORSPACE_{RGB,RP175}
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_0444_8 + VL_COLORSPACE_{CCIR,YUV}

<a name="Packing 21">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
uuuuuuuuyyyyyyyyvvvvvvvvaaaaaaaa

</a>

• (vyua) Rarely Used. Component order not compatible with any hardware.
• <a href="#4:4:4">4:4:4:4</a> sampled YCrCb with alpha.
• (vyua) (DM) DM_IMAGE_PACKING_CbYCrA

#### <a href="#4:4:4">4:4:4:4</a> 10_10_10_2 32-bit Packings:

<a name="Packing 22">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
rrrrrrrrrrggggggggggbbbbbbbbbbaa
vvvvvvvvvvyyyyyyyyyyuuuuuuuuuuaa

</a>

• (rgba) Supported by sirius hardware
• (rgba) Supported by divo hardware
• (rgba) Supported by Octane ev3 hardware for dual-link RGBA i/o
• (rgba) (VL) VL_PACKING_4444_10_10_10_2 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_A_2_BGR_10
• (rgba) (OpenGL) GL_RGBA GL_UNSIGNED_INT_10_10_10_2_EXT
• (vyua) Supported by sirius hardware
• (vyua) Supported by divo hardware
• (vyua) Supported by Octane ev3 hardware for dual-link YCrCbA i/o
• (vyua) (VL) VL_PACKING_4444_10_10_10_2 + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_A_2_UYV_10

<a name="Packing 23">

Pixel 1
Byte 1Byte 2Byte 3Byte 4
aabbbbbbbbbbggggggggggrrrrrrrrrr
aauuuuuuuuuuyyyyyyyyyyvvvvvvvvvv

</a>

• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_R4444_10_10_10_2 + VL_COLORSPACE_{RGB,RP175}
• (rgba) (OpenGL) GL_ABGR_EXT GL_UNSIGNED_INT_10_10_10_2_EXT
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R4444_10_10_10_2 + VL_COLORSPACE_{CCIR,YUV}

#### <a href="#4:2:2">4:2:2:4</a> 10_10_10_2 32-bit Packings:

<a name="Packing 24">

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
vvvvvvvvvvyyyyyyyyyyaaaaaaaaaa00uuuuuuuuuuyyyyyyyyyyaaaaaaaaaa00
left 00left right 00

</a>

• (vyua) <a href="#4:2:2">4:2:2:4 sampling</a> (2 bits of A)
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_2424_10_10_10_2Z + VL_COLORSPACE_{CCIR,YUV}

<a name="Packing 25">

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
uuuuuuuuuuyyyyyyyyyyaaaaaaaaaa00vvvvvvvvvvyyyyyyyyyyaaaaaaaaaa00
left 00left right 00

</a>

• (vyua) <a href="#4:2:2">4:2:2:4 sampling</a> (2 bits of A)
• (vyua) Supported by ev3 hardware for dual-link YCrCbA i/o. Note YCrCb data is 4:2:2---only alpha is extracted from second link.
• (vyua) Supported by sirius hardware
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R2424_10_10_10_2Z + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_AYU_AYV_10

#### <a href="#4:2:2">4:2:2</a> 10_in_16 32-bit Packings:

<a name="Packing 26">

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
vvvvvvvvvv000000yyyyyyyyyy000000uuuuuuuuuu000000yyyyyyyyyy000000
left 000000left 000000left 000000right 000000

</a>

• (vyua) <a href="#4:2:2">4:2:2 sampling</a>
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_242_10_in_16_L + VL_COLORSPACE_{CCIR,YUV}

<a name="Packing 27">

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
000000vvvvvvvvvv000000yyyyyyyyyy000000uuuuuuuuuu000000yyyyyyyyyy
000000left 000000left 000000left 000000right

</a>

• (vyua) <a href="#4:2:2">4:2:2 sampling</a>
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_242_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

<a name="Packing 28">

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
uuuuuuuuuu000000yyyyyyyyyy000000vvvvvvvvvv000000yyyyyyyyyy000000
left 000000left 000000left 000000right 000000

</a>

• (vyua) <a href="#4:2:2">4:2:2 sampling</a>
• (vyua) Supported by ev3 hardware for single-link i/o
• (vyua) Supported by mvp hardware
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R242_10_in_16_L + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_YVYU_422_10

<a name="Packing 29">

Pixels 1-2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
000000uuuuuuuuuu000000yyyyyyyyyy000000vvvvvvvvvv000000yyyyyyyyyy
000000left 000000left 000000left 000000right

</a>

• (vyua) <a href="#4:2:2">4:2:2 sampling</a>
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R242_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

#### 36 Bit Pixel Packings

<a name="Packing 30">

Pixel 1Pixel 2
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8Byte 9
rrrrrrrrrrrrggggggggggggbbbbbbbbbbbbrrrrrrrrrrrrggggggggggggbbbbbbbbbbbb
vvvvvvvvvvvvyyyyyyyyyyyyuuuuuuuuuuuuvvvvvvvvvvvvyyyyyyyyyyyyuuuuuuuuuuuu

</a>

• (rgba) 12 bits per component.
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_444_12 + VL_COLORSPACE_{RGB,RP175}
• XXX is this what IRIS GL _12 means?
• (rgba) (IRIS GL) PM_RGB PM_UNSIGNED_SHORT_12 on RealityEngine
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_444_12 + VL_COLORSPACE_{CCIR,YUV}

#### 48 Bit Pixel Packings

<a name="Packing 31">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6
rrrrrrrrrrrrggggggggggggbbbbbbbbbbbbaaaaaaaaaaaa
vvvvvvvvvvvvyyyyyyyyyyyyuuuuuuuuuuuuaaaaaaaaaaaa

</a>

• (rgba) 12 bits per component.
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_4444_12 + VL_COLORSPACE_{RGB,RP175}
• XXX is this what IRIS GL _12 means?
• (rgba) (IRIS GL) PM_RGBA PM_UNSIGNED_SHORT_12 on RealityEngine
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_4444_12 + VL_COLORSPACE_{CCIR,YUV}

#### 64 Bit Pixel Packings

<a name="Packing 32">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
rrrrrrrrrr000000gggggggggg000000bbbbbbbbbb000000aaaaaaaaaa000000
vvvvvvvvvv000000yyyyyyyyyy000000uuuuuuuuuu000000aaaaaaaaaa000000

</a>

• (rgba) Supported by ev3 hardware for dual-link RGBA i/o
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_4444_10_in_16_L + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_ABGR_10
• (vyua) Supported by ev3 hardware for dual-link YCrCb i/o
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_4444_10_in_16_L + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_AUYV_4444_10

<a name="Packing 33">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
000000rrrrrrrrrr000000gggggggggg000000bbbbbbbbbb000000aaaaaaaaaa
000000vvvvvvvvvv000000yyyyyyyyyy000000uuuuuuuuuu000000aaaaaaaaaa

</a>

• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_4444_10_in_16_R + VL_COLORSPACE_{RGB,RP175}
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_4444_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

```<a name="VL_PACKING_RGBA_10">
```

<a name="Packing 34">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
aaaaaaaaaa000000bbbbbbbbbb000000gggggggggg000000rrrrrrrrrr000000
aaaaaaaaaa000000uuuuuuuuuu000000yyyyyyyyyy000000vvvvvvvvvv000000

</a>

• (rgba) Supported by ev3 hardware for dual-link RGBA i/o
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_R4444_10_in_16_L + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RGBA_10
• (vyua) Supported by ev3 hardware for dual-link YCrCbA i/o. Non-full-size (cropped or zoomed) output may have green padding on some Octane ev3 models.
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R4444_10_in_16_L + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_YUVA_4444_10

```</a>
```

<a name="Packing 35">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
000000aaaaaaaaaa000000bbbbbbbbbb000000gggggggggg000000rrrrrrrrrr
000000aaaaaaaaaa000000uuuuuuuuuu000000yyyyyyyyyy000000vvvvvvvvvv

</a>

• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_R4444_10_in_16_R + VL_COLORSPACE_{RGB,RP175}
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R4444_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

<a name="Packing 36">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
xxxxxxxxxx000000bbbbbbbbbb000000gggggggggg000000rrrrrrrrrr000000
xxxxxxxxxx000000uuuuuuuuuu000000yyyyyyyyyy000000vvvvvvvvvv000000

</a>

• (rgba) Supported by ev3 hardware for dual-link RGBA i/o
• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_R4440_10_in_16_L + VL_COLORSPACE_{RGB,RP175}
• (rgba) (VL) VL_PACKING_RGB_10
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R4440_10_in_16_L + VL_COLORSPACE_{CCIR,YUV}
• (vyua) (VL) VL_PACKING_YUV_444_10

<a name="Packing 37">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
000000xxxxxxxxxx000000bbbbbbbbbb000000gggggggggg000000rrrrrrrrrr
000000xxxxxxxxxx000000uuuuuuuuuu000000yyyyyyyyyy000000vvvvvvvvvv

</a>

• (rgba) Supported by divo hardware
• (rgba) (VL) VL_PACKING_R4440_10_in_16_R + VL_COLORSPACE_{RGB,RP175}
• (vyua) Supported by divo hardware
• (vyua) (VL) VL_PACKING_R4440_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

<a name="Packing 38">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
aaaaaaaaaaaa0000bbbbbbbbbbbb0000gggggggggggg0000rrrrrrrrrrrr0000

</a>

• (rgba) Supported by divo hardware, for use with <a href="#extended">extended RGB components</a>
• (rgba) (VL) VL_PACKING_R4444_12_in_16_L + VL_COLORSPACE_{RGB,RP175}
• (rgba) (IRIS GL) PM_SIZE=64 on RealityEngine

<a name="Packing 39">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
0000aaaaaaaaaaaa0000bbbbbbbbbbbb0000gggggggggggg0000rrrrrrrrrrrr

</a>

• (rgba) Supported by divo hardware, for use with <a href="#extended">extended RGB components</a>
• (rgba) (VL) VL_PACKING_R4444_12_in_16_R + VL_COLORSPACE_{RGB,RP175}

<a name="Packing 40">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
aaaaaaaaaaaaa000bbbbbbbbbbbbb000ggggggggggggg000rrrrrrrrrrrrr000

</a>

• (rgba) Supported by divo hardware, for use with <a href="#extended">extended RGB components</a>
• (rgba) (VL) VL_PACKING_R4444_13_in_16_L + VL_COLORSPACE_{RGB,RP175}

<a name="Packing 41">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
000aaaaaaaaaaaaa000bbbbbbbbbbbbb000ggggggggggggg000rrrrrrrrrrrrr

</a>

• (rgba) Supported by divo hardware, for use with <a href="#extended">extended RGB components</a>
• (rgba) (VL) VL_PACKING_R4444_13_in_16_R + VL_COLORSPACE_{RGB,RP175}

<a name="Packing 42">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
rrrrrrrrrrrrrrrrggggggggggggggggbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaa

</a>

• (rgba) may be interchangeable with VL _L tokens above depending on video device
• (rgba) (OpenGL) GL_RGBA GL_UNSIGNED_SHORT
• (rgba) (IRIS GL) PM_RGBA PM_UNSIGNED_SHORT on RealityEngine

<a name="Packing 43">

Pixel 1
Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7Byte 8
aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbggggggggggggggggrrrrrrrrrrrrrrrr

</a>

• (rgba) may be interchangeable with VL _L tokens above depending on video device
• (rgba) (OpenGL) GL_ABGR_EXT GL_UNSIGNED_SHORT
• (rgba) (IRIS GL) PM_ABGR PM_UNSIGNED_SHORT on RealityEngine

<a name="bylibrary">

### The Packings, Sorted by Library

</a>

#### OpenGL Pixel Packings

OpenGL can represent many more packings than we can list. The OpenGL packings which overlap with the other library packings, where:

• GL_UNPACK_SWAP_BYTES is disabled.
• GL_c_SCALE at 1.0 and GL_c_BIAS at 0.0. These can be used to convert between full-range and headroom-range. See <a href="#colorspaces">The Colorspaces</a> below.
• GL_MAP_COLOR is false. This can also be used to do the range conversion.

are:

• <a href="#Packing 1">GL_LUMINANCE GL_UNSIGNED_BYTE</a>
• <a href="#Packing 4">GL_RGB GL_UNSIGNED_BYTE_3_3_2_EXT</a>
• <a href="#Packing 6">GL_LUMINANCE_ALPHA GL_UNSIGNED_BYTE</a>
• <a href="#Packing 8">GL_YCRCB_422_SGIX GL_UNSIGNED_BYTE</a>
• <a href="#Packing 10">GL_RGBA GL_UNSIGNED_SHORT_5_5_5_1_EXT</a>
• <a href="#Packing 12">GL_RGB GL_UNSIGNED_BYTE</a>
• <a href="#Packing 15">GL_RGBA GL_UNSIGNED_BYTE (the default)</a>
• <a href="#Packing 17">GL_ABGR_EXT GL_UNSIGNED_BYTE</a>
• <a href="#Packing 22">GL_RGBA GL_UNSIGNED_INT_10_10_10_2_EXT</a>
• <a href="#Packing 23">GL_ABGR_EXT GL_UNSIGNED_INT_10_10_10_2_EXT</a>
• <a href="#Packing 42">GL_RGBA GL_UNSIGNED_SHORT</a>
• <a href="#Packing 43">GL_ABGR_EXT GL_UNSIGNED_SHORT</a>

#### IRIS GL Pixel Packings

IRIS GL can represent many more packings than we can list. The IRIS GL packings which overlap with the other library packings, where:

• PM_SHIFT is 0.
• PM_TTOB and PM_RTOL are disabled.
• PM_ZDATA is 0.

are

• <a href="#Packing 1">PM_LUMINANCE PM_UNSIGNED_BYTE on RealityEngine</a>
• <a href="#Packing 2">PM_SIZE=9 on Newport, XL</a>
• <a href="#Packing 3">PM_SIZE=8 on Indigo Entry</a>
• <a href="#Packing 6">PM_LUMINANCEA PM_UNSIGNED_BYTE on RealityEngine</a>
• <a href="#Packing 12">PM_RGB PM_UNSIGNED_BYTE on RealityEngine</a>
• <a href="#Packing 13">PM_BGR PM_UNSIGNED_BYTE on RealityEngine</a>
• <a href="#Packing 15">PM_RGBA PM_UNSIGNED_BYTE on RealityEngine</a>
• <a href="#Packing 17">PM_ABGR PM_UNSIGNED_BYTE (the default)</a>
• <a href="#Packing 30">PM_RGB PM_UNSIGNED_SHORT_12 on RealityEngine</a>
• <a href="#Packing 31">PM_RGBA PM_UNSIGNED_SHORT_12 on RealityEngine</a>
• <a href="#Packing 38">PM_SIZE=64 on RealityEngine</a>
• <a href="#Packing 42">PM_RGBA PM_UNSIGNED_SHORT on RealityEngine</a>
• <a href="#Packing 43">PM_ABGR PM_UNSIGNED_SHORT on RealityEngine</a>

#### Digital Media Library (DM) Pixel Packings

This list is complete as of IRIX 6.3:

• <a href="#Packing 1">DM_IMAGE_PACKING_LUMINANCE</a>
• <a href="#Packing 2">DM_IMAGE_PACKING_BGR233</a>
• <a href="#Packing 3">DM_IMAGE_PACKING_RBG323</a>
• <a href="#Packing 4">DM_IMAGE_PACKING_RGB332</a>
• <a href="#Packing 6">DM_IMAGE_PACKING_LUMINANCE_ALPHA</a>
• <a href="#Packing 8">DM_IMAGE_PACKING_CbYCrY</a>
• <a href="#Packing 9">DM_IMAGE_PACKING_XRGB1555</a>
• <a href="#Packing 10">DM_IMAGE_PACKING_RGBA5551</a>
• <a href="#Packing 12">DM_IMAGE_PACKING_RGB</a>
• <a href="#Packing 13">DM_IMAGE_PACKING_BGR</a>
• <a href="#Packing 13">DM_IMAGE_PACKING_CbYCr</a>
• <a href="#Packing 15">DM_IMAGE_PACKING_RGBA</a>
• <a href="#Packing 16">DM_IMAGE_PACKING_RGBX</a>
• <a href="#Packing 17">DM_IMAGE_PACKING_ABGR</a>
• <a href="#Packing 18">DM_IMAGE_PACKING_XBGR</a>
• <a href="#Packing 19">DM_IMAGE_PACKING_ARGB</a>
• <a href="#Packing 20">DM_IMAGE_PACKING_XRGB</a>
• <a href="#Packing 21">DM_IMAGE_PACKING_CbYCrA</a>

#### Compression Library (CL) Pixel Packings

This list is complete as of IRIX 6.3:

• <a href="#Packing 1">CL_FORMAT_GRAYSCALE</a>
• <a href="#Packing 2">CL_FORMAT_BGR233</a>
• <a href="#Packing 3">CL_FORMAT_RBG323</a>
• <a href="#Packing 8">CL_FORMAT_YCbCr422</a>
• <a href="#Packing 8">CL_FORMAT_YCbCr422DC: actually a <a href="#4:2:0">4:2:0</a> packing. <a href="420.html">Click here</a> for info.</a>
• <a href="#Packing 13">CL_FORMAT_BGR</a>
• <a href="#Packing 13">CL_FORMAT_YCbCr</a>
• <a href="#Packing 17">CL_FORMAT_ABGR</a>
• <a href="#Packing 18">CL_FORMAT_XBGR</a>

This list is complete as of IRIX 6.3. Here are the ones we document:

• <a href="#Packing 1">VL_PACKING_Y_8_P</a>
• <a href="#Packing 2">VL_PACKING_RGB_332_P</a>
• <a href="#Packing 3">VL_PACKING_RBG_323</a>
• <a href="#Packing 8">VL_PACKING_YVYU_422_8</a>
• <a href="#Packing 9">VL_PACKING_ARGB_1555</a>
• <a href="#Packing 12">VL_PACKING_BGR_8_P</a>
• <a href="#Packing 12">VL_PACKING_UYV_8_P</a>
• <a href="#Packing 13">VL_PACKING_RGB_8_P</a>
• <a href="#Packing 15">VL_PACKING_ABGR_8</a>
• <a href="#Packing 15">VL_PACKING_AUYV_4444_8 or VL_PACKING_AUYV_8</a>
• <a href="#Packing 17">VL_PACKING_RGBA_8</a>
• <a href="#Packing 17">VL_PACKING_YUVA_4444_8</a>
• <a href="#Packing 18">VL_PACKING_RGB_8</a>
• <a href="#Packing 18">VL_PACKING_YUV_444_8</a>
• <a href="#Packing 22">VL_PACKING_A_2_BGR_10</a>
• <a href="#Packing 22">VL_PACKING_A_2_UYV_10</a>
• <a href="#Packing 25">VL_PACKING_AYU_AYV_10</a>
• <a href="#Packing 28">VL_PACKING_YVYU_422_10</a>
• <a href="#Packing 32">VL_PACKING_ABGR_10</a>
• <a href="#Packing 32">VL_PACKING_AUYV_4444_10</a>
• <a href="#Packing 34">VL_PACKING_RGBA_10</a>
• <a href="#Packing 34">VL_PACKING_YUVA_4444_10</a>
• <a href="#Packing 36">VL_PACKING_RGB_10</a>
• <a href="#Packing 36">VL_PACKING_YUV_444_10</a>

Here are the remaining tokens:

• VL_PACKING_VUY_411_SV - obsolete Starter Video packing
• VL_PACKING_RGB_332 - obsolete: use <a href="#332_P">VL_PACKING_RGB_332_P</a>
• VL_PACKING_BGR_332 - obsolete: use <a href="#332_P">VL_PACKING_RGB_332_P</a>
• VL_PACKING_RGB_332_IP - obsolete: use <a href="#332_P">VL_PACKING_RGB_332_P</a>
• VL_PACKING_BGR_332_P - obsolete: use <a href="#332_P">VL_PACKING_RGB_332_P</a>
• VL_PACKING_BGR_332_IP - obsolete: use use <a href="#332_P">VL_PACKING_RGB_332_P</a>
• VL_PACKING_RGB_565 - obsolete: use <a href="#565">VL_PACKING_444_5_6_5</a>
• VL_PACKING_RGB_565_P - obsolete: use <a href="#565">VL_PACKING_444_5_6_5</a>
• VL_PACKING_RGB_565_IP - obsolete: use <a href="#565">VL_PACKING_444_5_6_5</a>
• VL_PACKING_Y_8_IP - obsolete: use <a href="#Y_8_P">VL_PACKING_Y_8_P</a>

#### Memory-Only (divo and Beyond) VL Pixel Packings

• <a href="#Packing 1">VL_PACKING_4_8</a>
• <a href="#Packing 2">VL_PACKING_R444_332</a>
• <a href="#Packing 3">VL_PACKING_X444_332</a>
• <a href="#Packing 4">VL_PACKING_444_332</a>
• <a href="#Packing 7">VL_PACKING_242_8</a>
• <a href="#Packing 8">VL_PACKING_R242_8</a>
• <a href="#Packing 9">VL_PACKING_X4444_5551</a>
• <a href="#Packing 11">VL_PACKING_444_5_6_5</a>
• <a href="#Packing 12">VL_PACKING_444_8</a>
• <a href="#Packing 13">VL_PACKING_R444_8</a>
• <a href="#Packing 14">VL_PACKING_4444_6</a>
• <a href="#Packing 15">VL_PACKING_4444_8</a>
• <a href="#Packing 17">VL_PACKING_R4444_8</a>
• <a href="#Packing 18">VL_PACKING_R0444_8</a>
• <a href="#Packing 20">VL_PACKING_0444_8</a>
• <a href="#Packing 22">VL_PACKING_4444_10_10_10_2</a>
• <a href="#Packing 23">VL_PACKING_R4444_10_10_10_2</a>
• <a href="#Packing 24">VL_PACKING_2424_10_10_10_2Z</a>
• <a href="#Packing 25">VL_PACKING_R2424_10_10_10_2Z</a>
• <a href="#Packing 26">VL_PACKING_242_10_in_16_L</a>
• <a href="#Packing 27">VL_PACKING_242_10_in_16_R</a>
• <a href="#Packing 28">VL_PACKING_R242_10_in_16_L</a>
• <a href="#Packing 29">VL_PACKING_R242_10_in_16_R</a>
• <a href="#Packing 30">VL_PACKING_444_12</a>
• <a href="#Packing 31">VL_PACKING_4444_12</a>
• <a href="#Packing 32">VL_PACKING_4444_10_in_16_L</a>
• <a href="#Packing 33">VL_PACKING_4444_10_in_16_R</a>
• <a href="#Packing 34">VL_PACKING_R4444_10_in_16_L</a>
• <a href="#Packing 35">VL_PACKING_R4444_10_in_16_R</a>
• <a href="#Packing 36">VL_PACKING_R4440_10_in_16_L</a>
• <a href="#Packing 37">VL_PACKING_R4440_10_in_16_R</a>
• <a href="#Packing 38">VL_PACKING_R4444_12_in_16_L</a>
• <a href="#Packing 39">VL_PACKING_R4444_12_in_16_R</a>
• <a href="#Packing 40">VL_PACKING_R4444_13_in_16_L</a>
• <a href="#Packing 41">VL_PACKING_R4444_13_in_16_R</a>

<a name="weirdtokens">

### Where Do the Memory-Only VL_PACKING Names Come From?

</a> The naming scheme for the new memory-only VL_PACKING tokens (found in the VL of divo and beyond) works like this:

• Direction:
• Normal packing order is component 1, 2, 3, 4 (read from left to right in the diagrams in <a href="#colorspaces">The Colorspaces</a> below). Direction is empty.
• Some packings have component order 4, 3, 2, 1. Direction is R for "reverse."
• Some packings have neither component order. Direction is X.
• Sampling (video industry terminology also shown):
• 4: ("vyua" color set only) only component 2 (Y).
• 444: <a href="#4:4:4">4:4:4</a> sampling: components 1, 2, 3, sampled once per pixel.
• 4444: <a href="#4:4:4">4:4:4:4</a> sampling: components 1, 2, 3, 4, sampled once per pixel.
• 4440 or 0444: <a href="#4:4:4">4:4:4</a> sampling: same as 4444 except the space for component 4 (alpha) is filled with zeroes.
• 242: ("vyua" color set only) <a href="#4:2:2">4:2:2</a> sampling: component 2 (Y) sampled once per pixel, component 1 and 3 (Cr and Cb) sampled every 2 pixels.
• 2424: ("vyua" color set only) <a href="#4:2:2">4:2:2:4</a> sampling: component 2 (Y) and 4 (alpha) sampled once per pixel, component 1 and 3 (Cr and Cb) sampled every 2 pixels.
• Detail: indicates how many bits are allocated to each component and whether the components are padded out to byte boundaries. Component widths listed in order (component 1, 2, 3, 4). Specify padded components with "n_in_m." If all components have same width and padding, specify only one width and padding.
• Padding: packings in which components are padded either left- or right-justify each n-bit component into an m-bit cell. Packings where the components occur in the high order bits of the cells end in _L. Packings where components occur in the low order bits of the cells end in _R. Padding is empty for packings without padding.

<a name="extended">

### Extended RGB Components

</a> A few of the VL-supported packings have components with more than 10 bits per component, which may seem strange since the highest-resolution video signals only carry 10 bits per component. These packings are for use with extended-range components, a feature (soon to be released on Onyx2/divo systems) which is currently beyond the scope of this document. We will add more information about extended-range components when the support is released.

## Sampling Pattern Definitions

<a name="4:4:4">

### 4:4:4 and 4:4:4:4 Sampling

</a> Some of the diagrams indicate 4:4:4 or 4:4:4:4 sampling. This video industry terminology simply means that each of your 3 or 4 components

is sampled at every pixel.

There is no particularly good reason why the terminology is 4:4:4 rather than 8:8:8 or any other N:N:N. N needed to be at least 4 in order to describe 4:1:1.

<a name="4:2:2">

### 4:2:2 and 4:2:2:4 Sampling

</a> Some of the diagrams indicate 4:2:2 sampling. These packings make sense only in the "vyua" colorspaces. It means that for every two pixels, we get two luma samples (two Y's) but only one chroma sample (one sample of Cr and Cb, which together determine the chroma), like this:

<img border="0" src="/web/19970616230543im_/http://reality.sgi.com/cpirazzi_esd/lg/packings/422.gif" align="MIDDLE">

The chroma samples belong at the same instant in space as the left Y sample (the chrominance samples and the left Y are "co-sited"). Our diagrams for 4:2:2 packings show the spatial location of each Y, Cr, or Cb component as "left" or "right." The first pixel of each line is

a "left" pixel.

Converting 4:4:4 video to 4:2:2 video is like converting 44.1kHz audio into 22.05kHz audio: just dropping every other Cr,Cb sample will yield extremely poor results. Real video devices which need to convert between 4:4:4 and 4:2:2 use carefully designed filters. The characteristics of the required filter are specified in ITU-R BT.601-4 (Rec. 601).

4:2:2 sampled packings that also include alpha are called 4:2:2:4. There is one alpha value per pixel, like the Y value.

<a name="4:2:0">

### 4:2:0 Sampling

</a> The MPEG and H.261 video compression standards use 4:2:0 sampling. Like 4:2:2 sampling, 4:2:0 sampling only makes sense for "vyua" packings. In this case, there is one chroma sample (one pair of Cr and Cb) for every four luminance samples (Y), like this:

<img border="0" src="/web/19970616230543im_/http://reality.sgi.com/cpirazzi_esd/lg/packings/420.gif" align="MIDDLE">

The chroma samples occur at the spatial center of four luminance samples. The concept of "pixel" becomes difficult to define! Our diagrams for 4:2:0 packings show the spatial location of each Y, Cr, or Cb component as "top left," "top right," "bottom left," "bottom right," and "center," according to their position in this pattern. The top left luminance sample of the image is a "top left"

sample.

The DM has a 4:2:0 packing called <a href="#dm420">DM_IMAGE_PACKING_CbYCrYYY.</a> The CL has a 4:2:0 packing called <a href="#cl420">CL_FORMAT_YCbCr422DC</a> (for "Duplicate Chroma") which represents 4:2:0 data redundantly as 4:2:2 data. This is what the software MPEG codec uses. <a href="420.html">Click here</a> for an example.

<a name="4:1:1">

### 4:1:1 Sampling

</a> Another subsampling method with similar "compression" as 4:2:0 is 4:1:1. With 4:1:1, four horizontally adjacent Y samples on the same line are paired with one Cr,Cb sample. The Cr,Cb sample and the "leftmost" Y sample are co-sited. The leftmost Y sample of each line is a "leftmost" sample. This method generally looks worse than 4:2:0 at the same cost, and it is not currently used by any SGI

libraries.

## Colorspaces

<a name="colorspaces">

### The Colorspaces

</a> Each component of an image has:

• a color which it represents,
• a canonical minimum value, and
• a canonical maximum value.

Normally, a component stays within the minimum and maximum values, inclusive. For example, for a luma signal such as Y, you can think of these limits as the "black" level and the "peak white" level. Given a component with n bits, there are two possibilities for [minimum value, maximum value]:

• full-range:
• [0, (2^nbits)-1]
• This range provides the maximum resolution for each component.
• Cr and Cb: [(2^n)/16, 15*(2^n)/16]
• Y, A, R, G, B: [(2^n)/16, 235*(2^n)/256]
• This range is defined for 8 and 10 bits in ITU-R BT.601-4 (Rec. 601).
• example: 8-bit components: Cr and Cb: [16, 240]. Y, A, R, G, B: [16, 235].
• example: 10-bit components: Cr and Cb: [64, 960]. Y, A, R, G, B: [64, 940].
• This range provides numerical headroom, which is often useful when processing video images.

There are two sets of colors which are commonly used together:

• RGB ("rgba" in diagrams above): The familiar red, green, and blue, plus alpha.

 Our Component Number Interpretation (meaningful only in this document) 1 2 3 4 r g b a

• YCrCb/YUV ("vyua" in diagrams above): Separate luma and chroma, plus alpha.

 Our Component Number Interpretation (meaningful only in this document) 1 2 3 4 v / Cr y u / Cb a

The most common representation of color from the video world, YCrCb or YUV represents each color by a luma component called Y and two components of chroma, called Cr (or V), and Cb (or U). The luma component is loosely related to "brightness" or "luminance," and the chroma components make up a quantity loosely related to "hue." These components are defined rigorously in ITU-R BT.601-4 (also known as

Rec. 601 and formerly CCIR 601).

When referring to the chroma components, it's probably better to use Cr and Cb than V and U, because the analog NTSC video specification ANSI/SMPTE 170M uses V and U with a slightly different meaning. This document uses the letters "v" and "u" in the diagrams above for typographical convenience.

What color is R, G, B, Y, Cr, or Cb? An excellent book for more information about colorspaces is "A Technical Introduction to Digital

Video" by Charles A. Poynton (New York: Wiley, 1996).

The alpha channel is not a real color. For that channel, the canonical minimum value means "completely transparent," and the canonical maximum value means "completely opaque."

<a name="howtotell"> <a name="colorspacetrick">

### How to Tell Which Colorspace You Have

</a> </a> For OpenGL, IRIS GL, DM, and CL:

For VL, using the traditional VL_PACKING tokens from IRIX 6.2:

• the VL_PACKING constant indicates whether the data is "rgba" or "vyua"
• "rgba" data on vino, ev1, cosmo2, ev3, and mvp will always be full-range by default.
• "vyua" data on vino, ev1, cosmo2, ev3, and mvp will always be headroom-range by default.
• you can program ev3 to deliver headroom-range "rgba" data (also called RP175 RGBA) by setting VL_FORMAT on the memory node to VL_FORMAT_DIGITAL_COMPONENT_RGB_SERIAL. This only works if the video signal at the jack is also VL_FORMAT_DIGITAL_COMPONENT_RGB* (ev3 will not automatically do color conversion like sirius does).
• ev3 has an optional high-quality colorspace converter which you can program to convert between all sorts of colorspaces using ev3-specific controls.
• on sirius, when you set up a vid-to-mem or mem-to-vid transfer, you must specify the range and color set you want explicitly. You do this by specifying VL_FORMAT on your memory node, like so:

"rgba"VL_FORMAT_RGBnot supported
"vyua"VL_FORMAT_SMPTE_YUVVL_FORMAT_DIGITAL_COMPONENT

Sirius will give you data in your desired range and color set regardless of the input signal format. If the colorspace implied by VL_FORMAT on the video node disagrees with that implied by VL_FORMAT on the memory node, then sirius will

do colorspace conversion for you.

The VL that comes with the divo product and beyond makes all of the parameters (packing, set of colors, range of components) explicit in a clean way:

• You use VL_PACKING to specify only the memory layout. The new memory-only VL_PACKING tokens are disjoint from the old, and the old tokens are still honored, so this change is backwards-compatible.
• You use VL_COLORSPACE to specify the colorspace parameters:

"rgba"VL_COLORSPACE_RGBVL_COLORSPACE_RP175
"vyua"VL_COLORSPACE_YUVVL_COLORSPACE_CCIR

There is also a VL_COLORSPACE_NONE, which is useful when you want to treat Rec. 601 digital video as a raw 10-bit data stream (as in SDDI).

• Like sirius, divo will perform colorspace conversion if the colorspace implied by VL_FORMAT on the video node disagrees with that implied by VL_COLORSPACE on the memory node.

When Dealing with JPEG Data (cosmo1, cosmo2, mvp+ICE, JFIF files, MV/QT files):

• compressed JPEG data (which internally uses "vyua" colors) from video-to-compression-to-memory and memory-to-compression-to-video paths with cosmo1 and cosmo2 is always headroom-range.
• if you use cosmo2 or mvp+ICE in memory-to-memory mode,
• with full-range "rgba" pixels on one end, then the other end is always headroom-range JPEG.
• with any kind (full-range or headroom-range) of "vyua" pixels on one end, then the other end has the same kind of JPEG data.
• if you use cosmo1 in memory-to-memory mode with full-range "rgba" pixels on one end, you will get full-range JPEG data out the other end. Don't feed full-range JPEG data into a cosmo1 memory-to-compression-to-video path. Bad Things will happen.
• Note that the JPEG image file format, JFIF, requires full-range JPEG data, whereas motion JPEG movie file formats store headroom-range JPEG data. There is a proposed extension to JFIF to support headroom-range images.