[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45338] trunk/blender/source/blender/imbuf /intern: Multithreaded EXR files loading
Sergey Sharybin
sergey.vfx at gmail.com
Mon Apr 2 13:04:31 CEST 2012
Revision: 45338
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45338
Author: nazgul
Date: 2012-04-02 11:04:24 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
Multithreaded EXR files loading
Use multithreaded loading of EXR files which is enabling by call of
setGlobalThreadCount function from OpenEXR library to set up number
of used threads to number of system threads which speeds up loading
high-resolution files on multi-core / multi-cpu systems and allows
to work with high-resolution sequences in clip editor and sequencer.
Modified Paths:
--------------
trunk/blender/source/blender/imbuf/intern/filetype.c
trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.h
Modified: trunk/blender/source/blender/imbuf/intern/filetype.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/filetype.c 2012-04-02 10:20:10 UTC (rev 45337)
+++ trunk/blender/source/blender/imbuf/intern/filetype.c 2012-04-02 11:04:24 UTC (rev 45338)
@@ -80,7 +80,7 @@
{NULL, NULL, imb_is_a_openexr, imb_ftype_default, imb_load_openexr, imb_save_openexr, NULL, IM_FTYPE_FLOAT, OPENEXR},
#endif
#ifdef WITH_OPENJPEG
- {NULL, NULL, imb_is_a_jp2, imb_ftype_default, imb_jp2_decode, imb_savejp2, NULL, IM_FTYPE_FLOAT, JP2},
+ {imb_initopenexr, NULL, imb_is_a_jp2, imb_ftype_default, imb_jp2_decode, imb_savejp2, NULL, IM_FTYPE_FLOAT, JP2},
#endif
#ifdef WITH_DDS
{NULL, NULL, imb_is_a_dds, imb_ftype_default, imb_load_dds, NULL, NULL, 0, DDS},
Modified: trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
===================================================================
--- trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp 2012-04-02 10:20:10 UTC (rev 45337)
+++ trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp 2012-04-02 11:04:24 UTC (rev 45338)
@@ -51,6 +51,7 @@
#include "BLI_blenlib.h"
#include "BLI_math_color.h"
+#include "BLI_threads.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -1066,5 +1067,11 @@
}
+void imb_initopenexr(void)
+{
+ int num_threads = BLI_system_thread_count();
+ setGlobalThreadCount(num_threads);
+}
+
} // export "C"
Modified: trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.h
===================================================================
--- trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.h 2012-04-02 10:20:10 UTC (rev 45337)
+++ trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.h 2012-04-02 11:04:24 UTC (rev 45338)
@@ -43,7 +43,9 @@
* Test presence of OpenEXR file.
* \param mem pointer to loaded OpenEXR bitstream
*/
-
+
+void imb_initopenexr (void);
+
int imb_is_a_openexr (unsigned char *mem);
int imb_save_openexr (struct ImBuf *ibuf, const char *name, int flags);
More information about the Bf-blender-cvs
mailing list