[vlc-devel] [PATCH 5/5] direct3d11: pass the Whitepoint shifts as a Matrix

Steinar H. Gunderson steinar+vlc at gunderson.no
Tue Mar 7 13:15:18 CET 2017


On Tue, Mar 07, 2017 at 01:12:39PM +0100, Steve Lhomme wrote:
>>> +#define CbCr_ACHROMACY 0.5f /* 128 on 8 bits and 512 on 10 bits, etc */
>>> +        colorspace.WhitePoint[1*4 + 3] = -CbCr_ACHROMACY;
>>> +        colorspace.WhitePoint[2*4 + 3] = -CbCr_ACHROMACY;
>>
>> Isn't 0.5f rather 127.5 on a GPU?
> I suppose it depends if you use asbolute values or not. In D3D11 we
> use xxx_UNORM for the swapchain meaning it's normalized between 0 and
> 1 regardless of the original bit depth.

If 0 => 0.0 and 255 => 1.0, then surely 127 => 127.0/255.0 =~ 0.498.

(I had this problem in my own library; see
https://git.sesse.net/?p=movit;a=blob;f=ycbcr.h;h=6f9f4c9d3ac6b25e880c2931e439c3549688694e;hb=af438a8d5331bb1435494eaf377256deac74f408#l7)

/* Steinar */
-- 
Homepage: https://www.sesse.net/


More information about the vlc-devel mailing list