summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_csc.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <[email protected]>2011-10-31 10:23:03 +0100
committerChristian König <[email protected]>2011-11-03 13:52:00 +0100
commitc9c6eec1c6650623f1be412dc2acd935de6b728b (patch)
treef04129179f48ba5fcf546624ceb765ab1005f37a /src/gallium/auxiliary/vl/vl_csc.c
parent8a7e645c9befb8578c8a571ccc951ed908d177ae (diff)
state_trackers/vdpau: Implement VdpGenerateCSCMatrix
With the smpte240 profile, which was missing. Signed-off-by: Maarten Lankhorst <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_csc.c')
-rw-r--r--src/gallium/auxiliary/vl/vl_csc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_csc.c b/src/gallium/auxiliary/vl/vl_csc.c
index 21da95f3ceb..56e662157ef 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
+};
+
static const float identity[16] =
{
1.0f, 0.0f, 0.0f, 0.0f,
@@ -188,6 +204,9 @@ void vl_csc_get_matrix(enum VL_CSC_COLOR_STANDARD cs,
case VL_CSC_COLOR_STANDARD_BT_709:
cstd = full_range ? &bt_709_full[0] : &bt_709[0];
break;
+ case VL_CSC_COLOR_STANDARD_SMPTE_240M:
+ cstd = full_range ? &smpte240m_full[0] : &smpte240m[0];
+ break;
case VL_CSC_COLOR_STANDARD_IDENTITY:
default:
assert(cs == VL_CSC_COLOR_STANDARD_IDENTITY);