DXVA2_VideoPrimaries enumeration (dxva2api.h)

Specifies the color primaries of a video source. These flags are used in the DXVA2_ExtendedFormat structure.

Syntax

typedef enum _DXVA2_VideoPrimaries {
  DXVA2_VideoPrimariesMask = 0x1f,
  DXVA2_VideoPrimaries_Unknown = 0,
  DXVA2_VideoPrimaries_reserved = 1,
  DXVA2_VideoPrimaries_BT709 = 2,
  DXVA2_VideoPrimaries_BT470_2_SysM = 3,
  DXVA2_VideoPrimaries_BT470_2_SysBG = 4,
  DXVA2_VideoPrimaries_SMPTE170M = 5,
  DXVA2_VideoPrimaries_SMPTE240M = 6,
  DXVA2_VideoPrimaries_EBU3213 = 7,
  DXVA2_VideoPrimaries_SMPTE_C = 8
} DXVA2_VideoPrimaries;

Constants

 
DXVA2_VideoPrimariesMask
Value: 0x1f
Bitmask to validate flag values. This value is not a valid flag.
DXVA2_VideoPrimaries_Unknown
Value: 0
Unknown. Treat as DXVA2_VideoPrimaries_BT709.
DXVA2_VideoPrimaries_reserved
Value: 1
Reserved. Do not use.
DXVA2_VideoPrimaries_BT709
Value: 2
ITU-R BT.709. Also used for sRGB and scRGB.
DXVA2_VideoPrimaries_BT470_2_SysM
Value: 3
ITU-R BT.470-4 System M (NTSC).
DXVA2_VideoPrimaries_BT470_2_SysBG
Value: 4
ITU-R BT.470-4 System B,G (PAL).
DXVA2_VideoPrimaries_SMPTE170M
Value: 5
SMPTE 170M.
DXVA2_VideoPrimaries_SMPTE240M
Value: 6
SMPTE 240M.
DXVA2_VideoPrimaries_EBU3213
Value: 7
EBU Tech. 3213.
DXVA2_VideoPrimaries_SMPTE_C
Value: 8
SMPTE C (SMPTE RP 145).

Remarks

Color primaries define how to convert RGB colors into the CIE XYZ color space, and can be used to translate colors between different RGB color spaces. An RGB color space is defined by the chromaticity coordinates (x,y) of the RGB primaries plus the white point, as listed in the following table.

Color space (Rx, Ry) (Gx, Gy) (Bx, By) White point (Wx, Wy)
BT.709 (0.64, 0.33) (0.30, 0.60) (0.15, 0.06) D65 (0.3127, 0.3290)
BT.470-2 System B,G; EBU 3213 (0.64, 0.33) (0.29, 0.60) (0.15, 0.06) D65 (0.3127, 0.3290)
BT.470-4 System M (0.67, 0.33) (0.21, 0.71) (0.14, 0.08) CIE III.C (0.310, 0.316)
SMPTE 170M; SMPTE 240M; SMPTE C (0.63, 0.34) (0.31, 0.595) (0.155, 0.07) D65 (0.3127, 0.3291)
 

The z coordinates can be derived from x and y as follows: z = 1 - x - y. To convert between RGB colors to CIE XYZ tristimulus values, compute a matrix T as follows:

Screenshot of a matrix computation, showing an RGB conversion. Given T, you can use the following formulas to convert between an RGB color value and a CIE XYZ tristimulus value. These formulas assume that the RGB components are linear (not gamma corrected) and are normalized to the range [0...1]. Screenshot of a matrix computation, showing a conversion between an RGB color value and a CIE XYZ tristimulus value. To convert colors directly from one RGB color space to another, use the following formula, where T1 is the matrix for color space RGB1, and T2 is the matrix for color space RGB2. Screenshot of a matrix computation, showing a conversion of one RGB color space to another. For a derivation of these formulas, refer to Charles Poynton, Digital Video and HDTV Algorithms and Interfaces (Morgan Kaufmann, 2003).

This enumeration is equivalent to the DXVA_VideoPrimaries enumeration used in DXVA 1.0.

If you are using the IMFMediaType interface to describe the video format, the color primaries are specified in the MF_MT_VIDEO_PRIMARIES attribute.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Header dxva2api.h

See also

Extended Color Information

Media Foundation Enumerations