2 Replies Latest reply on Jun 21, 2012 5:18 AM by malte

    DirectX StretchRect YUV/UYVY/YUY2->RGB Color Conversion



      I'm using IDirect3DDevice9::StretchRect for color conversion from UYVY/YUY2 color space to RGB color space. To control the displayed colors as much as possible I would like to know which matrix coefficients are used for the conversion. Maybe ITU Rec.601 for SD and ITU Rec.709 for HD?

      If my assumption is right that there is a switch of coefficients depending on the resolution: What's the exact resolution when coefficients are switched? 1920 x 1080?

      As far as I know it's left to the driver developer to implement this that's why I ask this question hear.

      Thank you very much for your help!


        • Re: DirectX StretchRect YUV/UYVY/YUY2->RGB Color Conversion

          Is this what you need?


          // Setup default CSC: BT601

          m_defaultCSC.rgbOffset.x = -0.06274510f;

          m_defaultCSC.rgbOffset.y = -0.50196078f;

              m_defaultCSC.rgbOffset.z = -0.50196078f;

          m_defaultCSC.rgbOffset.w =  0.0f;

          m_defaultCSC.redCoef.x   =  1.16438355f;

          m_defaultCSC.redCoef.y   =  0.0f;

          m_defaultCSC.redCoef.z   =  1.59602715f;

          m_defaultCSC.redCoef.w   =  0.0f;

              m_defaultCSC.greenCoef.x =  1.16438355f;

          m_defaultCSC.greenCoef.y = -0.3917616f;

          m_defaultCSC.greenCoef.z = -0.81296805f;

          m_defaultCSC.greenCoef.w =  0.0f;

          m_defaultCSC.blueCoef.x  =  1.16438355f;

          m_defaultCSC.blueCoef.y  =  2.01723105f;

          m_defaultCSC.blueCoef.z  =  0.0f;

          m_defaultCSC.blueCoef.w  =  0.0f;