72 #define THUMB_CACHE_LIMIT 5000
94 return ((
a->preview_render_size !=
b->preview_render_size) || (
a->rectx !=
b->rectx) ||
95 (
a->recty !=
b->recty) || (
a->bmain !=
b->bmain) || (
a->scene !=
b->scene) ||
96 (
a->motion_blur_shutter !=
b->motion_blur_shutter) ||
97 (
a->motion_blur_samples !=
b->motion_blur_samples) ||
98 (
a->scene->r.views_format !=
b->scene->r.views_format) || (
a->view_id !=
b->view_id));
103 unsigned int rval =
a->rectx +
a->recty;
105 rval ^=
a->preview_render_size;
108 rval ^= (int)(
a->motion_blur_shutter * 100.0f) << 10;
109 rval ^=
a->motion_blur_samples << 16;
110 rval ^= ((
a->scene->r.views_format * 2) +
a->view_id) << 24;
132 return ((
a->seq !=
b->seq) || (
a->frame_index !=
b->frame_index) || (
a->type !=
b->type) ||
138 float timeline_frame,
185 return ((
size_t)
U.memcachelimit) * 1024 * 1024;
232 if (stored_types_flag & key->
type) {
265 if (item && item->
ibuf) {
301 int pfjob_start, pfjob_end;
329 if (l_diff > r_diff) {
474 if (!cache || !base) {
503 cache->
bmain = bmain;
518 const float timeline_frame,
537 const float timeline_frame,
629 int invalidate_types,
630 bool force_seq_changed_range)
646 if (!force_seq_changed_range) {
671 if (key->
type & invalidate_source && key->
seq == seq &&
688 view_area_safe->
xmax += 200;
689 view_area_safe->
xmin -= 200;
690 view_area_safe->
ymin -= 1;
691 view_area_safe->
ymax += 1;
706 const int relative_base_frame =
round_fl_to_int((frame_index / (
float)frame_step)) *
708 const int nearest_guaranted_absolute_frame = relative_base_frame +
728 float timeline_frame,
738 if (
context->is_prefetch_render) {
795 if (
context->is_prefetch_render) {
837 rctf view_area_safe = *view_area;
855 if (
context->is_prefetch_render) {
894 bool callback_init(
void *
userdata,
size_t item_count),
895 bool callback_iter(
void *
userdata,
struct Sequence *seq,
int timeline_frame,
int cache_type))
File and directory operations.
Some types for dealing with directories.
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_reinsert(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghashIterator_step(GHashIterator *ghi)
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghash_len(const GHash *gh) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
MINLINE int round_fl_to_int(float a)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void BLI_mempool_free(BLI_mempool *pool, void *addr) ATTR_NONNULL(1
BLI_mempool * BLI_mempool_create(unsigned int esize, unsigned int elem_num, unsigned int pchunk, unsigned int flag) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_mutex_init(ThreadMutex *mutex)
#define BLI_MUTEX_INITIALIZER
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
pthread_mutex_t ThreadMutex
@ SEQ_CACHE_STORE_PREPROCESSED
@ SEQ_CACHE_STORE_THUMBNAIL
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_CACHE_STORE_COMPOSITE
@ SEQ_CACHE_PREFETCH_ENABLE
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void IMB_refImBuf(struct ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
SeqDiskCache * seq_disk_cache_create(Main *bmain, Scene *scene)
ImBuf * seq_disk_cache_read_file(SeqDiskCache *disk_cache, SeqCacheKey *key)
void seq_disk_cache_invalidate(SeqDiskCache *disk_cache, Scene *scene, Sequence *seq, Sequence *seq_changed, int invalidate_types)
void seq_disk_cache_free(SeqDiskCache *disk_cache)
bool seq_disk_cache_enforce_limits(SeqDiskCache *disk_cache)
bool seq_disk_cache_write_file(SeqDiskCache *disk_cache, SeqCacheKey *key, ImBuf *ibuf)
bool seq_disk_cache_is_enabled(Main *bmain)
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
void seq_cache_thumbnail_put(const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *i, rctf *view_area)
static unsigned int seq_cache_hashhash(const void *key_)
static void seq_cache_recycle_linked(Scene *scene, SeqCacheKey *base)
void SEQ_cache_cleanup(Scene *scene)
static void seq_cache_create(Main *bmain, Scene *scene)
static void seq_cache_unlock(Scene *scene)
bool seq_cache_put_if_possible(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *ibuf)
bool seq_cache_is_full(void)
static int get_stored_types_flag(Scene *scene, SeqCacheKey *key)
static void seq_cache_set_temp_cache_linked(Scene *scene, SeqCacheKey *base)
static unsigned int seq_hash_render_data(const SeqRenderData *a)
static void seq_cache_valfree(void *val)
#define THUMB_CACHE_LIMIT
void seq_cache_put(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *i)
static SeqCache * seq_cache_get_from_scene(Scene *scene)
static SeqCacheKey * seq_cache_allocate_key(SeqCache *cache, const SeqRenderData *context, Sequence *seq, const float timeline_frame, const int type)
static ImBuf * seq_cache_get_ex(SeqCache *cache, SeqCacheKey *key)
static SeqCacheKey * seq_cache_get_item_for_removal(Scene *scene)
static void seq_cache_relink_keys(SeqCacheKey *link_next, SeqCacheKey *link_prev)
void seq_cache_free_temp_cache(Scene *scene, short id, int timeline_frame)
void SEQ_cache_iterate(struct Scene *scene, void *userdata, bool callback_init(void *userdata, size_t item_count), bool callback_iter(void *userdata, struct Sequence *seq, int timeline_frame, int cache_type))
static float seq_cache_timeline_frame_to_frame_index(Scene *scene, Sequence *seq, float timeline_frame, int type)
static SeqCacheKey * seq_cache_choose_key(Scene *scene, SeqCacheKey *lkey, SeqCacheKey *rkey)
static ThreadMutex cache_create_lock
static bool seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b)
struct ImBuf * seq_cache_get(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type)
static void seq_cache_keyfree(void *val)
static void seq_cache_put_ex(Scene *scene, SeqCacheKey *key, ImBuf *ibuf)
void seq_cache_cleanup_sequence(Scene *scene, Sequence *seq, Sequence *seq_changed, int invalidate_types, bool force_seq_changed_range)
float seq_cache_frame_index_to_timeline_frame(Sequence *seq, float frame_index)
static bool seq_cache_hashcmp(const void *a_, const void *b_)
void seq_cache_cleanup_all(Main *bmain)
static void seq_cache_lock(Scene *scene)
void seq_cache_destruct(Scene *scene)
static void seq_cache_populate_key(SeqCacheKey *key, const SeqRenderData *context, Sequence *seq, const float timeline_frame, const int type)
static size_t seq_cache_get_mem_total(void)
void seq_cache_thumbnail_cleanup(Scene *scene, rctf *view_area_safe)
bool seq_cache_recycle_item(Scene *scene)
struct SeqCacheItem SeqCacheItem
void(* MEM_freeN)(void *vmemh)
size_t(* MEM_get_memory_in_use)(void)
void *(* MEM_callocN)(size_t len, const char *str)
SymEdge< T > * prev(const SymEdge< T > *se)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void seq_prefetch_get_time_range(Scene *scene, int *start, int *end)
bool seq_prefetch_job_is_running(Scene *scene)
void SEQ_prefetch_stop(Scene *scene)
Sequence * seq_prefetch_get_original_sequence(Sequence *seq, Scene *scene)
SeqRenderData * seq_prefetch_get_original_context(const SeqRenderData *context)
int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Scene *scene, const Sequence *seq)
int SEQ_time_left_handle_frame_get(const Scene *UNUSED(scene), const Sequence *seq)
float seq_give_frame_index(const Scene *scene, Sequence *seq, float timeline_frame)
float SEQ_time_start_frame_get(const Sequence *seq)
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
int64_t disk_cache_timestamp
struct SeqCache * cache_owner
struct SeqCacheKey * link_next
struct SeqRenderData context
struct SeqCache * cache_owner
struct SeqCacheKey * link_prev
ThreadMutex iterator_mutex
struct SeqCacheKey * last_key
struct SeqDiskCache * disk_cache
struct BLI_mempool * items_pool
struct BLI_mempool * keys_pool