Fix up rebase and add timer.
authorCarl Hetherington <cth@carlh.net>
Sun, 23 Aug 2020 20:50:28 +0000 (22:50 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 23 Aug 2020 20:50:34 +0000 (22:50 +0200)
src/lib/gpu_j2k_encode_worker.cc
src/lib/j2k_encoder.cc
test/gpu_test.cc

index a875c23d70406535a493439272599ea6f98661dc..ba0b2036c4457c2883b7f0c9c8c8288b6b87afc5 100644 (file)
@@ -21,6 +21,7 @@
 #include "gpu_j2k_encode_worker.h"
 #include "dcp_video.h"
 #include "cross.h"
+#include "timer.h"
 #include "dcpomatic_log.h"
 #include <dcp/openjpeg_image.h>
 extern "C" {
@@ -79,6 +80,8 @@ GPUJ2KEncodeWorker::encode (shared_ptr<DCPVideo> vf)
        init_tiles (&img, width, height, 5, 5);
        type_tile* tile = &(img.tile[0]);
 
+       PeriodTimer encode("poz-encode");
+
        // XXX: it's a big shame about this int -> float conversion
        for (int i = 0; i < 3; ++i) {
                type_tile_comp* c = &tile->tile_comp[i];
index ac6dd296ceb9297737d3dea409eb7ee28563e52d..1e5c206fc932a391b735d2922791f04d85f6e98a 100644 (file)
@@ -382,13 +382,12 @@ J2KEncoder::servers_list_changed ()
                        shared_ptr<RemoteJ2KEncodeWorker> w (new RemoteJ2KEncodeWorker(i));
                        _workers.push_back (w);
                        _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, w));
-                       _threads.push_back (new boost::thread(boost::bind(&J2KEncoder::encoder_thread, this, w)));
                }
        }
 
        shared_ptr<GPUJ2KEncodeWorker> w (new GPUJ2KEncodeWorker());
        _workers.push_back (w);
-       _threads.push_back (new boost::thread(boost::bind(&J2KEncoder::encoder_thread, this, w)));
+       _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, w));
 
-       _writer->set_encoder_threads (_threads.size());
+       _writer->set_encoder_threads (_threads->size());
 }
index 26c5821e56b4ea2a6da8b8d1c917b85904ef2935..4fc8bc95e7f323fd545fc753b3c89a743077281d 100644 (file)
@@ -32,11 +32,11 @@ using boost::weak_ptr;
 BOOST_AUTO_TEST_CASE (gpu_test)
 {
        GPUJ2KEncodeWorker w;
-       shared_ptr<ImageProxy> ip (new FFmpegImageProxy(private_data / "card.png"));
+       shared_ptr<ImageProxy> ip (new FFmpegImageProxy(TestPaths::private_data / "card.png"));
        shared_ptr<PlayerVideo> pv (
                new PlayerVideo(
                        ip, Crop(), optional<double>(), dcp::Size(1998, 1080), dcp::Size(1998, 1080),
-                       EYES_BOTH, PART_WHOLE, optional<ColourConversion>(), weak_ptr<Content>(), optional<Frame>()
+                       EYES_BOTH, PART_WHOLE, optional<ColourConversion>(), VIDEO_RANGE_FULL, weak_ptr<Content>(), optional<Frame>(), false
                        )
                );
        shared_ptr<DCPVideo> vf (new DCPVideo(pv, 0, 24, 100000000, RESOLUTION_2K));