Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-03-15 15:59:46 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-03-15 15:59:46 +0400
commit6dc4ea34e44ae77125918ab9eda0fcfe7d9f0b3c (patch)
tree20c04bcd39de1a63b515154789e1a8551e77f082 /source/blender/blenkernel/intern
parent0807c976f45f81bc289aa87e1c8cedd07f8245c1 (diff)
Multi-threaded frame calculation for movie clip proxies
This commit implements multi-threaded calculation of frames when building proxies. Both scaling and undistortion steps are now threaded. Frames and proxy resolution are still handled one-by-one, saving files after every single step. So if HDD is not so fast, this commit could have not so much benefit. Internal changes: - Added IMB_scaleImBuf_threaded which scales given image buffer in multiple threads and uses bilinear filtering. - libmv's camera intrinsics now have SetThreads() method which is used to specify how many OpenMP threads to use for buffer distortion/undistortion. And yeah, this code is using OpenMP for threading. - Reshuffled a bit libmv-capi calls and added function BKE_tracking_distortion_set_threads to specify number of threads used by intrinscis.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/movieclip.c2
-rw-r--r--source/blender/blenkernel/intern/tracking.c19
2 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index ab42d86152d..1ad0bf1988c 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -1244,7 +1244,7 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i
scaleibuf = IMB_dupImBuf(ibuf);
- IMB_scaleImBuf(scaleibuf, (short)rectx, (short)recty);
+ IMB_scaleImBuf_threaded(scaleibuf, (short)rectx, (short)recty);
quality = clip->proxy.quality;
scaleibuf->ftype = JPG | quality;
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 5f8e25af2ee..3100917cd0c 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -1462,6 +1462,8 @@ MovieDistortion *BKE_tracking_distortion_new(void)
distortion = MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
+ distortion->intrinsics = libmv_CameraIntrinsicsNewEmpty();
+
return distortion;
}
@@ -1474,12 +1476,7 @@ void BKE_tracking_distortion_update(MovieDistortion *distortion, MovieTracking *
cameraIntrinscisOptionsFromTracking(&camera_intrinsics_options, tracking,
calibration_width, calibration_height);
- if (!distortion->intrinsics) {
- distortion->intrinsics = libmv_CameraIntrinsicsNew(&camera_intrinsics_options);
- }
- else {
- libmv_CameraIntrinsicsUpdate(distortion->intrinsics, &camera_intrinsics_options);
- }
+ libmv_CameraIntrinsicsUpdate(distortion->intrinsics, &camera_intrinsics_options);
#else
(void) distortion;
(void) tracking;
@@ -1488,6 +1485,16 @@ void BKE_tracking_distortion_update(MovieDistortion *distortion, MovieTracking *
#endif
}
+void BKE_tracking_distortion_set_threads(MovieDistortion *distortion, int threads)
+{
+#ifdef WITH_LIBMV
+ libmv_CameraIntrinsicsSetThreads(distortion->intrinsics, threads);
+#else
+ (void) distortion;
+ (void) threads;
+#endif
+}
+
MovieDistortion *BKE_tracking_distortion_copy(MovieDistortion *distortion)
{
MovieDistortion *new_distortion;