summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--benchmark/scaling.cc38
-rw-r--r--src/lib/player_video.cc1
2 files changed, 26 insertions, 13 deletions
diff --git a/benchmark/scaling.cc b/benchmark/scaling.cc
index 93ab7869b..7937992d6 100644
--- a/benchmark/scaling.cc
+++ b/benchmark/scaling.cc
@@ -32,9 +32,9 @@ using boost::shared_ptr;
static
shared_ptr<Image>
-dummy_image(dcp::Size size)
+dummy_image(dcp::Size size, AVPixelFormat pixel)
{
- shared_ptr<Image> image(new Image(AV_PIX_FMT_RGB24, size, true));
+ shared_ptr<Image> image(new Image(pixel, size, true));
int v = 0;
for (int y = 0; y < size.height; ++y) {
for (int c = 0; c < image->planes(); ++c) {
@@ -52,10 +52,10 @@ dummy_image(dcp::Size size)
static
void
-test (dcp::Size from, dcp::Size to, bool fast)
+test (dcp::Size from_size, AVPixelFormat from_pixel, dcp::Size to, bool fast)
{
- shared_ptr<Image> image = dummy_image(from);
- PeriodTimer pt (String::compose("%1:%2 -> %3:%4 %5", from.width, from.height, to.width, to.height, fast ? "fast" : "slow"));
+ shared_ptr<Image> image = dummy_image(from_size, from_pixel);
+ PeriodTimer pt (String::compose("%1:%2 -> %3:%4 %5 %6", from_size.width, from_size.height, to.width, to.height, static_cast<int>(from_pixel), fast ? "fast" : "slow"));
for (int i = 0; i < ITERATIONS; ++i) {
image->scale (to, dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB48, true, fast);
}
@@ -65,17 +65,29 @@ test (dcp::Size from, dcp::Size to, bool fast)
int
main ()
{
- test (dcp::Size(1998, 1080), dcp::Size(1998, 1080), true);
- test (dcp::Size(1998, 1080), dcp::Size(1998, 1080), false);
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_RGB24, dcp::Size(1998, 1080), true);
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_RGB24, dcp::Size(1998, 1080), false);
- test (dcp::Size(1998, 1080), dcp::Size(2006, 1088), true);
- test (dcp::Size(1998, 1080), dcp::Size(2006, 1088), false);
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_RGB24, dcp::Size(2006, 1088), true);
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_RGB24, dcp::Size(2006, 1088), false);
- test (dcp::Size(996, 540), dcp::Size(1998, 1080), true);
- test (dcp::Size(996, 540), dcp::Size(1998, 1080), false);
+ test (dcp::Size(996, 540), AV_PIX_FMT_RGB24, dcp::Size(1998, 1080), true);
+ test (dcp::Size(996, 540), AV_PIX_FMT_RGB24, dcp::Size(1998, 1080), false);
- test (dcp::Size(498, 270), dcp::Size(1998, 1080), true);
- test (dcp::Size(498, 270), dcp::Size(1998, 1080), false);
+ test (dcp::Size(498, 270), AV_PIX_FMT_RGB24, dcp::Size(1998, 1080), true);
+ test (dcp::Size(498, 270), AV_PIX_FMT_RGB24, dcp::Size(1998, 1080), false);
+
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_XYZ12LE, dcp::Size(1998, 1080), true);
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_XYZ12LE, dcp::Size(1998, 1080), false);
+
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_XYZ12LE, dcp::Size(2006, 1088), true);
+ test (dcp::Size(1998, 1080), AV_PIX_FMT_XYZ12LE, dcp::Size(2006, 1088), false);
+
+ test (dcp::Size(996, 540), AV_PIX_FMT_XYZ12LE, dcp::Size(1998, 1080), true);
+ test (dcp::Size(996, 540), AV_PIX_FMT_XYZ12LE, dcp::Size(1998, 1080), false);
+
+ test (dcp::Size(498, 270), AV_PIX_FMT_XYZ12LE, dcp::Size(1998, 1080), true);
+ test (dcp::Size(498, 270), AV_PIX_FMT_XYZ12LE, dcp::Size(1998, 1080), false);
return 0;
}
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc
index 10e798ed5..ee3fa6e8f 100644
--- a/src/lib/player_video.cc
+++ b/src/lib/player_video.cc
@@ -170,6 +170,7 @@ PlayerVideo::make_image (function<AVPixelFormat (AVPixelFormat)> pixel_format, b
yuv_to_rgb = _colour_conversion.get().yuv_to_rgb();
}
+ std::cout << "from " << prox.image->pixel_format() << "\n";
_image = prox.image->crop_scale_window (
total_crop, _inter_size, _out_size, yuv_to_rgb, _video_range, pixel_format (prox.image->pixel_format()), aligned, fast
);