[Mesa-dev] [PATCH 1/4] state_trackers/vdpau: Implement VdpGenerateCSCMatrix
Maarten Lankhorst
m.b.lankhorst at gmail.com
Sun Nov 6 01:41:23 PST 2011
Hey Christian,
On 10/31/2011 11:00 AM, Christian König wrote:
> On 31.10.2011 10:23, Maarten Lankhorst wrote:
>> With the smpte240 profile, which was missing.
>>
>> Signed-off-by: Maarten Lankhorst<m.b.lankhorst at gmail.com>
>> ---
>> src/gallium/auxiliary/vl/vl_csc.c | 19 +++++++++++++++++++
>> src/gallium/auxiliary/vl/vl_csc.h | 3 ++-
>> src/gallium/state_trackers/vdpau/mixer.c | 20 +++++++++++++++++++-
>> 3 files changed, 40 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/auxiliary/vl/vl_csc.c b/src/gallium/auxiliary/vl/vl_csc.c
>> index 21da95f..56e6621 100644
>> --- a/src/gallium/auxiliary/vl/vl_csc.c
>> +++ b/src/gallium/auxiliary/vl/vl_csc.c
>> @@ -147,6 +147,22 @@ static const float bt_709_full[16] =
>> 0.0f, 0.0f, 0.0f, 1.0f
>> };
>>
>> +static const float smpte240m[16] =
>> +{
>> + 1.0f, 0.0f, 1.582f, 0.0f,
>> + 1.0f, -0.228f, -0.478f, 0.0f,
>> + 1.0f, 1.833f, 0.0f, 0.0f,
>> + 0.0f, 0.0f, 0.0f, 1.0f
>> +};
>> +
>> +static const float smpte240m_full[16] =
>> +{
>> + 1.164f, 0.0f, 1.794f, 0.0f,
>> + 1.164f, -0.258f, -0.543f, 0.0f,
>> + 1.164f, 2.079f, 0.0f, 0.0f,
>> + 0.0f, 0.0f, 0.0f, 1.0f
>> +};
>> +
> I haven't checked if the matrix are correct and precise enough, but otherwise looks good to me.
For completeness, what I'm getting on nouveau:
{{1.164000, 0.000000, 1.794000, -0.973553},
{1.164000, -0.258000, -0.543000, 0.329035},
{1.164000, 2.079000, 0.000000, -1.116612}}
And nvidia:
{{1.164400, 0.000000, 1.793900, -0.973528},
{1.164400, -0.257800, -0.542500, 0.328659},
{1.164400, 2.078700, 0.000000, -1.116486}}
I'm not sure if it matters though, all the matrixes in vl_csc seem to have slightly
less accuracy than nvidia's, but is the difference really relevant when the effective
range is only 240 (CbCr) or less (Y)?
Cheers,
Maarten
More information about the mesa-dev
mailing list