DXVADDI_AYUVSAMPLE16 structure (d3dumddi.h)

The DXVADDI_AYUVSAMPLE16 structure describes 16-bit Cr, Cb, and Y color values and an associated opacity.

Syntax

typedef struct _DXVADDI_AYUVSAMPLE16 {
  [in] USHORT Cr;
  [in] USHORT Cb;
  [in] USHORT Y;
  [in] USHORT Alpha;
} DXVADDI_AYUVSAMPLE16;

Members

[in] Cr

A 16-bit chrominance (V) sample value.

[in] Cb

A 16-bit chrominance (U) sample value.

[in] Y

A 16-bit luminance (Y) sample value.

[in] Alpha

The 16-bit opacity of the pixel when it is used as a source graphic for blending with another picture.

Remarks

A value of 0 in the Alpha member indicates that the pixel is transparent (so that the other entries have no effect on the resulting blended picture), and a value of 255 indicates that the pixel is opaque (so that the other entries completely determine the value of the resulting blended picture sample).

For nonzero values of Alpha, the blend to use is calculated by the following expression:

( ( ( (Alpha + 1) x (graphic value) ) + ( (255 - Alpha) x (picture value) ) )  + 128 ) >> 8

If Alpha is 0, the specified blend to use is the picture value without alteration.

The color value is scaled according to ITU-R Rec. BT.601, which you can learn about from the International Telecommunication Union website. Therefore, the color black is nominally specified by Y=16, Cb=Cr=128, and the color white is nominally specified by Y=235, Cb=Cr=128.

Note

If the alpha-blending surface originates as a DVD video subpicture, the preferred method for converting from the 4-bit alpha that is used by DVD video to the 8-bit alpha that is specified by Alpha is to map a 4-bit alpha value of zero to an 8-bit alpha value of zero and to convert all of the nonzero 4-bit alphas to 8-bit alphas by performing a left shift of four places and adding the constant 15.

The width and height of the AYUV alpha-blending surface are specified in the associated buffer description list that is defined by the DXVADDI_DECODEBUFFERDESC structure.

Requirements

Requirement Value
Minimum supported client Windows Vista
Header d3dumddi.h (include D3dumddi.h)

See also

DXVADDI_DECODEBUFFERDESC

DXVADDI_VIDEODESC