Appendix B. Pixel Packings and Color Spaces

This appendix explains

Packings

This section presents each packing used by the DIVO hardware, giving a diagram and its tokens in the pertinent libraries. It explains

Packings and Color Spaces

A packing

  • determines which of the four components are sampled, either RGBA or VYUA (more correctly, CrYCbA)

  • determines the sampling pattern (for example, 4:4:4 or 4:2:2), 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 color space

  • determines the color in each component by specifying the color set (see Table B-2)

  • specifies a canonical minimum and maximum value for each component, either full-range or headroom-range; see “Color Spaces” later in this appendix for an explanation

In most Silicon Graphics libraries, a single token encodes both color space and packing. For example, VL_PACKING_RGBA_8 is a 32-bit packing in the RGBA color space. For the VL of DIVO and other advanced products, the two parameters are specified separately with different controls: VL_PACKING and VL_COLORSPACE. The color space must be defined with the VL_COLORSPACE control.

Packing Diagram Conventions

In all illustrations, as you move from left to right:

  • 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

Each illustration shows 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, a 24-bit-per-pixel diagram, such as that for VL_PACKING_444_8 (Figure B-1), indicates 3-byte quantities packed together in memory; the values are not padded out to 32-bit boundaries.

Figure B-1. VL_PACKING_444_8


An x (“don't care”) in a bit means:

  • readers may get any garbage in the bit

  • writers may leave the bit as garbage

A 0 means

  • readers may assume the bit is zero

  • writers must zero out the bit


    Note: Writers in a memory-to-video VL path may leave the bit as garbage.


The packing defines a bit layout, but for convenience, as shown in Figure B-1, the component slots are filled with the RGBA or VYUA color set where appropriate. See “Color Spaces” later in this appendix for more information.


Note: For chroma components, Cr and Cb are more accurate terms than V and U, because the analog NTSC video specification ANSI/SMPTE 170M uses V and U with a slightly different meaning. However, this chapter uses the letters V and U in the illustrations of packings for typographical convenience.

Packings that use 4:2:2 sampling also show the location of each component sample: left and right for 4:2:2. The diagrams assume row-major, left-to-right ordering of pixels in memory.

The DIVO device can natively transfer data of all the packings shown in this appendix in real time.

Packings and Library Tokens

Following each packing diagram are comments and library tokens for that packing, listing, where applicable, the color set (RGBA or VYUA) and the library (VL, OpenGL, and DM) 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 “Color Spaces” in this appendix for more information.

  • For most packings, two indications are given for VL:

    • VL, new style includes the packing control value and a color-space control value; for example, VL_PACKING_4_8 + VL_COLORSPACE_{CCIR,YUV}. For DIVO, you set packing and color space separately for memory nodes. In contrast to Sirius Video™, VL_COLORSPACE replaces VL_FORMAT on DIVO memory nodes. The new definitions provide a more flexible way to specify memory layout of pixels and their color spaces.

    • VL, old style, for example, VL_PACKING_Y_8_P, is included for reference; these tokens are still recognized in case you are using programs for earlier Silicon Graphics video options that include these. It is not recommended for new development.

Packing Naming Conventions

In packing tokens, the following applies:

  • _L and _R appended to the end of tokens with padding (0 bits) indicate that the 0 bits are at the left end or the right end of the pattern, respectively; for example, VL_PACKING_4444_10_in_16_L and VL_PACKING_4444_10_in_16_R).

  • X before the numerical part of the token at the end of a token indicates a component order other than the standard (RGBA or ABGR, VYUA or AUYV); for example, VL_PACKING_X4444_5551, which uses ARGB order.

  • R before the numerical part of the token indicates reverse order of the components; for example, VL_PACKING_242_8 and VL_PACKING_R242_8 have the same pattern of component bits, but the order is reversed in VL_PACKING_R242_8.

  • Z at the end of the token name means that the packing is padded to the word boundary; for example, the packing in VL_PACKING_2424_10_10_10_2Z is 30 bits per pixel, but it is padded to 32 bits per pixel.

Table B-1 lists the DIVO packings in the order of the number of bits in the pattern of component samples—the order in which they are described in the rest of this section.

Table B-1. DIVO Packings

Packing

Bits

Color Space

VL_PACKING_4_8

8

VYUA monochrome/luma only

VL_PACKING_R444_332

8

RGBA

VL_PACKING_444_332

8

RGBA

VL_PACKING_242_8

16

VYUA

VL_PACKING_R242_8

16

VYUA

VL_PACKING_X4444_5551

16

RGBA

VL_PACKING_444_5_6_5

16

RGBA

VL_PACKING_242_10

20

VYUA

VL_PACKING_R242_10

20

VYUA

VL_PACKING_444_8

24

RGBA/VYUA

VL_PACKING_R444_8

24

RGBA/VYUA

VL_PACKING_4444_6

24

RGBA/VYUA

VL_PACKING_4444_8

32

RGBA/VYUA

VL_PACKING_R4444_8

32

RGBA/VYUA

VL_PACKING_R0444_8

32

RGBA/VYUA

VL_PACKING_0444_8

32

RGBA/VYUA

VL_PACKING_4444_10_10_10_2

32

RGBA/VYUA

VL_PACKING_2424_10_10_10_2Z

32

VYUA

VL_PACKING_R2424_10_10_10_2Z

32

VYUA

VL_PACKING_242_10_in_16_L

32

VYUA

VL_PACKING_242_10_in_16_R

32

VYUA

VL_PACKING_R242_10_in_16_L

32

VYUA

VL_PACKING_R242_10_in_16_R

32

VYUA

VL_PACKING_444_12

36

RGBA/VYUA

VL_PACKING_4444_12

48

RGBA/VYUA

VL_PACKING_444_10_in_16_L

48

RGBA/VYUA

VL_PACKING_4444_10_in_16_L

64

RGBA/VYUA

VL_PACKING_4444_10_in_16_R

64

RGBA/VYUA

VL_PACKING_4444_12_in_16_L

64

RGBA (signed)

VL_PACKING_4444_12_in_16_R

64

RGBA (signed)

VL_PACKING_4444_13_in_16_L

64

RGBA (signed)

VL_PACKING_4444_13_in_16_R

64

RGBA (signed)

The packings are explained in these categories:

8-Bit Pixel Packings

Figure B-2 shows the VL_PACKING_4_8, an 8-bit packing useful for VYUA monochrome/luma only.

Figure B-2. VL_PACKING_4_8


This packing is

  • VL_PACKING_4_8 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

  • VL_PACKING_Y_8_P in the VL, old style

  • GL_LUMINANCE GL_UNSIGNED_BYTE in OpenGL

  • DM_IMAGE_PACKING_LUMINANCE in DM

Figure B-3 shows VL_PACKING_R444_332, an 8-bit packing in the RGBA color space.

Figure B-3. VL_PACKING_R444_332


This packing is

  • VL_PACKING_R444_332 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • VL_PACKING_RGB_332_P in the VL, old style

  • DM_IMAGE_PACKING_BGR233 in DM

Figure B-4 shows VL_PACKING_444_332, an 8-bit RGBA packing.

Figure B-4. VL_PACKING_444_332


This packing is

  • VL_PACKING_R444_332 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • GL_RGB GL_UNSIGNED_BYTE_3_3_2_EXT in OpenGL

  • DM_IMAGE_PACKING_RGB332 in DM

16-Bit Pixel Packings

Figure B-5 shows VL_PACKING_242_8, a 16-bit VYUA packing.

Figure B-5. VL_PACKING_242_8


This rarely used packing is VL_PACKING_242_8 + VL_COLORSPACE_{CCIR,YUV} in the VL. It samples chroma and luma in a 4:2:2 pattern. See “Sampling Patterns,” later in this appendix.

Figure B-6 shows VL_PACKING_R242_8, a 16-bit 4:2:2 VYUA packing. The most commonly used 4:2:2 packing, it is used by other Silicon Graphics video hardware as well as DIVO hardware.

Figure B-6. VL_PACKING_R242_8


This packing is

  • VL_PACKING_R242_8 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

  • VL_PACKING_YVYU_422_8 in the VL, old style

  • GL_YCRCB_422_SGIX GL_UNSIGNED_BYTE in OpenGL

  • DM_IMAGE_PACKING_CbYCrY in DM

Figure B-7 shows VL_PACKING_X4444_5551, a 16-bit RGBA packing that corresponds to the QuickTime® file 16-bit uncompressed format with alpha.

Figure B-7. VL_PACKING_X4444_5551


This packing is

  • VL_PACKING_X4444_5551 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • VL_PACKING_ARGB_1555 in the VL, old style

  • DM_IMAGE_PACKING_XRGB1555 in DM (even though the upper bit is really alpha)

Figure B-8 shows VL_PACKING_444_5_6_5, a 16-bit RGBA packing.

Figure B-8. VL_PACKING_444_5_6_5


This packing is VL_PACKING_444_5_6_5 + VL_COLORSPACE_{RGB,RP175} in the VL, new style.

20-Bit Pixel Packings

Figure B-9 shows VL_PACKING_ 242_10, a 20-bit RGBA packing.

Figure B-9. VL_PACKING_242_10


This packing is VL_PACKING_242_10 + VL_COLORSPACE {CCIR,YUV}.

Figure B-10 shows VL_PACKING_ R242_10, a 20-bit RGBA packing.

Figure B-10. VL_PACKING_R242_10


This packing is VL_PACKING_R242_10 + VL_COLORSPACE {CCIR,YUV}.

24-Bit Pixel Packings

Figure B-11 shows VL_PACKING_444_8, a 24-bit RGBA/VYUA packing.

Figure B-11. VL_PACKING_444_8


This packing is

  • RGBA:

    • GL_RGB GL_UNSIGNED_BYTE in OpenGL

    • VL_PACKING_444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_BGR_8_P in the VL, old style

    • GL_RGB GL_UNSIGNED_BYTE in OpenGL

    • DM_IMAGE_PACKING_RGB in DM

  • VYUA:

    • VL_PACKING_444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_UYV_8_P in the VL, old style

Figure B-12 shows VL_PACKING_R444_8, a 24-bit RGBA/VYUA packing.

Figure B-12. VL_PACKING_R444_8


This packing is

  • RGBA:

    • VL_PACKING_R444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_RGB_8_P in the VL, old style

    • DM_IMAGE_PACKING_BGR in DM

  • VYUA:

    • VL_PACKING_R444_8 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

    • DM_IMAGE_PACKING_CbYCr in DM

Figure B-13 shows VL_PACKING_4444_6, a 24-bit DIVO-only packing, which has 6 bits per pixel.

Figure B-13. VL_PACKING_4444_6


This packing is

  • RGBA: VL_PACKING_4444_6 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • VYUA: VL_PACKING_4444_6 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

32-Bit Pixel Packings

This section explains

OpenGL-Like 32-Bit Pixel Packing

Figure B-14 shows VL_PACKING_4444_8, an OpenGL-like 32-bit packing. This packing, supported by many Silicon Graphics video products, is the default OpenGL packing.

Figure B-14. VL_PACKING_4444_8


This packing is

  • RGBA:

    • VL_PACKING_4444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_ABGR_8 in the VL, old style

    • GL_RGBA GL_UNSIGNED_BYTE in OpenGL (the default)

    • DM_IMAGE_PACKING_RGBA in DM

  • VYUA:

    • VL_PACKING_4444_8 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

    • VL_PACKING_AUYV_4444_8 or VL_PACKING_AUYV_8 in the VL, old style

IRIS GL-Like 32-Bit Pixel Packings

Figure B-15 shows VL_PACKING_R4444_8, an IRIS GL-like 32-bit packing. This packing, supported by many Silicon Graphics video products, is the default IRIS GL packing.

Figure B-15. VL_PACKING_R4444_8


This packing is

  • RGBA:

    • VL_PACKING_R4444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_RGBA_8 in the VL, old style

    • GL_ABGR_EXT GL_UNSIGNED_BYTE in OpenGL

    • DM_IMAGE_PACKING_ABGR in DM

  • VYUA:

    • VL_PACKING_R4444_8 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

    • VL_PACKING_YUVA_4444_8 in the VL, old style

Figure B-16 shows VL_PACKING_R0444_8, an IRIS GL-like 32-bit packing. This packing is supported by many Silicon Graphics video products.

Figure B-16. VL_PACKING_R0444_8


  • RGBA:

    • VL_PACKING_R0444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_RGB_8 in the VL, old style

    • DM_IMAGE_PACKING_XBGR

      Use DM_IMAGE_PACKING_ABGR instead of this packing unless you specifically want to inform a piece of software (such as dmColor) not to spend processing time on the alpha channel.

  • VYUA:

    • VL_PACKING_R0444_8 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

    • VL_PACKING_YUV_444_8 in the VL, old style

32-Bit Pixel Packing for QuickTime

Figure B-17 shows VL_PACKING_0444_8, a 32-bit packing used for QuickTime files (uncompressed format without alpha).

Figure B-17. VL_PACKING_0444_8


This packing is

  • RGBA:

    • VL_PACKING_0444_8 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • DM_IMAGE_PACKING_XRGB in DM

  • VYUA: VL_PACKING_0444_8 + VL_COLORSPACE_{CCIR,YUV}

4:4:4:4 10_10_10_2 32-Bit Pixel Packings

Figure B-18 shows VL_PACKING_4444_10_10_10_2, the 32-bit 4:4:4:4 10_10_10_2 packing.

Figure B-18. VL_PACKING_4444_10_10_10_2


This packing is

  • RGBA:

    • VL_PACKING_4444_10_10_10_2 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_A_2_BGR_10 in the VL, old style

    • GL_RGBA GL_UNSIGNED_INT_10_10_10_2_EXT in OpenGL

  • VYUA:

    • VL_PACKING_4444_10_10_10_2 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

    • VL_PACKING_A_2_UYV_10 in the VL, old style

4:2:2:4 10_10_10_2 32-Bit Pixel Packings

Figure B-19 shows VL_PACKING_2424_10_10_10_2Z, the 4:2:2:4 10_10_10_2 32-bit VYUA packing. Only DIVO uses this packing.

Figure B-19. VL_PACKING_2424_10_10_10_2Z


This packing is

  • 4:2:2:4 sampling (2 bits of A); see “Sampling Patterns,” later in this appendix

  • VL_PACKING_2424_10_10_10_2Z + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

Figure B-20 shows VL_PACKING_R2424_10_10_10_2Z, an alternate 4:2:2:4 10_10_10_2 32-bit packing.

Figure B-20. VL_PACKING_R2424_10_10_10_2Z


This packing is

  • 4:2:2:4 sampling (2 bits of A); see “Sampling Patterns,” later in this appendix

  • VL_PACKING_R2424_10_10_10_2Z + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

  • VL_PACKING_AYU_AYV_10 in the VL, old style

4:2:2 10_in_16 32-Bit Pixel Packings

The diagrams of packings that use 4:2:2 sampling show the spatial location (left and right) of each component sample. Only DIVO uses this packing.

Figure B-21 shows VL_PACKING_242_10_in_16_L, a DIVO-only 4:2:2 10_in_16 32-bit VYUA packing.

Figure B-21. VL_PACKING_242_10_in_16_L


This packing is

  • 4:2:2 sampling (2 bits of A); see “Sampling Patterns,” later in this appendix

  • VL_PACKING_242_10_in_16_L + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

Figure B-22 shows VL_PACKING_242_10_in_16_R, a DIVO-only 4:2:2 10_in_16 32-bit VYUA packing.

Figure B-22. VL_PACKING_242_10_in_16_R


This packing is

  • 4:2:2 sampling (2 bits of A); see “Sampling Patterns,” later in this appendix

  • VL_PACKING_242_10_in_16_R + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

Figure B-23 shows VL_PACKING_R242_10_in_16_L, a 4:2:2 10_in_16 32-bit VYUA packing. This packing is supported by several recent Silicon Graphics video products.

Figure B-23. VL_PACKING_R242_10_in_16_L


This packing is

  • 4:2:2 sampling (2 bits of A); see “Sampling Patterns,” later in this appendix

  • VL_PACKING_R242_10_in_16_L + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

  • VL_PACKING_YVYU_422_10 in the VL, old style

Figure B-24 shows VL_PACKING_R242_10_in_16_R, a DIVO-only 4:2:2 10_in_16 32-bit VYUA packing.

Figure B-24. VL_PACKING_R242_10_in_16_R


This packing is

  • VYUA VL_PACKING_R242_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

  • 4:2:2 sampling (2 bits of A); see “Sampling Patterns,” later in this appendix

36-Bit Pixel Packing

Figure B-25 and Figure B-26 shows VL_PACKING_444_12, the 36-bit packing, which has 12 bits per component. Only DIVO uses this packing.


Note: For space reasons, the diagram for this packing is split.

Figure B-25. VL_PACKING_444_12, Pixel 1


Figure B-26. VL_PACKING_444_12, Pixel 2


This packing is

  • RGBA: VL_PACKING_444_12 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • VYUA: VL_PACKING_444_12 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

48-Bit Pixel Packings

Figure B-27 shows VL_PACKING_4444_12, a 48-bit packing, with 12 bits per component. Only DIVO uses this packing.

Figure B-27. VL_PACKING_4444_12


This packing is

  • RGBA: VL_PACKING_4444_12 + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • VYUA: VL_PACKING_4444_12 + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

Figure B-28 shows VL_PACKING_444_10_in_16_L, a 48-bit packing, with 10 bits per component and no alpha.

Figure B-28. VL_PACKING_444_10_in_16_L


This packing is

  • RGBA: VL_PACKING_444_10_in_16_L + VL_COLORSPACE_{RGB,RP175} in the VL, new style

  • VYUA: VL_PACKING_444_10_in_16_L, + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

64-Bit Pixel Packings

Figure B-29 shows VL_PACKING_4444_10_in_16_L.

Figure B-29. VL_PACKING_4444_10_in_16_L


This packing is

  • RGBA:

    • VL_PACKING_4444_10_in_16_L + VL_COLORSPACE_{RGB,RP175} in the VL, new style

    • VL_PACKING_ABGR_10 in the VL, old style

  • VYUA:

    • VL_PACKING_4444_10_in_16_L + VL_COLORSPACE_{CCIR,YUV} in the VL, new style

    • VL_PACKING_AUYV_4444_10 in the VL, old style

Figure B-30 shows VL_PACKING_4444_10_in_16_R.

Figure B-30. VL_PACKING_4444_10_in_16_R


This packing is

  • RGBA: VL_PACKING_4444_10_in_16_R + VL_COLORSPACE_{RGB,RP175}

  • VYUA: VL_PACKING_4444_10_in_16_R + VL_COLORSPACE_{CCIR,YUV}

Figure B-31 shows VL_PACKING_4444_12_in_16_L, a 64-bit RGBA packing.

Figure B-31. VL_PACKING_4444_12_in_16_L


This packing is VL_PACKING_4444_12_in_16_L + VL_COLORSPACE_{RGB,RP175} in the VL, new style.

Figure B-32 shows VL_PACKING_4444_12_in_16_R, a 64-bit RGBA packing for use with extended RGB components.

Figure B-32. VL_PACKING_4444_12_in_16_R


This packing is VL_PACKING_4444_12_in_16_R + VL_COLORSPACE_{RGB,RP175} in the VL, new style.


Note: The components in this packing are signed, that is, they can be positive or negative.

Figure B-33 shows VL_PACKING_4444_13_in_16_L, a 64-bit RGBA packing for use with extended RGB components.

Figure B-33. VL_PACKING_4444_13_in_16_L


This packing is VL_PACKING_4444_13_in_16_L + VL_COLORSPACE_{RGB,RP175} in the VL, new style.


Note: The components in this packing are signed, that is, they can be positive or negative.

Figure B-34 shows VL_PACKING_4444_13_in_16_R, a 64-bit packing for use with extended RGB components.

Figure B-34. VL_PACKING_4444_13_in_16_R


This packing is VL_PACKING_4444_13_in_16_R + VL_COLORSPACE_{RGB,RP175} in the VL, new style.


Note: The components in this packing are signed, that is, they can be positive or negative.


Sampling Patterns

Sampling patterns are

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

Some of the diagrams in “Packings” indicate 4:4:4 or 4:4:4:4 sampling. This video industry terminology means that each of the three or four components is sampled at every pixel.

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

The packings shown in diagrams that indicate 4:2:2 sampling make sense only in the VYUA colorspaces. For every two pixels, there are two luma samples (two Y's) but only one chroma sample (one sample of Cr and Cb, which together determine the chroma), as shown in Figure B-35.

Figure B-35. 4:2:2 Sampling


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). The diagrams for 4:2:2 packings in Figure B-35 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 yields extremely poor results. Video devices that 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. This method has one alpha value per pixel, like the Y value.

4:1:1 Sampling

Another subsampling method with similar compression as 4:2:0 is 4:1:1. In this method, 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, as shown in Figure B-36.

Figure B-36. 4:1:1 Sampling


This method generally looks worse than 4:2:0 at the same cost, and it is not currently used by any Silicon Graphics libraries.

Color Spaces

Each component of an image has:

  • a color that it represents

  • a canonical minimum value

  • a canonical maximum value

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

  • full range: [0, (2^nbits)-1], which provides the maximum resolution for each component

  • headroom range:

    • 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). For example, for 8-bit components: Cr and Cb: [16, 240]. Y, A, R, G, B: [16, 235]; for 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.

Two sets of colors are commonly used together, RGB (RGBA) and YCrCb/YUV (VYUA). YCrCb (YUV), the most common representation of color from the video world, 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 CCIR 601).

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.”

For more information about color spaces, see A Technical Introduction to Digital Video, by Charles A. Poynton (New York: Wiley, 1996).

Determining the Color Space

For OpenGL, IRIS GL, and DM:

  • the library constant indicates whether the data is RGBA or VYUA

  • RGBA data is full-range by default

  • VYUA data in DM can be full-range or headroom-range; you must determine this from context

Using the traditional VL_PACKING tokens from IRIX 6.2, the VL_PACKING constant indicates whether the data is RGBA or VYUA (as in VL_PACKING_UYV_8_P). The VL that comes with the DIVO option (for IRIX 6.4) makes all of the parameters (packing, set of colors, range of components) explicit:

  • 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.

  • Use VL_COLORSPACE to specify the color space parameters, as shown in Table B-2.

    Table B-2. VL_COLORSPACE Options

    Color Set

    Full-Range Components

    Headroom-Range Components

    RGBA

    VL_COLORSPACE_RGB

    VL_COLORSPACE_RP175

    VYUA

    VL_COLORSPACE_YUV

    VL_COLORSPACE_CCIR

    The option VL_COLORSPACE_NONE is useful when you want to treat CCIR 601 digital video as a raw 10-bit data stream (as in SDDI).

DIVO performs color-space conversion if the color space implied by VL_FORMAT on the video node disagrees with that implied by VL_COLORSPACE on the memory node.