

This structure is identical to the VIDEOINFOHEADER2 structure, and the meaning of the fields is the same. Video capture drivers: Color-space information is given in the KS_VIDEOINFOHEADER2 structure.

When this flag is set, the dwControlFlags field should be interpreted as a DXVA_ExtendedFormat structure, except that the lower 8 bits of the structure are reserved for AMCONTROL_xxx flags. If color-space information is present, set the AMCONTROL_COLORINFO_PRESENT flag in dwControlFlags. The information is stored in the upper 24 bits of the dwControlFlags field. This structure is identical to the DXVA 1.0 structure, and the meaning of the fields is the same.ĭirectShow: Color-space information is given in the VIDEOINFOHEADER2 structure. Fortunately, it is easy to translate the color-space information from one to another, because the relevant enumerations are the same.ĭXVA 1.0: Color-space information is given in the DXVA_ExtendedFormat structure.ĭXVA 2.0: Color-space information is given in the DXVA2_ExtendedFormat structure structure. The nominal range defines how Y'PbPr values are scaled to Y'CbCr.ĭirectShow, Media Foundation, and DirectX Video Acceleration (DXVA) all have different ways to represent video formats. When the chroma is sampled, the position of the chroma samples relative to the luma samples determines how the missing samples should be interpolated. For example, YUY2 is a 4:2:2 format, meaning the chroma samples are sampled horizontally by a factor of 2. Chroma sampling is indicated by the FOURCC of the video format. Most YUV video is transmitted with less resolution in the chroma components than the luma. The transfer matrix defines how R'G'B' is converted to Y'PbPr. This function is also called gamma correction. The transfer function is a function that converts linear RGB values to non-linear R'G'B' values. In effect, the color primaries define the "meaning" of a given RGB value. The color primaries define how CIE XYZ tristimulus values are represented as RGB components. To reproduce colors accurately, the following information is needed: It is not practical to use CIE XYZ values directly in video, but the CIE XYZ color space can be used as an intermediate representation when converting between color spaces. The standard way to describe a color space mathematically is to use the CIE XYZ color space, defined by the International Commission on Illumination (CIE). This information is also available for DirectX Video Acceleration (DXVA).
#Foundation color converter windows#
Starting in Windows Vista, both DirectShow and Media Foundation support extended color information in the media type. Previously, the video pipeline in Windows did not carry information about the intended color space. To achieve accurate color fidelity, therefore, it is crucial to know the color space of the source video. When video is encoded in one color space but is displayed in another, it results in distorted colors, unless the video is color-corrected. If we don't know the color space, then strictly speaking we don't know the color.Ī color space defines how the numeric representation of a given color value should be reproduced as physical light. The answer may be surprising: Without some additional information, this triplet does not define any particular color! The meaning of any RGB value depends on the color space. But what is the actual color defined by this triplet? If you know anything about RGB color, you know that (255, 255, 255) is the 8-bit RGB triplet for the color white.
