diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-15 15:59:46 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-15 15:59:46 +0400 |
commit | 6dc4ea34e44ae77125918ab9eda0fcfe7d9f0b3c (patch) | |
tree | 20c04bcd39de1a63b515154789e1a8551e77f082 /source/blender/editors/space_clip/clip_ops.c | |
parent | 0807c976f45f81bc289aa87e1c8cedd07f8245c1 (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/editors/space_clip/clip_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index b53cf027c78..1938cd7b53d 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -40,6 +40,7 @@ #include "BLI_path_util.h" #include "BLI_math.h" #include "BLI_rect.h" +#include "BLI_threads.h" #include "BLF_translation.h" @@ -1004,8 +1005,11 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog } } - if (build_undistort_count) + if (build_undistort_count) { + int threads = BLI_system_thread_count(); distortion = BKE_tracking_distortion_new(); + BKE_tracking_distortion_set_threads(distortion, threads); + } for (cfra = sfra; cfra <= efra; cfra++) { if (clip->source != MCLIP_SRC_MOVIE) |