From 555ced5ed96828bd332623665c0565cd8b3a0df6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 2 Dec 2015 12:49:00 +0000 Subject: Use OpenMP when comparing picture assets. --- src/mono_picture_asset.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc index f14e50c2..5ab12117 100644 --- a/src/mono_picture_asset.cc +++ b/src/mono_picture_asset.cc @@ -105,23 +105,23 @@ MonoPictureAsset::equals (shared_ptr other, EqualityOptions opt, No bool result = true; +#pragma omp parallel for for (int i = 0; i < _intrinsic_duration; ++i) { if (i >= other_picture->intrinsic_duration()) { - return false; + result = false; } - note (DCP_PROGRESS, String::compose ("Comparing video frame %1 of %2", i, _intrinsic_duration)); - shared_ptr frame_A = get_frame (i); - shared_ptr frame_B = other_picture->get_frame (i); - - if (!frame_buffer_equals ( - i, opt, note, - frame_A->j2k_data(), frame_A->j2k_size(), - frame_B->j2k_data(), frame_B->j2k_size() - )) { - result = false; - if (!opt.keep_going) { - return result; + if (result || opt.keep_going) { + note (DCP_PROGRESS, String::compose ("Comparing video frame %1 of %2", i, _intrinsic_duration)); + shared_ptr frame_A = get_frame (i); + shared_ptr frame_B = other_picture->get_frame (i); + + if (!frame_buffer_equals ( + i, opt, note, + frame_A->j2k_data(), frame_A->j2k_size(), + frame_B->j2k_data(), frame_B->j2k_size() + )) { + result = false; } } } -- cgit v1.2.3