Use updated libdcp, including an optimisation for rgb-onto-xyz12.
authorCarl Hetherington <cth@carlh.net>
Fri, 27 Oct 2023 23:51:51 +0000 (01:51 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 28 Oct 2023 00:30:08 +0000 (02:30 +0200)
cscript
src/lib/dcp_video.cc
src/lib/dcp_video.h
src/lib/image.cc
src/wx/video_waveform_plot.cc

diff --git a/cscript b/cscript
index be61c533056554e663eaabf1a0cb9465090835ae..a70f73571eb6d3a926c5f06017fcb96ff3a09fb5 100644 (file)
--- a/cscript
+++ b/cscript
@@ -508,7 +508,7 @@ def dependencies(target, options):
         # Use distro-provided FFmpeg on Arch
         deps = []
 
-    deps.append(('libdcp', 'v1.8.86'))
+    deps.append(('libdcp', '687e46f8770ee946ce149e2b893f3626052b6881'))
     deps.append(('libsub', 'v1.6.44'))
     deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
     deps.append(('rtaudio', 'f619b76'))
index 8eb76fdd63670bebce5b09156f7900e8b8b9e6d2..217b72183c2af0b2d61b945d0b60ba3551c34933 100644 (file)
@@ -98,7 +98,7 @@ DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::
 }
 
 shared_ptr<dcp::OpenJPEGImage>
-DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note)
+DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame)
 {
        shared_ptr<dcp::OpenJPEGImage> xyz;
 
@@ -108,8 +108,7 @@ DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::NoteHandler
                        image->data()[0],
                        image->size(),
                        image->stride()[0],
-                       frame->colour_conversion().get(),
-                       note
+                       frame->colour_conversion().get()
                        );
        } else {
                xyz = make_shared<dcp::OpenJPEGImage>(image->data()[0], image->size(), image->stride()[0]);
@@ -131,7 +130,7 @@ DCPVideo::encode_locally () const
        int const minimum_size = 16384;
        LOG_DEBUG_ENCODE("Using minimum frame size %1", minimum_size);
 
-       auto xyz = convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
+       auto xyz = convert_to_xyz(_frame);
        int noise_amount = 2;
        int pixel_skip = 16;
        while (true) {
@@ -156,7 +155,7 @@ DCPVideo::encode_locally () const
                 * convert_to_xyz() again because compress_j2k() corrupts its xyz parameter.
                 */
 
-               xyz = convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
+               xyz = convert_to_xyz(_frame);
                auto size = xyz->size ();
                auto pixels = size.width * size.height;
                dcpomatic::RNG rng(42);
index 33df0942cbb5e7a1e6c6c88b3edb3c9e2feb7ec2..bf95ccfe60d9d3336749a8a4008b9de8310b3839 100644 (file)
@@ -64,7 +64,7 @@ public:
 
        bool same (std::shared_ptr<const DCPVideo> other) const;
 
-       static std::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz (std::shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note);
+       static std::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz(std::shared_ptr<const PlayerVideo> frame);
 
 private:
 
index 578f6ca567d2bfb73b541ebf2260891a7b53fe68..6feea10ca93513c40689e9404d9ef58fa511ce6b 100644 (file)
@@ -756,8 +756,8 @@ alpha_blend_onto_xyz12le(TargetParams const& target, OtherParams const& other, i
        auto conv = dcp::ColourConversion::srgb_to_xyz();
        double fast_matrix[9];
        dcp::combined_rgb_to_xyz(conv, fast_matrix);
-       auto lut_in = conv.in()->lut(0, 1, 8, false);
-       auto lut_out = conv.out()->lut(0, 1, 16, true);
+       auto lut_in = conv.in()->double_lut(0, 1, 8, false);
+       auto lut_out = conv.out()->int_lut(0, 1, 16, true, 65535);
        for (int ty = target.start_y, oy = other.start_y; ty < target.size.height && oy < other.size.height; ++ty, ++oy) {
                auto tp = reinterpret_cast<uint16_t*>(target.data[0] + ty * target.stride[0] + target.start_x * target.bpp);
                auto op = reinterpret_cast<OtherType*>(other.data[0] + oy * other.stride[0]);
@@ -775,9 +775,9 @@ alpha_blend_onto_xyz12le(TargetParams const& target, OtherParams const& other, i
                        double const z = max(0.0, min(1.0, r * fast_matrix[6] + g * fast_matrix[7] + b * fast_matrix[8]));
 
                        /* Out gamma LUT and blend */
-                       tp[0] = lrint(lut_out[lrint(x * 65535)] * 65535) * alpha + tp[0] * (1 - alpha);
-                       tp[1] = lrint(lut_out[lrint(y * 65535)] * 65535) * alpha + tp[1] * (1 - alpha);
-                       tp[2] = lrint(lut_out[lrint(z * 65535)] * 65535) * alpha + tp[2] * (1 - alpha);
+                       tp[0] = lut_out[lrint(x * 65535)] * alpha + tp[0] * (1 - alpha);
+                       tp[1] = lut_out[lrint(y * 65535)] * alpha + tp[1] * (1 - alpha);
+                       tp[2] = lut_out[lrint(z * 65535)] * alpha + tp[2] * (1 - alpha);
 
                        tp += target.bpp / 2;
                        op += other.bpp / sizeof(OtherType);
index 826e173597d31038ec92cdbd421b2123be430b45..f6fa939403e2f00257ece606886635c85ce7e8d7 100644 (file)
@@ -195,7 +195,7 @@ VideoWaveformPlot::set_image (shared_ptr<PlayerVideo> image)
        /* We must copy the PlayerVideo here as we will call ::image() on it, potentially
           with a different pixel_format than was used when ::prepare() was called.
        */
-       _image = DCPVideo::convert_to_xyz (image->shallow_copy(), [](dcp::NoteType, string) {});
+       _image = DCPVideo::convert_to_xyz(image->shallow_copy());
        _dirty = true;
        Refresh ();
 }