summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-02 12:49:00 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-02 12:49:00 +0000
commit555ced5ed96828bd332623665c0565cd8b3a0df6 (patch)
treedd1cc225304c3d20a69e134a897a19eca1dcf290 /src
parent6e9b1b0ca5e839bda7b567b609cebb92a1cb95a7 (diff)
Use OpenMP when comparing picture assets.
Diffstat (limited to 'src')
-rw-r--r--src/mono_picture_asset.cc26
1 files changed, 13 insertions, 13 deletions
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<const Asset> 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<const MonoPictureFrame> frame_A = get_frame (i);
- shared_ptr<const MonoPictureFrame> 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<const MonoPictureFrame> frame_A = get_frame (i);
+ shared_ptr<const MonoPictureFrame> 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;
}
}
}