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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-08-14 12:10:45 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-08-14 12:43:19 +0300
commit725a577327ef33575ab3157b1a2d0c2f2223519b (patch)
treefd55e055bb3c6c70966915899f5c1679e8bc6605 /source
parent4ac019cc07e374975bb65629d96dbd590f5e7a78 (diff)
Trackign: Add some basic logging about caching in frame accessor
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/tracking_util.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c
index 00918e62403..13cb7193d4d 100644
--- a/source/blender/blenkernel/intern/tracking_util.c
+++ b/source/blender/blenkernel/intern/tracking_util.c
@@ -58,6 +58,15 @@
#include "libmv-capi.h"
+/* Uncomment this to have caching-specific debug prints. */
+// #define DEBUG_CACHE
+
+#ifdef DEBUG_CACHE
+# define CACHE_PRINTF(...) printf(__VA_ARGS__)
+#else
+# define CACHE_PRINTF(...)
+#endif
+
/*********************** Tracks map *************************/
TracksMap *tracks_map_new(const char *object_name, bool is_camera, int num_tracks, int customdata_size)
@@ -708,9 +717,12 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
region,
transform_key);
if (ibuf != NULL) {
+ CACHE_PRINTF("Used buffer from cache for frame %d\n", frame);
return ibuf;
}
+ CACHE_PRINTF("Calculate new buffer for frame %d\n", frame);
+
/* And now we do postprocessing of the original frame. */
orig_ibuf = accessor_get_preprocessed_ibuf(accessor, clip_index, frame);
@@ -805,6 +817,7 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
/* pass */
}
else /* if (input_mode == LIBMV_IMAGE_MODE_MONO) */ {
+ BLI_assert(input_mode == LIBMV_IMAGE_MODE_MONO);
if (final_ibuf->channels != 1) {
ImBuf *grayscale_ibuf = make_grayscale_ibuf_copy(final_ibuf);
if (final_ibuf != orig_ibuf) {
@@ -815,7 +828,7 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
}
}
- /* it's possible processing still didn't happen at this point,
+ /* It's possible processing still didn't happen at this point,
* but we really need a copy of the buffer to be transformed
* and to be put to the cache.
*/