summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-24 21:04:49 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-24 21:04:49 +0000
commit10655124e560b28418a765bebaa760dfc9885b0a (patch)
tree5e80f1b83766e67911610c0dddd78505c922d28d /src
parent1c4257eacfe62f30f3e08edfe049a954cd7b43a3 (diff)
Re-enable DCI companding; modify RGB matrix to that given on http://www.digitall.net.au/products/dcp-player/64.html
Diffstat (limited to 'src')
-rw-r--r--src/util.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc
index d5565245..7543f8ba 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -208,11 +208,19 @@ libdcp::xyz_to_rgb (opj_image_t* xyz_frame, shared_ptr<const GammaLUT> lut_in, s
float const dci_coefficient = 48.0 / 52.37;
/* sRGB color matrix for XYZ -> RGB */
+#if 0
float const colour_matrix[3][3] = {
{ 3.240454836, -1.537138850, -0.498531547},
{-0.969266390, 1.876010929, 0.041556082},
{ 0.055643420, -0.204025854, 1.057225162}
};
+#endif
+
+ float const colour_matrix[3][3] = {
+ { 3.1338561, -1.6168667, -0.4906146 },
+ { -0.9787684, 1.9161415, 0.0334540 },
+ { 0.0719453, -0.2289914, 1.4052427 }
+ };
int const max_colour = pow (2, lut_out->bit_depth()) - 1;
@@ -243,12 +251,10 @@ libdcp::xyz_to_rgb (opj_image_t* xyz_frame, shared_ptr<const GammaLUT> lut_in, s
s.y = lut_in->lut()[*xyz_y++];
s.z = lut_in->lut()[*xyz_z++];
-#if 0
/* DCI companding */
s.x /= dci_coefficient;
s.y /= dci_coefficient;
s.z /= dci_coefficient;
-#endif
/* XYZ to RGB */
d.r = ((s.x * colour_matrix[0][0]) + (s.y * colour_matrix[0][1]) + (s.z * colour_matrix[0][2]));