diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-14 18:28:24 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-14 18:28:24 +0400 |
commit | cd4ffe496aa63e78b46f332ec24873cd0fce3061 (patch) | |
tree | f807d290aefe7d387db3d55f37ef35f26a05f7f5 /source/blender/blenkernel | |
parent | 51077ea97afd45fc07b097e7e164d67e3ab11ef6 (diff) |
Sequencer: clear cache and animation buffers for strips outside of cursor when rendering
This avoids having bunch of cached images when doing animation rendering,
keeping all the memory available for rendered itself.
This keeps memory usage low when rendering huge edits with mixed
scenes and movie strips.
This should not affect on sped of video encoding, which was confirmed by
some own tests.
--
svn merge -r50051:50052 ^/branches/soc-2011-tomato
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 37 |
2 files changed, 10 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 69e10d1426b..51a64c97ca6 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -291,7 +291,7 @@ void BKE_sequencer_dupe_animdata(struct Scene *scene, const char *name_src, cons int BKE_sequence_base_shuffle(struct ListBase *seqbasep, struct Sequence *test, struct Scene *evil_scene); int BKE_sequence_base_shuffle_time(ListBase *seqbasep, struct Scene *evil_scene); int BKE_sequence_base_isolated_sel_check(struct ListBase *seqbase); -void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, int check_mem_usage, int keep_file_handles); +void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, int for_render); struct Sequence *BKE_sequence_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag); int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 07c8da2837e..2596bf57f05 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2993,46 +2993,27 @@ void BKE_sequence_invalidate_cache_for_modifier(Scene *scene, Sequence *seq) sequence_invalidate_cache(scene, seq, TRUE, FALSE); } -void BKE_sequencer_free_imbuf(Scene *scene, ListBase *seqbase, int check_mem_usage, int keep_file_handles) +void BKE_sequencer_free_imbuf(Scene *scene, ListBase *seqbase, int for_render) { Sequence *seq; - if (check_mem_usage) { - /* Let the cache limitor take care of this (schlaile) */ - /* While render let's keep all memory available for render - * (ton) - * At least if free memory is tight... - * This can make a big difference in encoding speed - * (it is around 4 times(!) faster, if we do not waste time - * on freeing _all_ buffers every time on long timelines...) - * (schlaile) - */ - - uintptr_t mem_in_use; - uintptr_t mmap_in_use; - uintptr_t max; - - mem_in_use = MEM_get_memory_in_use(); - mmap_in_use = MEM_get_mapped_memory_in_use(); - max = MEM_CacheLimiter_get_maximum(); - - if (max == 0 || mem_in_use + mmap_in_use <= max) { - return; - } - } - BKE_sequencer_cache_cleanup(); - + for (seq = seqbase->first; seq; seq = seq->next) { + if (for_render && CFRA >= seq->startdisp && CFRA <= seq->enddisp) { + continue; + } + if (seq->strip) { - if (seq->type == SEQ_TYPE_MOVIE && !keep_file_handles) + if (seq->type == SEQ_TYPE_MOVIE) { free_anim_seq(seq); + } if (seq->type == SEQ_TYPE_SPEED) { BKE_sequence_effect_speed_rebuild_map(scene, seq, 1); } } if (seq->type == SEQ_TYPE_META) { - BKE_sequencer_free_imbuf(scene, &seq->seqbase, FALSE, keep_file_handles); + BKE_sequencer_free_imbuf(scene, &seq->seqbase, for_render); } if (seq->type == SEQ_TYPE_SCENE) { /* FIXME: recurs downwards, |