2013-12-23 Carl Hetherington <cth@carlh.net>
+ * A couple of potential fixes for 4K.
+
* Version 1.50 released.
2013-12-23 Carl Hetherington <cth@carlh.net>
* @param l Log to write to.
*/
DCPVideoFrame::DCPVideoFrame (
- shared_ptr<const Image> image, int f, Eyes eyes, ColourConversion c, int dcp_fps, int bw, shared_ptr<Log> l
+ shared_ptr<const Image> image, int f, Eyes eyes, ColourConversion c, int dcp_fps, int bw, Resolution r, shared_ptr<Log> l
)
: _image (image)
, _frame (f)
, _conversion (c)
, _frames_per_second (dcp_fps)
, _j2k_bandwidth (bw)
+ , _resolution (r)
, _log (l)
{
_conversion = ColourConversion (node->node_child ("ColourConversion"));
_frames_per_second = node->number_child<int> ("FramesPerSecond");
_j2k_bandwidth = node->number_child<int> ("J2KBandwidth");
+ _resolution = Resolution (node->optional_number_child<int>("J2KBandwidth").get_value_or (RESOLUTION_2K));
}
/** J2K-encode this frame on the local host.
parameters.tcp_rates[0] = 0;
parameters.tcp_numlayers++;
parameters.cp_disto_alloc = 1;
- parameters.cp_rsiz = CINEMA2K;
+ parameters.cp_rsiz = _resolution == RESOLUTION_2K ? CINEMA2K : CINEMA4K;
parameters.cp_comment = strdup (N_("DCP-o-matic"));
- parameters.cp_cinema = CINEMA2K_24;
+ parameters.cp_cinema = _resolution == RESOLUTION_2K ? CINEMA2K_24 : CINEMA4K_24;
/* 3 components, so use MCT */
parameters.tcp_mct = 1;
el->add_child("FramesPerSecond")->add_child_text (lexical_cast<string> (_frames_per_second));
el->add_child("J2KBandwidth")->add_child_text (lexical_cast<string> (_j2k_bandwidth));
+ el->add_child("Resolution")->add_child_text (lexical_cast<string> (int (_resolution)));
}
EncodedData::EncodedData (int s)
class DCPVideoFrame : public boost::noncopyable
{
public:
- DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, ColourConversion, int, int, boost::shared_ptr<Log>);
+ DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, ColourConversion, int, int, Resolution, boost::shared_ptr<Log>);
DCPVideoFrame (boost::shared_ptr<const Image>, boost::shared_ptr<const cxml::Node>, boost::shared_ptr<Log>);
boost::shared_ptr<EncodedData> encode_locally ();
ColourConversion _conversion;
int _frames_per_second; ///< Frames per second that we will use for the DCP
int _j2k_bandwidth; ///< J2K bandwidth to use
+ Resolution _resolution; ///< Resolution (2K or 4K)
boost::shared_ptr<Log> _log; ///< log
};
_queue.push_back (shared_ptr<DCPVideoFrame> (
new DCPVideoFrame (
image->image(), _video_frames_out, eyes, conversion, _film->video_frame_rate(),
- _film->j2k_bandwidth(), _film->log()
+ _film->j2k_bandwidth(), _film->resolution(), _film->log()
)
));
void
process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversion conversion, Time)
{
- shared_ptr<DCPVideoFrame> local (new DCPVideoFrame (image->image(), frame, eyes, conversion, film->video_frame_rate(), 250000000, log_));
- shared_ptr<DCPVideoFrame> remote (new DCPVideoFrame (image->image(), frame, eyes, conversion, film->video_frame_rate(), 250000000, log_));
+ shared_ptr<DCPVideoFrame> local (new DCPVideoFrame (image->image(), frame, eyes, conversion, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
+ shared_ptr<DCPVideoFrame> remote (new DCPVideoFrame (image->image(), frame, eyes, conversion, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
cout << "Frame " << frame << ": ";
cout.flush ();
ColourConversion (),
24,
200000000,
+ RESOLUTION_2K,
log
)
);