summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-12 23:12:41 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-12 23:12:41 +0100
commit5f1046a2164fff00a6fc74aecf4cacbca531d415 (patch)
treec166fd8ecabede8c954e7289723aa9872d3c826a /src/lib
parent07ba15f367b36d17ec60edf77aa57fd20ee76740 (diff)
Remove entirely untested colour LUT options.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_video_frame.cc21
-rw-r--r--src/lib/dcp_video_frame.h3
-rw-r--r--src/lib/encoder.cc2
-rw-r--r--src/lib/film.cc17
-rw-r--r--src/lib/film.h12
-rw-r--r--src/lib/server.cc6
-rw-r--r--src/lib/util.cc17
-rw-r--r--src/lib/util.h1
8 files changed, 9 insertions, 70 deletions
diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc
index 39334d3c7..22a7c5795 100644
--- a/src/lib/dcp_video_frame.cc
+++ b/src/lib/dcp_video_frame.cc
@@ -73,17 +73,15 @@ using libdcp::Size;
/** Construct a DCP video frame.
* @param input Input image.
* @param f Index of the frame within the DCP.
- * @param clut Colour look-up table to use (see Config::colour_lut_index ())
* @param bw J2K bandwidth to use (see Config::j2k_bandwidth ())
* @param l Log to write to.
*/
DCPVideoFrame::DCPVideoFrame (
- shared_ptr<const Image> image, int f, int dcp_fps, int clut, int bw, shared_ptr<Log> l
+ shared_ptr<const Image> image, int f, int dcp_fps, int bw, shared_ptr<Log> l
)
: _image (image)
, _frame (f)
, _frames_per_second (dcp_fps)
- , _colour_lut (clut)
, _j2k_bandwidth (bw)
, _log (l)
, _parameters (0)
@@ -116,19 +114,11 @@ DCPVideoFrame::~DCPVideoFrame ()
shared_ptr<EncodedData>
DCPVideoFrame::encode_locally ()
{
- /* In sRGB / Rec709 gamma LUT */
- shared_ptr<libdcp::LUT> lut_in;
- if (_colour_lut == 0) {
- lut_in = libdcp::SRGBLinearisedGammaLUT::cache.get (12, 2.4);
- } else {
- lut_in = libdcp::Rec709LinearisedGammaLUT::cache.get (12, 1 / 0.45);
- }
-
- /* Out DCI gamma LUT */
- shared_ptr<libdcp::LUT> lut_out = libdcp::GammaLUT::cache.get (16, 1 / 2.6);
-
shared_ptr<libdcp::XYZFrame> xyz = libdcp::rgb_to_xyz (
- _image, lut_in, lut_out, _colour_lut == 0 ? libdcp::colour_matrix::srgb_to_xyz : libdcp::colour_matrix::rec709_to_xyz
+ _image,
+ libdcp::SRGBLinearisedGammaLUT::cache.get (12, 2.4),
+ libdcp::GammaLUT::cache.get (16, 1 / 2.6),
+ libdcp::colour_matrix::srgb_to_xyz
);
/* Set the max image and component sizes based on frame_rate */
@@ -234,7 +224,6 @@ DCPVideoFrame::encode_remotely (ServerDescription const * serv)
<< N_("height ") << _image->size().height << N_("\n")
<< N_("frame ") << _frame << N_("\n")
<< N_("frames_per_second ") << _frames_per_second << N_("\n")
- << N_("colour_lut ") << _colour_lut << N_("\n")
<< N_("j2k_bandwidth ") << _j2k_bandwidth << N_("\n");
_log->log (String::compose (
diff --git a/src/lib/dcp_video_frame.h b/src/lib/dcp_video_frame.h
index b0b662e5b..25a3e9926 100644
--- a/src/lib/dcp_video_frame.h
+++ b/src/lib/dcp_video_frame.h
@@ -105,7 +105,7 @@ public:
class DCPVideoFrame
{
public:
- DCPVideoFrame (boost::shared_ptr<const Image>, int, int, int, int, boost::shared_ptr<Log>);
+ DCPVideoFrame (boost::shared_ptr<const Image>, int, int, int, boost::shared_ptr<Log>);
~DCPVideoFrame ();
boost::shared_ptr<EncodedData> encode_locally ();
@@ -119,7 +119,6 @@ private:
boost::shared_ptr<const Image> _image;
int _frame; ///< frame index within the DCP's intrinsic duration
int _frames_per_second; ///< Frames per second that we will use for the DCP
- int _colour_lut; ///< Colour look-up table to use
int _j2k_bandwidth; ///< J2K bandwidth to use
boost::shared_ptr<Log> _log; ///< log
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc
index ed14f2755..718ae55a4 100644
--- a/src/lib/encoder.cc
+++ b/src/lib/encoder.cc
@@ -203,7 +203,7 @@ Encoder::process_video (shared_ptr<const Image> image, bool same)
_queue.push_back (shared_ptr<DCPVideoFrame> (
new DCPVideoFrame (
image, _video_frames_out, _film->dcp_video_frame_rate(),
- _film->colour_lut(), _film->j2k_bandwidth(), _film->log()
+ _film->j2k_bandwidth(), _film->log()
)
));
diff --git a/src/lib/film.cc b/src/lib/film.cc
index a49e549a7..f306006c9 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -94,7 +94,6 @@ Film::Film (string d)
, _container (Config::instance()->default_container ())
, _scaler (Scaler::from_id ("bicubic"))
, _with_subtitles (false)
- , _colour_lut (0)
, _j2k_bandwidth (200000000)
, _dci_metadata (Config::instance()->default_dci_metadata ())
, _dcp_video_frame_rate (24)
@@ -140,7 +139,6 @@ Film::Film (Film const & o)
, _container (o._container)
, _scaler (o._scaler)
, _with_subtitles (o._with_subtitles)
- , _colour_lut (o._colour_lut)
, _j2k_bandwidth (o._j2k_bandwidth)
, _dci_metadata (o._dci_metadata)
, _dcp_video_frame_rate (o._dcp_video_frame_rate)
@@ -161,8 +159,7 @@ Film::video_identifier () const
<< "_" << _playlist->video_identifier()
<< "_" << _dcp_video_frame_rate
<< "_" << scaler()->id()
- << "_" << j2k_bandwidth()
- << "_" << lexical_cast<int> (colour_lut());
+ << "_" << j2k_bandwidth();
return s.str ();
}
@@ -344,7 +341,6 @@ Film::write_metadata () const
root->add_child("Scaler")->add_child_text (_scaler->id ());
root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0");
- root->add_child("ColourLUT")->add_child_text (lexical_cast<string> (_colour_lut));
root->add_child("J2KBandwidth")->add_child_text (lexical_cast<string> (_j2k_bandwidth));
_dci_metadata.as_xml (root->add_child ("DCIMetadata"));
root->add_child("DCPVideoFrameRate")->add_child_text (lexical_cast<string> (_dcp_video_frame_rate));
@@ -389,7 +385,6 @@ Film::read_metadata ()
_scaler = Scaler::from_id (f.string_child ("Scaler"));
_with_subtitles = f.bool_child ("WithSubtitles");
- _colour_lut = f.number_child<int> ("ColourLUT");
_j2k_bandwidth = f.number_child<int> ("J2KBandwidth");
_dci_metadata = DCIMetadata (f.node_child ("DCIMetadata"));
_dcp_video_frame_rate = f.number_child<int> ("DCPVideoFrameRate");
@@ -586,16 +581,6 @@ Film::set_with_subtitles (bool w)
}
void
-Film::set_colour_lut (int i)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _colour_lut = i;
- }
- signal_changed (COLOUR_LUT);
-}
-
-void
Film::set_j2k_bandwidth (int b)
{
{
diff --git a/src/lib/film.h b/src/lib/film.h
index c107541a0..bf89c6f2c 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -135,7 +135,6 @@ public:
CONTAINER,
SCALER,
WITH_SUBTITLES,
- COLOUR_LUT,
J2K_BANDWIDTH,
DCI_METADATA,
DCP_VIDEO_FRAME_RATE,
@@ -180,11 +179,6 @@ public:
return _with_subtitles;
}
- int colour_lut () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _colour_lut;
- }
-
int j2k_bandwidth () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _j2k_bandwidth;
@@ -218,7 +212,6 @@ public:
void set_container (Ratio const *);
void set_scaler (Scaler const *);
void set_with_subtitles (bool);
- void set_colour_lut (int);
void set_j2k_bandwidth (int);
void set_dci_metadata (DCIMetadata);
void set_dcp_video_frame_rate (int);
@@ -266,11 +259,6 @@ private:
Scaler const * _scaler;
/** True if subtitles should be shown for this film */
bool _with_subtitles;
- /** index of colour LUT to use when converting RGB to XYZ.
- * 0: sRGB
- * 1: Rec 709
- */
- int _colour_lut;
/** bandwidth for J2K files in bits per second */
int _j2k_bandwidth;
/** DCI naming stuff */
diff --git a/src/lib/server.cc b/src/lib/server.cc
index b38e82a07..9af0883a7 100644
--- a/src/lib/server.cc
+++ b/src/lib/server.cc
@@ -104,18 +104,14 @@ Server::process (shared_ptr<Socket> socket)
libdcp::Size size (get_required_int (kv, "width"), get_required_int (kv, "height"));
int frame = get_required_int (kv, "frame");
int frames_per_second = get_required_int (kv, "frames_per_second");
- int colour_lut_index = get_required_int (kv, "colour_lut");
int j2k_bandwidth = get_required_int (kv, "j2k_bandwidth");
- /* This checks that colour_lut_index is within range */
- colour_lut_index_to_name (colour_lut_index);
-
shared_ptr<Image> image (new Image (PIX_FMT_RGB24, size, true));
image->read_from_socket (socket);
DCPVideoFrame dcp_video_frame (
- image, frame, frames_per_second, colour_lut_index, j2k_bandwidth, _log
+ image, frame, frames_per_second, j2k_bandwidth, _log
);
shared_ptr<EncodedData> encoded = dcp_video_frame.encode_locally ();
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 53c457898..305aae4f8 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -457,23 +457,6 @@ dcp_audio_frame_rate (int fs)
return 96000;
}
-/** @param index Colour LUT index.
- * @return Human-readable name.
- */
-string
-colour_lut_index_to_name (int index)
-{
- switch (index) {
- case 0:
- return _("sRGB");
- case 1:
- return _("Rec 709");
- }
-
- assert (false);
- return N_("");
-}
-
Socket::Socket (int timeout)
: _deadline (_io_service)
, _socket (_io_service)
diff --git a/src/lib/util.h b/src/lib/util.h
index 57dc0f783..d9c88293e 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -107,7 +107,6 @@ struct FrameRateConversion
};
extern int dcp_audio_frame_rate (int);
-extern std::string colour_lut_index_to_name (int index);
extern int stride_round_up (int, int const *, int);
extern int stride_lookup (int c, int const * stride);
extern std::multimap<std::string, std::string> read_key_value (std::istream& s);