Appendix C. Pixel Packings and Color Spaces

This appendix explains

DIVO/DIVO-DVC Pixel Packings

This section presents each packing used by the DIVO/DIVO-DVC 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:4 or 4:2:2:4), 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, unless specified otherwise in the description of the packing

A color space

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

  • specifies a canonical minimum and maximum value for each component, either full range or compressed range (headroom range); see “Color Spaces ” for an explanation 

In most SGI 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/DIVO-DVC 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 C-1), indicates 3-byte quantities packed together in memory; the values are not padded out to 32-bit boundaries.

Figure C-1. VL_PACKING_444_8

VL_PACKING_444_8

The packing defines a bit layout, but for convenience, as shown in Figure C-1, the component slots are filled with the RGBA or VYUA color set as appropriate. (See “Color Spaces ” later in this appendix for more information.) 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 appendix 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.

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

    • Readers may get any garbage in this bit.

    • Writers can leave this bit as garbage.

  • A 0 means the following:

    • Readers may assume this bit is zero.

    • Writers can leave this bit as garbage.

  • An s indicates a padding bit that is a sign extension bit. For the DIVO or DIVO-DVC option, this convention applies only to the more significant bits in 12-bit and 13-bit packings with rightward orientation; that is, VL_PACKING_4444_12_in_16_R and VL_PACKING_4444_13_in_16_R.

  • A p indicates a padding bit in the least significant bits of a left-justified 10-, 12-, or 13-bit word, such as VL_PACKING_R242_10_in_16_L or VL_PACKING_4444_13_in_16_L:

    • Readers can assume that the bits are replicated from the component found in the same word: With bits numbered starting with 0 for the least significant, there are n contiguous p bits to the right of the component. The p bits contain a copy of bits [9,9-n+1] of the component.

    • Writers can leave the p bits as garbage.

The DIVO or DIVO-DVC 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 or DIVO-DVC, you set packing and color space separately for memory nodes. In contrast to Sirius Video, VL_COLORSPACE replaces VL_FORMAT on DIVO/DIVO-DVC 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 SGI video options that include these. The old style is not recommended for new development.

Packing Naming Conventions

In packing tokens, the following applies:

  • _L or _R appended to the end of a token with padding (0 bits) indicates 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 their 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 C-1 lists the DIVO/DIVO-DVC 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 C-1. DIVO/DIVO-DVC 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_DV

32

Y only

VL_PACKING_SDTI_DV

32

Cb/Y/Cr/Y

VL_PACKING_444_12

36

RGBA/VYUA (signed)

VL_PACKING_4444_12

48

RGBA/VYUA (signed)

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 C-2 shows the VL_PACKING_4_8, an 8-bit packing useful for VYUA monochrome/luma only.

Figure C-2. VL_PACKING_4_8

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 C-3 shows VL_PACKING_R444_332, an 8-bit packing in the RGBA color space.

Figure C-3. VL_PACKING_R444_332

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 C-4 shows VL_PACKING_444_332, an 8-bit RGBA packing.

Figure C-4. VL_PACKING_444_332

VL_PACKING_444_332

This packing is

  • VL_PACKING_444_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 C-5 shows VL_PACKING_242_8, a 16-bit VYUA packing.

Figure C-5. VL_PACKING_242_8

VL_PACKING_242_8


Note: Cr and Cb are more accurate terms than V and U; however, this appendix uses the letters V and U in the illustrations of packings for typographical convenience.


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 C-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 SGI video hardware as well as DIVO or DIVO-DVC hardware.

Figure C-6. VL_PACKING_R242_8

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 C-7 shows VL_PACKING_X4444_5551, a 16-bit RGBA packing that corresponds to the QuickTime file 16-bit uncompressed format with alpha.

Figure C-7. VL_PACKING_X4444_5551

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 C-8 shows VL_PACKING_444_5_6_5, a 16-bit RGBA packing.

Figure C-8. VL_PACKING_444_5_6_5

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 C-9 shows VL_PACKING_242_10, a 20-bit VYUA packing.

Figure C-9. VL_PACKING_242_10

VL_PACKING_242_10

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

Figure C-10 shows VL_PACKING_R242_10, a 20-bit VYUA packing.

Figure C-10. VL_PACKING_R242_10

VL_PACKING_R242_10

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

24-Bit Pixel Packings

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

Figure C-11. VL_PACKING_444_8

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 C-12 shows VL_PACKING_R444_8, a 24-bit RGBA/VYUA packing.

Figure C-12. VL_PACKING_R444_8

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 C-13 shows VL_PACKING_4444_6, a 24-bit DIVO/DIVO-DVC-only packing with 6 bits per pixel.

Figure C-13. VL_PACKING_4444_6

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 C-14 shows VL_PACKING_4444_8, an OpenGL-like 32-bit packing. This packing, supported by many SGI video products, is the most commonly used OpenGL packing.

Figure C-14. VL_PACKING_4444_8

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 C-15 shows VL_PACKING_R4444_8, an IRIS GL-like 32-bit packing. This packing, supported by many SGI video products, is the default IRIS GL packing.

Figure C-15. VL_PACKING_R4444_8

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 C-16 shows VL_PACKING_R0444_8, an IRIS GL-like 32-bit packing. This packing is supported by many SGI video products. 

Figure C-16. VL_PACKING_R0444_8

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 C-17 shows VL_PACKING_0444_8, a 32-bit packing used for QuickTime files (uncompressed format without alpha). 

Figure C-17. VL_PACKING_0444_8

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 Packing

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

Figure C-18. VL_PACKING_4444_10_10_10_2

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 C-19 shows VL_PACKING_2424_10_10_10_2Z, the 4:2:2:4 10_10_10_2 32-bit VYUA packing. Only DIVO and DIVO-DVC use this packing.

Figure C-19. VL_PACKING_2424_10_10_10_2Z

VL_PACKING_2424_10_10_10_2Z

This packing is

  • 4:2:2:4 sampling; see “Sampling Patterns” in this appendix

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

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

Figure C-20. VL_PACKING_R2424_10_10_10_2Z

VL_PACKING_R2424_10_10_10_2Z

This packing is

  • 4:2:2:4 sampling; see “Sampling Patterns” 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 location (left and right) of each component sample. Only DIVO and DIVO-DVC use this packing.

Figure C-21 shows VL_PACKING_242_10_in_16_L, a DIVO/DIVO-DVC-only 4:2:2 10_in_16 32-bit VYUA packing. For an explanation of the p bit, see “Packing Diagram Conventions”.

Figure C-21. VL_PACKING_242_10_in_16_L

VL_PACKING_242_10_in_16_L

This packing is

  • 4:2:2 sampling; see “Sampling Patterns” in this appendix

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

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

Figure C-22. VL_PACKING_242_10_in_16_R

VL_PACKING_242_10_in_16_R

This packing is

  • 4:2:2 sampling; see “Sampling Patterns” in this appendix

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

Figure C-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 SGI video products. For an explanation of the p bit, see “Packing Diagram Conventions”.

Figure C-23. VL_PACKING_R242_10_in_16_L

VL_PACKING_R242_10_in_16_L

This packing is

  • 4:2:2 sampling; see “Sampling Patterns” 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 C-24 shows VL_PACKING_R242_10_in_16_R, a DIVO/DIVO-DVC-only 4:2:2 10_in_16 32-bit VYUA packing.

Figure C-24. VL_PACKING_R242_10_in_16_R

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; see “Sampling Patterns” in this appendix

SDTI Packing

Figure C-25 shows the SDTI packing VL_PACKING_SDTI_DV.

Figure C-25. VL_PACKING_SDTI_DV

VL_PACKING_SDTI_DV

This packing

36-Bit Pixel Packing

Figure C-26 shows VL_PACKING_444_12, the 36-bit packing, which has 12 bits per component. Only DIVO and DIVO-DVC use this packing.

Figure C-26. VL_PACKING_444_12

VL_PACKING_444_12

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

The components in this packing are signed:

  • For RGB and RP-175 color spaces, the components are often negative.

  • For the YUV color space, they are negative when the incoming video signal has values outside of the nominal range.

  • For the CCIR601 color space, they are always positive.

48-Bit Pixel Packings

Figure C-27 shows VL_PACKING_4444_12, a 48-bit packing, with 12 bits per component. Only DIVO and DIVO-DVC use this packing.

Figure C-27. VL_PACKING_4444_12

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 

The components in this packing are signed:

  • For RGB and RP-175 color spaces, the components are often negative.

  • For the YUV color space, they are negative when the incoming video signal has values outside of the nominal range.

  • For the CCIR601 color space, they are always positive.

Figure C-28 shows VL_PACKING_444_10_in_16_L, a 48-bit packing, with 10 bits per component and no alpha. For an explanation of the p bit, see “Packing Diagram Conventions”.

Figure C-28. VL_PACKING_444_10_in_16_L

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 C-29 shows VL_PACKING_4444_10_in_16_L. For an explanation of the p bit, see “Packing Diagram Conventions”.

Figure C-29. VL_PACKING_4444_10_in_16_L

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 C-30 shows VL_PACKING_4444_10_in_16_R.

Figure C-30. VL_PACKING_4444_10_in_16_R

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 C-31 shows VL_PACKING_4444_12_in_16_L, a 64-bit RGBA packing. For an explanation of the p bit, see “Packing Diagram Conventions”.

Figure C-31. VL_PACKING_4444_12_in_16_L

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.

The components in this packing are signed:

  • For RGB and RP-175 color spaces, they are often negative.

  • For the YUV color space, they are negative when the incoming video signal has values outside of the nominal range.

  • For the CCIR601 color space, they are always positive.

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

Figure C-32. VL_PACKING_4444_12_in_16_R

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, with positive and negative values varying by color space, as explained for VL_PACKING_4444_12_in_16_L. The s in the more significant bits in Figure C-32 indicates a sign extension padding bit.

Figure C-33 shows VL_PACKING_4444_13_in_16_L, a 64-bit RGBA packing for use with extended RGB components. For an explanation of the p bit, see “Packing Diagram Conventions”.

Figure C-33. VL_PACKING_4444_13_in_16_L

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.

The components in this packing are signed, with positive and negative values varying by color space, as explained for VL_PACKING_4444_12_in_16_L.

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

Figure C-34. VL_PACKING_4444_13_in_16_R

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, with positive and negative values varying by color space, as explained for VL_PACKING_4444_12_in_16_L. The s in the more significant bits in Figure C-34 indicates a sign extension padding bit.


Sampling Patterns

Sampling patterns are described in these sections:

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

Some of the diagrams in the “DIVO/DIVO-DVC Pixel Packings” section 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. Figure C-35 diagrams this sampling pattern.

Figure C-35. 4:4:4 Sampling

4:4:4 Sampling

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 color spaces. For every two pixels, there are two luma samples (two Ys) but only one chroma sample (one sample of Cr and Cb, which together determine the chroma), as shown in Figure C-36.

Figure C-36. 4:2:2 Sampling

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 the “DIVO/DIVO-DVC Pixel Packings” section of this appendix show the 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.1 kHz audio into 22.05 kHz 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 (DIVO-DVC Only)

The packings shown in diagrams that indicate 4:1:1 sampling make sense only in the VYUA color spaces. For every four pixels, there are four luma samples (four Ys) but only one chroma sample (one sample of Cr and Cb, which together determine the chroma), as shown in Figure C-37.

Figure C-37. 4:1:1 Sampling

4:1:1 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 DIVO-DVC board uses 4:1:1 sampling for 525/60 (NTSC) DV, NTSC DVCPRO, and 625/50 (PAL) DVCPRO compression.

4:2:0 Sampling (DIVO-DVC Only)

The packings shown in diagrams that indicate 4:2:0 sampling make sense only in the VYUA color spaces. For every two pixels, there are two luma samples (two Ys) but only one chroma sample (on alternate lines, one sample of Cr and one sample of Cb), as shown in Figure C-38.

Figure C-38. 4:2:0 Sampling

4:2:0 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 DIVO-DVC board uses 4:2:0 sampling for PAL (625/50) DV compression.

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 an unsigned component with n bits, there are two possibilities for [minimum value, maximum value]:

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

  • compressed (headroom) range, which provides numerical headroom, which is often useful when processing video images:

    • Cr and Cb: [(2n)/16, 15*(2n)/16]

    • Y, A, R, G, and B: [(2n)/16, 235*(2n)/256]

Compressed 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]

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 compressed-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 or DIVO-DVC option (for IRIX 6.4 and later) 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 backward-compatible.

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

    Table C-2. VL_COLORSPACE Options

    Color Set

    Full-Range Components

    Compressed-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).

The DIVO and DIVO-DVC options perform 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.