aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-09-20 12:36:14 -0400
committerLeo Liu <[email protected]>2017-09-25 09:42:14 -0400
commit737d13637dbf460d379a66bd2d50ef5b27b8571a (patch)
treebd8d1c59587c5ea9622569e0385f5e66e1d80244
parenta2ebe579922d77d2fc5cbefacf46db875615d9dc (diff)
vl/csc: add a RGB to YUV CSC matrix
Acked-by: Christian König <[email protected]>
-rw-r--r--src/gallium/auxiliary/vl/vl_csc.c9
-rw-r--r--src/gallium/auxiliary/vl/vl_csc.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/vl/vl_csc.c b/src/gallium/auxiliary/vl/vl_csc.c
index e4395d0624d..861eda683a6 100644
--- a/src/gallium/auxiliary/vl/vl_csc.c
+++ b/src/gallium/auxiliary/vl/vl_csc.c
@@ -131,6 +131,12 @@ static const vl_csc_matrix smpte240m =
{ 1.0f, 1.785f, 0.0f, 0.0f, }
};
+static const vl_csc_matrix bt_709_rev = {
+ { 0.183f, 0.614f, 0.062f, 0.0625f},
+ {-0.101f, -0.338f, 0.439f, 0.5f },
+ { 0.439f, -0.399f, -0.040f, 0.5f }
+};
+
static const vl_csc_matrix identity =
{
{ 1.0f, 0.0f, 0.0f, 0.0f, },
@@ -184,6 +190,9 @@ void vl_csc_get_matrix(enum VL_CSC_COLOR_STANDARD cs,
case VL_CSC_COLOR_STANDARD_SMPTE_240M:
cstd = &smpte240m;
break;
+ case VL_CSC_COLOR_STANDARD_BT_709_REV:
+ memcpy(matrix, bt_709_rev, sizeof(vl_csc_matrix));
+ return;
case VL_CSC_COLOR_STANDARD_IDENTITY:
default:
assert(cs == VL_CSC_COLOR_STANDARD_IDENTITY);
diff --git a/src/gallium/auxiliary/vl/vl_csc.h b/src/gallium/auxiliary/vl/vl_csc.h
index 4927470e426..8623e1b3be5 100644
--- a/src/gallium/auxiliary/vl/vl_csc.h
+++ b/src/gallium/auxiliary/vl/vl_csc.h
@@ -45,7 +45,8 @@ enum VL_CSC_COLOR_STANDARD
VL_CSC_COLOR_STANDARD_IDENTITY,
VL_CSC_COLOR_STANDARD_BT_601,
VL_CSC_COLOR_STANDARD_BT_709,
- VL_CSC_COLOR_STANDARD_SMPTE_240M
+ VL_CSC_COLOR_STANDARD_SMPTE_240M,
+ VL_CSC_COLOR_STANDARD_BT_709_REV
};
extern const struct vl_procamp vl_default_procamp;