[SCM] blender/master: debian/patches/: patchset updated

mfv at users.alioth.debian.org mfv at users.alioth.debian.org
Sat Sep 23 20:11:24 UTC 2017


The following commit has been merged in the master branch:
commit 8508b502988ac0a97befcef2c3f2e68244dc5f0f
Author: Matteo F. Vescovi <mfv at debian.org>
Date:   Sat Sep 23 15:25:38 2017 +0200

    debian/patches/: patchset updated
    
    - #0003 refreshed
    - #0008 -> #0010 dropped (applied upstream)

diff --git a/debian/patches/0001-blender_thumbnailer.patch b/debian/patches/0001-blender_thumbnailer.patch
index b186f13..6d45ed6 100644
--- a/debian/patches/0001-blender_thumbnailer.patch
+++ b/debian/patches/0001-blender_thumbnailer.patch
@@ -12,7 +12,7 @@ Subject: blender_thumbnailer
 
 diff --git a/blender.thumbnailer b/blender.thumbnailer
 new file mode 100644
-index 000000000..05d4faeb9
+index 0000000..05d4fae
 --- /dev/null
 +++ b/blender.thumbnailer
 @@ -0,0 +1,4 @@
@@ -21,10 +21,10 @@ index 000000000..05d4faeb9
 +Exec=/usr/share/blender/scripts/blender-thumbnailer.py %i %o
 +MimeType=application/x-blender;
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index f65688e13..2f5741753 100644
+index 8f26e24..6763208 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -486,7 +486,7 @@ if(UNIX AND NOT APPLE)
+@@ -475,7 +475,7 @@ if(UNIX AND NOT APPLE)
  		install(
  			PROGRAMS
  			${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
diff --git a/debian/patches/0002-install_in_usr_share.patch b/debian/patches/0002-install_in_usr_share.patch
index 183dc5e..385dabf 100644
--- a/debian/patches/0002-install_in_usr_share.patch
+++ b/debian/patches/0002-install_in_usr_share.patch
@@ -9,10 +9,10 @@ Subject: install_in_usr_share
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 2f5741753..c3140c999 100644
+index 6763208..aff1670 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -353,8 +353,8 @@ if(WITH_PYTHON)
+@@ -342,8 +342,8 @@ if(WITH_PYTHON)
  	endif()
  
  	install(
diff --git a/debian/patches/0003-locales_directory_install.patch b/debian/patches/0003-locales_directory_install.patch
index 54729e7..9e43d37 100644
--- a/debian/patches/0003-locales_directory_install.patch
+++ b/debian/patches/0003-locales_directory_install.patch
@@ -1,5 +1,5 @@
 From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Fri, 22 Apr 2016 17:05:17 +0200
+Date: Sat, 23 Sep 2017 15:19:47 +0200
 Subject: locales_directory_install
 
 Change where locales are installed.
@@ -15,10 +15,10 @@ Contributions by:
  4 files changed, 11 insertions(+), 7 deletions(-)
 
 diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h
-index 077fe2a62..905106df8 100644
+index ac8f861..b8af277 100644
 --- a/source/blender/blenkernel/BKE_appdir.h
 +++ b/source/blender/blenkernel/BKE_appdir.h
-@@ -67,6 +67,7 @@ enum {
+@@ -71,6 +71,7 @@ enum {
  	BLENDER_SYSTEM_DATAFILES    = 52,
  	BLENDER_SYSTEM_SCRIPTS      = 53,
  	BLENDER_SYSTEM_PYTHON       = 54,
@@ -27,11 +27,11 @@ index 077fe2a62..905106df8 100644
  
  /* for BKE_appdir_folder_id_version only */
 diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
-index b1dcc4027..de2014eed 100644
+index 48012bd..92f1f1c 100644
 --- a/source/blender/blenkernel/intern/appdir.c
 +++ b/source/blender/blenkernel/intern/appdir.c
-@@ -398,6 +398,9 @@ const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder)
- 			if (get_path_system(path, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
+@@ -421,6 +421,9 @@ const char *BKE_appdir_folder_id_ex(
+ 			if (get_path_system(path, path_len, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
  			return NULL;
  
 +		case BLENDER_SYSTEM_LOCALE:
@@ -41,7 +41,7 @@ index b1dcc4027..de2014eed 100644
  			BLI_assert(0);
  			break;
 diff --git a/source/blender/blentranslation/intern/blt_lang.c b/source/blender/blentranslation/intern/blt_lang.c
-index 74c2b4b74..9dc3c8882 100644
+index 74c2b4b..9dc3c88 100644
 --- a/source/blender/blentranslation/intern/blt_lang.c
 +++ b/source/blender/blentranslation/intern/blt_lang.c
 @@ -88,9 +88,9 @@ static void free_locales(void)
@@ -84,10 +84,10 @@ index 74c2b4b74..9dc3c8882 100644
  	else {
  		printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index c3140c999..504f85d26 100644
+index aff1670..e2617ef 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -372,11 +372,11 @@ if(WITH_INTERNATIONAL)
+@@ -361,11 +361,11 @@ if(WITH_INTERNATIONAL)
  	install(
  		DIRECTORY
  			${CMAKE_SOURCE_DIR}/release/datafiles/fonts
diff --git a/debian/patches/0004-update_manpages.patch b/debian/patches/0004-update_manpages.patch
index fae91e3..ef1bf13 100644
--- a/debian/patches/0004-update_manpages.patch
+++ b/debian/patches/0004-update_manpages.patch
@@ -12,7 +12,7 @@ Subject: update_manpages
 
 diff --git a/doc/manpage/blenderplayer.1 b/doc/manpage/blenderplayer.1
 new file mode 100644
-index 000000000..5435c63e1
+index 0000000..5435c63
 --- /dev/null
 +++ b/doc/manpage/blenderplayer.1
 @@ -0,0 +1,131 @@
@@ -148,10 +148,10 @@ index 000000000..5435c63e1
 +.SH AUTHORS
 +This manpage was written for a Debian by Kevin Roy <kiniou at gmail.com>.
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 504f85d26..10ce80a37 100644
+index e2617ef..72cd654 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -480,6 +480,7 @@ if(UNIX AND NOT APPLE)
+@@ -469,6 +469,7 @@ if(UNIX AND NOT APPLE)
  			FILES
  				${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
  				${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
@@ -159,7 +159,7 @@ index 504f85d26..10ce80a37 100644
  			DESTINATION "."
  		)
  
-@@ -502,6 +503,10 @@ if(UNIX AND NOT APPLE)
+@@ -491,6 +492,10 @@ if(UNIX AND NOT APPLE)
  				FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
  				DESTINATION share/man/man1
  			)
diff --git a/debian/patches/0005-do_not_use_version_number_in_system_path.patch b/debian/patches/0005-do_not_use_version_number_in_system_path.patch
index 2f8986a..814ff2d 100644
--- a/debian/patches/0005-do_not_use_version_number_in_system_path.patch
+++ b/debian/patches/0005-do_not_use_version_number_in_system_path.patch
@@ -14,7 +14,7 @@ Contributions by:
  2 files changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/intern/ghost/intern/GHOST_SystemPathsUnix.cpp b/intern/ghost/intern/GHOST_SystemPathsUnix.cpp
-index 8738b8dd0..91d336cd2 100644
+index 8738b8d..91d336c 100644
 --- a/intern/ghost/intern/GHOST_SystemPathsUnix.cpp
 +++ b/intern/ghost/intern/GHOST_SystemPathsUnix.cpp
 @@ -61,6 +61,9 @@ GHOST_SystemPathsUnix::~GHOST_SystemPathsUnix()
@@ -28,10 +28,10 @@ index 8738b8dd0..91d336cd2 100644
  	if (static_path) {
  		static string system_path = string(static_path) + "/blender/" + versionstr;
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 10ce80a37..69e53b3af 100644
+index 72cd654..22bf933 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -306,7 +306,7 @@ if(UNIX AND NOT APPLE)
+@@ -295,7 +295,7 @@ if(UNIX AND NOT APPLE)
  		if(WITH_INSTALL_PORTABLE)
  			set(TARGETDIR_VER ${BLENDER_VERSION})
  		else()
diff --git a/debian/patches/0006-look_for_dejavu_ttf_with_fontconfig.patch b/debian/patches/0006-look_for_dejavu_ttf_with_fontconfig.patch
index 29c488a..004bd0f 100644
--- a/debian/patches/0006-look_for_dejavu_ttf_with_fontconfig.patch
+++ b/debian/patches/0006-look_for_dejavu_ttf_with_fontconfig.patch
@@ -19,10 +19,10 @@ Subject: look_for_dejavu_ttf_with_fontconfig
  create mode 100644 build_files/cmake/Modules/FindFontconfig.cmake
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 578f913f8..d9fdaaaa0 100644
+index 0423781..83122b7 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -202,6 +202,9 @@ option(WITH_BLENDER "Build blender (disable to build only the blender player)" O
+@@ -204,6 +204,9 @@ option(WITH_BLENDER "Build blender (disable to build only the blender player)" O
  mark_as_advanced(WITH_BLENDER)
  
  option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
@@ -32,7 +32,7 @@ index 578f913f8..d9fdaaaa0 100644
  
  option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
  option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON) 
-@@ -1781,6 +1784,9 @@ if(FIRST_RUN)
+@@ -1751,6 +1754,9 @@ if(FIRST_RUN)
  		info_cfg_option(WITH_GL_ANGLE)
  	endif()
  
@@ -44,7 +44,7 @@ index 578f913f8..d9fdaaaa0 100644
  	message("${_config_msg}")
 diff --git a/build_files/cmake/Modules/FindFontconfig.cmake b/build_files/cmake/Modules/FindFontconfig.cmake
 new file mode 100644
-index 000000000..7dc09f30a
+index 0000000..7dc09f3
 --- /dev/null
 +++ b/build_files/cmake/Modules/FindFontconfig.cmake
 @@ -0,0 +1,48 @@
@@ -97,7 +97,7 @@ index 000000000..7dc09f30a
 +
 +endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
 diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
-index 5a67ac981..aa0675ff1 100644
+index 6303119..4e142ef 100644
 --- a/build_files/cmake/macros.cmake
 +++ b/build_files/cmake/macros.cmake
 @@ -302,6 +302,9 @@ function(SETUP_LIBDIRS)
@@ -121,7 +121,7 @@ index 5a67ac981..aa0675ff1 100644
  		target_link_libraries(${target} ${BULLET_LIBRARIES})
  	endif()
 diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
-index e33141f80..3e3c8834b 100644
+index 62e0caa..4e889ea 100644
 --- a/build_files/cmake/platform/platform_unix.cmake
 +++ b/build_files/cmake/platform/platform_unix.cmake
 @@ -132,6 +132,13 @@ if(WITH_JACK)
@@ -139,7 +139,7 @@ index e33141f80..3e3c8834b 100644
  if(WITH_CODEC_SNDFILE)
  	find_package_wrapper(SndFile)
 diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
-index 36ad6fe03..19d2bab31 100644
+index 36ad6fe..19d2bab 100644
 --- a/source/blender/blenfont/CMakeLists.txt
 +++ b/source/blender/blenfont/CMakeLists.txt
 @@ -64,6 +64,13 @@ if(WITH_INTERNATIONAL)
@@ -157,7 +157,7 @@ index 36ad6fe03..19d2bab31 100644
  	add_definitions(-DWITH_PYTHON)
  	list(APPEND INC
 diff --git a/source/blender/blenfont/intern/blf_font_i18n.c b/source/blender/blenfont/intern/blf_font_i18n.c
-index b6ff7ed86..e343c73ae 100644
+index b6ff7ed..e343c73 100644
 --- a/source/blender/blenfont/intern/blf_font_i18n.c
 +++ b/source/blender/blenfont/intern/blf_font_i18n.c
 @@ -45,10 +45,14 @@
@@ -245,10 +245,10 @@ index b6ff7ed86..e343c73ae 100644
  
  	*r_unifont_size = unifont_mono_size;
 diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
-index 91d139c70..20cca0113 100644
+index 5c1fa57..b90ac2d 100644
 --- a/source/blender/blenlib/BLI_fileops.h
 +++ b/source/blender/blenlib/BLI_fileops.h
-@@ -90,6 +90,7 @@ bool   BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+@@ -88,6 +88,7 @@ bool   BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
  bool   BLI_dir_create_recursive(const char *dir) ATTR_NONNULL();
  double BLI_dir_free_space(const char *dir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
  char  *BLI_current_working_dir(char *dir, const size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
@@ -257,10 +257,10 @@ index 91d139c70..20cca0113 100644
  /* Filelist */
  
 diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
-index db4b3bcf2..dc240eed6 100644
+index 1df7f6f..e6d3b19 100644
 --- a/source/blender/blenlib/intern/fileops.c
 +++ b/source/blender/blenlib/intern/fileops.c
-@@ -159,6 +159,49 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size)
+@@ -156,6 +156,49 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size)
  	return mem;
  }
  
@@ -311,10 +311,10 @@ index db4b3bcf2..dc240eed6 100644
   * Returns true if the file with the specified name can be written.
   * This implementation uses access(2), which makes the check according
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 69e53b3af..7421477a9 100644
+index 22bf933..d3e6686 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -369,12 +369,6 @@ endif()
+@@ -358,12 +358,6 @@ endif()
  
  # localization
  if(WITH_INTERNATIONAL)
diff --git a/debian/patches/0007-fix_OpenJPEG2_build.patch b/debian/patches/0007-fix_OpenJPEG2_build.patch
index 89c819d..5147def 100644
--- a/debian/patches/0007-fix_OpenJPEG2_build.patch
+++ b/debian/patches/0007-fix_OpenJPEG2_build.patch
@@ -6,84 +6,96 @@ Temp branch for quick testing.
 Keep this until OpenImageIO add support and
 we can add the changes back to master.
 ---
- build_files/cmake/Modules/FindOpenJPEG.cmake       |     5 +-
- extern/libopenjpeg/CMakeLists.txt                  |    30 +-
- extern/libopenjpeg/bio.c                           |    95 +-
- extern/libopenjpeg/bio.h                           |    47 +-
- extern/libopenjpeg/cidx_manager.c                  |   228 +-
- extern/libopenjpeg/cidx_manager.h                  |    18 +-
- extern/libopenjpeg/cio.c                           |   704 +-
- extern/libopenjpeg/cio.h                           |   378 +-
- extern/libopenjpeg/dwt.c                           |   761 +-
- extern/libopenjpeg/dwt.h                           |    33 +-
- extern/libopenjpeg/event.c                         |    75 +-
- extern/libopenjpeg/event.h                         |    58 +-
- extern/libopenjpeg/function_list.c                 |   119 +
- extern/libopenjpeg/function_list.h                 |   131 +
- extern/libopenjpeg/image.c                         |   163 +-
- extern/libopenjpeg/image.h                         |    28 +-
- extern/libopenjpeg/indexbox_manager.h              |    44 +-
- extern/libopenjpeg/invert.c                        |   294 +
- extern/libopenjpeg/{jpt.h => invert.h}             |    71 +-
- extern/libopenjpeg/j2k.c                           | 12514 +++++++++++++++----
- extern/libopenjpeg/j2k.h                           |   804 +-
- extern/libopenjpeg/jp2.c                           |  3331 +++--
- extern/libopenjpeg/jp2.h                           |   485 +-
- extern/libopenjpeg/jpt.c                           |   155 -
- extern/libopenjpeg/mct.c                           |   249 +-
- extern/libopenjpeg/mct.h                           |    75 +-
- extern/libopenjpeg/mqc.c                           |   230 +-
- extern/libopenjpeg/mqc.h                           |    67 +-
- extern/libopenjpeg/openjpeg.c                      |   951 +-
- extern/libopenjpeg/openjpeg.h                      |  1289 +-
- extern/libopenjpeg/{j2k_lib.c => opj_clock.c}      |    15 +-
- extern/libopenjpeg/{j2k_lib.h => opj_clock.h}      |    19 +-
- extern/libopenjpeg/opj_codec.h                     |   165 +
- extern/libopenjpeg/opj_config.h                    |    42 +-
- extern/libopenjpeg/opj_config_private.h            |     6 +
- extern/libopenjpeg/opj_includes.h                  |    99 +-
- extern/libopenjpeg/{int.h => opj_intmath.h}        |    91 +-
- extern/libopenjpeg/{license.txt => opj_inttypes.h} |    32 +-
- extern/libopenjpeg/opj_malloc.h                    |    20 +
- extern/libopenjpeg/{fix.h => opj_stdint.h}         |    60 +-
- extern/libopenjpeg/phix_manager.c                  |   113 +-
- extern/libopenjpeg/pi.c                            |  2057 ++-
- extern/libopenjpeg/pi.h                            |   166 +-
- extern/libopenjpeg/ppix_manager.c                  |   113 +-
- extern/libopenjpeg/raw.c                           |    28 +-
- extern/libopenjpeg/raw.h                           |    36 +-
- extern/libopenjpeg/t1.c                            |  2190 ++--
- extern/libopenjpeg/t1.h                            |    70 +-
- extern/libopenjpeg/t1_generate_luts.c              |   282 +
- extern/libopenjpeg/t1_luts.h                       |    14 +-
- extern/libopenjpeg/t2.c                            |  1973 +--
- extern/libopenjpeg/t2.h                            |    86 +-
- extern/libopenjpeg/tcd.c                           |  3568 +++---
- extern/libopenjpeg/tcd.h                           |   354 +-
- extern/libopenjpeg/tgt.c                           |   456 +-
- extern/libopenjpeg/tgt.h                           |    68 +-
- extern/libopenjpeg/thix_manager.c                  |   102 +-
- extern/libopenjpeg/tpix_manager.c                  |   164 +-
- source/blender/imbuf/intern/IMB_filetype.h         |     5 +-
- source/blender/imbuf/intern/filetype.c             |     2 +-
- source/blender/imbuf/intern/jp2.c                  |   494 +-
- 61 files changed, 26191 insertions(+), 10131 deletions(-)
+ build_files/cmake/Modules/FindOpenJPEG.cmake |     5 +-
+ extern/libopenjpeg/CMakeLists.txt            |    30 +-
+ extern/libopenjpeg/bio.c                     |    95 +-
+ extern/libopenjpeg/bio.h                     |    47 +-
+ extern/libopenjpeg/cidx_manager.c            |   228 +-
+ extern/libopenjpeg/cidx_manager.h            |    18 +-
+ extern/libopenjpeg/cio.c                     |   704 +-
+ extern/libopenjpeg/cio.h                     |   378 +-
+ extern/libopenjpeg/dwt.c                     |   761 +-
+ extern/libopenjpeg/dwt.h                     |    33 +-
+ extern/libopenjpeg/event.c                   |    75 +-
+ extern/libopenjpeg/event.h                   |    58 +-
+ extern/libopenjpeg/fix.h                     |    64 -
+ extern/libopenjpeg/function_list.c           |   119 +
+ extern/libopenjpeg/function_list.h           |   131 +
+ extern/libopenjpeg/image.c                   |   163 +-
+ extern/libopenjpeg/image.h                   |    28 +-
+ extern/libopenjpeg/indexbox_manager.h        |    44 +-
+ extern/libopenjpeg/int.h                     |   119 -
+ extern/libopenjpeg/invert.c                  |   294 +
+ extern/libopenjpeg/invert.h                  |    64 +
+ extern/libopenjpeg/j2k.c                     | 12514 ++++++++++++++++++++-----
+ extern/libopenjpeg/j2k.h                     |   804 +-
+ extern/libopenjpeg/j2k_lib.c                 |    59 -
+ extern/libopenjpeg/j2k_lib.h                 |    54 -
+ extern/libopenjpeg/jp2.c                     |  3331 +++++--
+ extern/libopenjpeg/jp2.h                     |   485 +-
+ extern/libopenjpeg/jpt.c                     |   155 -
+ extern/libopenjpeg/jpt.h                     |    75 -
+ extern/libopenjpeg/license.txt               |    30 -
+ extern/libopenjpeg/mct.c                     |   249 +-
+ extern/libopenjpeg/mct.h                     |    75 +-
+ extern/libopenjpeg/mqc.c                     |   230 +-
+ extern/libopenjpeg/mqc.h                     |    67 +-
+ extern/libopenjpeg/openjpeg.c                |   951 +-
+ extern/libopenjpeg/openjpeg.h                |  1289 ++-
+ extern/libopenjpeg/opj_clock.c               |    64 +
+ extern/libopenjpeg/opj_clock.h               |    59 +
+ extern/libopenjpeg/opj_codec.h               |   165 +
+ extern/libopenjpeg/opj_config.h              |    42 +-
+ extern/libopenjpeg/opj_config_private.h      |     6 +
+ extern/libopenjpeg/opj_includes.h            |    99 +-
+ extern/libopenjpeg/opj_intmath.h             |   178 +
+ extern/libopenjpeg/opj_inttypes.h            |    48 +
+ extern/libopenjpeg/opj_malloc.h              |    20 +
+ extern/libopenjpeg/opj_stdint.h              |    52 +
+ extern/libopenjpeg/phix_manager.c            |   113 +-
+ extern/libopenjpeg/pi.c                      |  2057 ++--
+ extern/libopenjpeg/pi.h                      |   166 +-
+ extern/libopenjpeg/ppix_manager.c            |   113 +-
+ extern/libopenjpeg/raw.c                     |    28 +-
+ extern/libopenjpeg/raw.h                     |    36 +-
+ extern/libopenjpeg/t1.c                      |  2190 +++--
+ extern/libopenjpeg/t1.h                      |    70 +-
+ extern/libopenjpeg/t1_generate_luts.c        |   282 +
+ extern/libopenjpeg/t1_luts.h                 |    14 +-
+ extern/libopenjpeg/t2.c                      |  1973 ++--
+ extern/libopenjpeg/t2.h                      |    86 +-
+ extern/libopenjpeg/tcd.c                     |  3568 ++++---
+ extern/libopenjpeg/tcd.h                     |   354 +-
+ extern/libopenjpeg/tgt.c                     |   456 +-
+ extern/libopenjpeg/tgt.h                     |    68 +-
+ extern/libopenjpeg/thix_manager.c            |   102 +-
+ extern/libopenjpeg/tpix_manager.c            |   164 +-
+ source/blender/imbuf/intern/IMB_filetype.h   |     5 +-
+ source/blender/imbuf/intern/filetype.c       |     2 +-
+ source/blender/imbuf/intern/jp2.c            |   494 +-
+ 67 files changed, 26480 insertions(+), 10420 deletions(-)
+ delete mode 100644 extern/libopenjpeg/fix.h
  create mode 100644 extern/libopenjpeg/function_list.c
  create mode 100644 extern/libopenjpeg/function_list.h
+ delete mode 100644 extern/libopenjpeg/int.h
  create mode 100644 extern/libopenjpeg/invert.c
- rename extern/libopenjpeg/{jpt.h => invert.h} (50%)
+ create mode 100644 extern/libopenjpeg/invert.h
+ delete mode 100644 extern/libopenjpeg/j2k_lib.c
+ delete mode 100644 extern/libopenjpeg/j2k_lib.h
  delete mode 100644 extern/libopenjpeg/jpt.c
- rename extern/libopenjpeg/{j2k_lib.c => opj_clock.c} (80%)
- rename extern/libopenjpeg/{j2k_lib.h => opj_clock.h} (78%)
+ delete mode 100644 extern/libopenjpeg/jpt.h
+ delete mode 100644 extern/libopenjpeg/license.txt
+ create mode 100644 extern/libopenjpeg/opj_clock.c
+ create mode 100644 extern/libopenjpeg/opj_clock.h
  create mode 100644 extern/libopenjpeg/opj_codec.h
  create mode 100644 extern/libopenjpeg/opj_config_private.h
- rename extern/libopenjpeg/{int.h => opj_intmath.h} (54%)
- rename extern/libopenjpeg/{license.txt => opj_inttypes.h} (66%)
- rename extern/libopenjpeg/{fix.h => opj_stdint.h} (56%)
+ create mode 100644 extern/libopenjpeg/opj_intmath.h
+ create mode 100644 extern/libopenjpeg/opj_inttypes.h
+ create mode 100644 extern/libopenjpeg/opj_stdint.h
  create mode 100644 extern/libopenjpeg/t1_generate_luts.c
 
 diff --git a/build_files/cmake/Modules/FindOpenJPEG.cmake b/build_files/cmake/Modules/FindOpenJPEG.cmake
-index d76510363..1f825914a 100644
+index d765103..1f82591 100644
 --- a/build_files/cmake/Modules/FindOpenJPEG.cmake
 +++ b/build_files/cmake/Modules/FindOpenJPEG.cmake
 @@ -41,13 +41,14 @@ FIND_PATH(OPENJPEG_INCLUDE_DIR
@@ -104,7 +116,7 @@ index d76510363..1f825914a 100644
      ${_openjpeg_SEARCH_DIRS}
    PATH_SUFFIXES
 diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt
-index ad49eee25..0af2a90e1 100644
+index ad49eee..0af2a90 100644
 --- a/extern/libopenjpeg/CMakeLists.txt
 +++ b/extern/libopenjpeg/CMakeLists.txt
 @@ -31,49 +31,56 @@ set(INC_SYS
@@ -185,7 +197,7 @@ index ad49eee25..0af2a90e1 100644
  
  blender_add_lib(extern_openjpeg "${SRC}" "${INC}" "${INC_SYS}")
 diff --git a/extern/libopenjpeg/bio.c b/extern/libopenjpeg/bio.c
-index f04f3e503..5d4958017 100644
+index f04f3e5..5d49580 100644
 --- a/extern/libopenjpeg/bio.c
 +++ b/extern/libopenjpeg/bio.c
 @@ -1,9 +1,15 @@
@@ -389,7 +401,7 @@ index f04f3e503..5d4958017 100644
 +	return OPJ_TRUE;
  }
 diff --git a/extern/libopenjpeg/bio.h b/extern/libopenjpeg/bio.h
-index 764d7cb2e..fba242847 100644
+index 764d7cb..fba2428 100644
 --- a/extern/libopenjpeg/bio.h
 +++ b/extern/libopenjpeg/bio.h
 @@ -1,9 +1,15 @@
@@ -513,7 +525,7 @@ index 764d7cb2e..fba242847 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/cidx_manager.c b/extern/libopenjpeg/cidx_manager.c
-index f3b251ffa..ff2dbdaa3 100644
+index f3b251f..ff2dbda 100644
 --- a/extern/libopenjpeg/cidx_manager.c
 +++ b/extern/libopenjpeg/cidx_manager.c
 @@ -1,8 +1,8 @@
@@ -828,7 +840,7 @@ index f3b251ffa..ff2dbdaa3 100644
    return EPHused;
  }
 diff --git a/extern/libopenjpeg/cidx_manager.h b/extern/libopenjpeg/cidx_manager.h
-index 23eebd52b..d0bbef883 100644
+index 23eebd5..d0bbef8 100644
 --- a/extern/libopenjpeg/cidx_manager.h
 +++ b/extern/libopenjpeg/cidx_manager.h
 @@ -1,8 +1,8 @@
@@ -864,7 +876,7 @@ index 23eebd52b..d0bbef883 100644
  
  #endif      /* !CIDX_MANAGER_H_ */
 diff --git a/extern/libopenjpeg/cio.c b/extern/libopenjpeg/cio.c
-index 97cccea6d..1fc239374 100644
+index 97cccea..1fc2393 100644
 --- a/extern/libopenjpeg/cio.c
 +++ b/extern/libopenjpeg/cio.c
 @@ -1,10 +1,18 @@
@@ -1625,7 +1637,7 @@ index 97cccea6d..1fc239374 100644
 +	return OPJ_FALSE;
 +}
 diff --git a/extern/libopenjpeg/cio.h b/extern/libopenjpeg/cio.h
-index e62743141..6dfa5bb84 100644
+index e627431..6dfa5bb 100644
 --- a/extern/libopenjpeg/cio.h
 +++ b/extern/libopenjpeg/cio.h
 @@ -1,10 +1,18 @@
@@ -2043,7 +2055,7 @@ index e62743141..6dfa5bb84 100644
  #endif /* __CIO_H */
  
 diff --git a/extern/libopenjpeg/dwt.c b/extern/libopenjpeg/dwt.c
-index 0fbfc2033..e1f8a337d 100644
+index 0fbfc20..e1f8a33 100644
 --- a/extern/libopenjpeg/dwt.c
 +++ b/extern/libopenjpeg/dwt.c
 @@ -1,9 +1,15 @@
@@ -3209,7 +3221,7 @@ index 0fbfc2033..e1f8a337d 100644
  }
 -
 diff --git a/extern/libopenjpeg/dwt.h b/extern/libopenjpeg/dwt.h
-index adf73e544..f8b57bc0c 100644
+index adf73e5..f8b57bc 100644
 --- a/extern/libopenjpeg/dwt.h
 +++ b/extern/libopenjpeg/dwt.h
 @@ -1,9 +1,15 @@
@@ -3304,7 +3316,7 @@ index adf73e544..f8b57bc0c 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/event.c b/extern/libopenjpeg/event.c
-index 38db33a94..b6034b42d 100644
+index 38db33a..b6034b4 100644
 --- a/extern/libopenjpeg/event.c
 +++ b/extern/libopenjpeg/event.c
 @@ -1,5 +1,12 @@
@@ -3427,7 +3439,7 @@ index 38db33a94..b6034b42d 100644
 +}
 +
 diff --git a/extern/libopenjpeg/event.h b/extern/libopenjpeg/event.h
-index 9c59787ca..88e0395b4 100644
+index 9c59787..88e0395 100644
 --- a/extern/libopenjpeg/event.h
 +++ b/extern/libopenjpeg/event.h
 @@ -1,5 +1,12 @@
@@ -3510,9 +3522,79 @@ index 9c59787ca..88e0395b4 100644
  /*@}*/
  
  /*@}*/
+diff --git a/extern/libopenjpeg/fix.h b/extern/libopenjpeg/fix.h
+deleted file mode 100644
+index bcb2acb..0000000
+--- a/extern/libopenjpeg/fix.h
++++ /dev/null
+@@ -1,64 +0,0 @@
+-/*
+- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+- * Copyright (c) 2002-2007, Professor Benoit Macq
+- * Copyright (c) 2001-2003, David Janssens
+- * Copyright (c) 2002-2003, Yannick Verschueren
+- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+- * POSSIBILITY OF SUCH DAMAGE.
+- */
+-#ifndef __FIX_H
+-#define __FIX_H
+-
+-#if defined(_MSC_VER) || defined(__BORLANDC__)
+-#define int64 __int64
+-#else
+-#define int64 long long
+-#endif
+-
+-/**
+- at file fix.h
+- at brief Implementation of operations of specific multiplication (FIX)
+-
+-The functions in FIX.H have for goal to realize specific multiplication.
+-*/
+-
+-/** @defgroup FIX FIX - Implementation of operations of specific multiplication */
+-/*@{*/
+-
+-/**
+-Multiply two fixed-precision rational numbers.
+- at param a
+- at param b
+- at return Returns a * b
+-*/
+-static INLINE int fix_mul(int a, int b) {
+-    int64 temp = (int64) a * (int64) b ;
+-    temp += temp & 4096;
+-    return (int) (temp >> 13) ;
+-}
+-
+-/*@}*/
+-
+-#endif /* __FIX_H */
 diff --git a/extern/libopenjpeg/function_list.c b/extern/libopenjpeg/function_list.c
 new file mode 100644
-index 000000000..4c8aae621
+index 0000000..4c8aae6
 --- /dev/null
 +++ b/extern/libopenjpeg/function_list.c
 @@ -0,0 +1,119 @@
@@ -3637,7 +3719,7 @@ index 000000000..4c8aae621
 +}
 diff --git a/extern/libopenjpeg/function_list.h b/extern/libopenjpeg/function_list.h
 new file mode 100644
-index 000000000..749ad9e45
+index 0000000..749ad9e
 --- /dev/null
 +++ b/extern/libopenjpeg/function_list.h
 @@ -0,0 +1,131 @@
@@ -3773,7 +3855,7 @@ index 000000000..749ad9e45
 +#endif /* __FUNCTION_LIST_H */
 +
 diff --git a/extern/libopenjpeg/image.c b/extern/libopenjpeg/image.c
-index 579fd73d7..2c3540c51 100644
+index 579fd73..2c3540c 100644
 --- a/extern/libopenjpeg/image.c
 +++ b/extern/libopenjpeg/image.c
 @@ -1,4 +1,9 @@
@@ -3976,7 +4058,7 @@ index 579fd73d7..2c3540c51 100644
 +	return image;
 +}
 diff --git a/extern/libopenjpeg/image.h b/extern/libopenjpeg/image.h
-index f828b5b77..e0e2772d4 100644
+index f828b5b..e0e2772 100644
 --- a/extern/libopenjpeg/image.h
 +++ b/extern/libopenjpeg/image.h
 @@ -1,4 +1,9 @@
@@ -4026,7 +4108,7 @@ index f828b5b77..e0e2772d4 100644
  
  #endif /* __IMAGE_H */
 diff --git a/extern/libopenjpeg/indexbox_manager.h b/extern/libopenjpeg/indexbox_manager.h
-index 7364df62c..ec5525f53 100644
+index 7364df6..ec5525f 100644
 --- a/extern/libopenjpeg/indexbox_manager.h
 +++ b/extern/libopenjpeg/indexbox_manager.h
 @@ -1,8 +1,8 @@
@@ -4115,9 +4197,134 @@ index 7364df62c..ec5525f53 100644
 +              opj_event_mgr_t * p_manager );
  
  #endif      /* !INDEXBOX_MANAGER_H_ */
+diff --git a/extern/libopenjpeg/int.h b/extern/libopenjpeg/int.h
+deleted file mode 100644
+index 4e5fe08..0000000
+--- a/extern/libopenjpeg/int.h
++++ /dev/null
+@@ -1,119 +0,0 @@
+-/*
+- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+- * Copyright (c) 2002-2007, Professor Benoit Macq
+- * Copyright (c) 2001-2003, David Janssens
+- * Copyright (c) 2002-2003, Yannick Verschueren
+- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+- * POSSIBILITY OF SUCH DAMAGE.
+- */
+-#ifndef __INT_H
+-#define __INT_H
+-/**
+- at file int.h
+- at brief Implementation of operations on integers (INT)
+-
+-The functions in INT.H have for goal to realize operations on integers.
+-*/
+-
+-/** @defgroup INT INT - Implementation of operations on integers */
+-/*@{*/
+-
+-/** @name Exported functions (see also openjpeg.h) */
+-/*@{*/
+-/* ----------------------------------------------------------------------- */
+-/**
+-Get the minimum of two integers
+- at return Returns a if a < b else b
+-*/
+-static INLINE int int_min(int a, int b) {
+-	return a < b ? a : b;
+-}
+-/**
+-Get the maximum of two integers
+- at return Returns a if a > b else b
+-*/
+-static INLINE int int_max(int a, int b) {
+-	return (a > b) ? a : b;
+-}
+-/**
+-Clamp an integer inside an interval
+- at return
+-<ul>
+-<li>Returns a if (min < a < max)
+-<li>Returns max if (a > max)
+-<li>Returns min if (a < min) 
+-</ul>
+-*/
+-static INLINE int int_clamp(int a, int min, int max) {
+-	if (a < min)
+-		return min;
+-	if (a > max)
+-		return max;
+-	return a;
+-}
+-/**
+- at return Get absolute value of integer
+-*/
+-static INLINE int int_abs(int a) {
+-	return a < 0 ? -a : a;
+-}
+-/**
+-Divide an integer and round upwards
+- at return Returns a divided by b
+-*/
+-static INLINE int int_ceildiv(int a, int b) {
+-	return (a + b - 1) / b;
+-}
+-/**
+-Divide an integer by a power of 2 and round upwards
+- at return Returns a divided by 2^b
+-*/
+-static INLINE int int_ceildivpow2(int a, int b) {
+-	return (a + (1 << b) - 1) >> b;
+-}
+-/**
+-Divide an integer by a power of 2 and round downwards
+- at return Returns a divided by 2^b
+-*/
+-static INLINE int int_floordivpow2(int a, int b) {
+-	return a >> b;
+-}
+-/**
+-Get logarithm of an integer and round downwards
+- at return Returns log2(a)
+-*/
+-static INLINE int int_floorlog2(int a) {
+-	int l;
+-	for (l = 0; a > 1; l++) {
+-		a >>= 1;
+-	}
+-	return l;
+-}
+-/* ----------------------------------------------------------------------- */
+-/*@}*/
+-
+-/*@}*/
+-
+-#endif
 diff --git a/extern/libopenjpeg/invert.c b/extern/libopenjpeg/invert.c
 new file mode 100644
-index 000000000..4c1ee780d
+index 0000000..4c1ee78
 --- /dev/null
 +++ b/extern/libopenjpeg/invert.c
 @@ -0,0 +1,294 @@
@@ -4415,77 +4622,59 @@ index 000000000..4c1ee780d
 +    }
 +}
 +
-diff --git a/extern/libopenjpeg/jpt.h b/extern/libopenjpeg/invert.h
-similarity index 50%
-rename from extern/libopenjpeg/jpt.h
-rename to extern/libopenjpeg/invert.h
-index eb01f98eb..2fae8e54b 100644
---- a/extern/libopenjpeg/jpt.h
+diff --git a/extern/libopenjpeg/invert.h b/extern/libopenjpeg/invert.h
+new file mode 100644
+index 0000000..2fae8e5
+--- /dev/null
 +++ b/extern/libopenjpeg/invert.h
-@@ -1,8 +1,10 @@
- /*
-- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
-- * Copyright (c) 2002-2007, Professor Benoit Macq
-- * Copyright (c) 2002-2003, Yannick Verschueren
-- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+@@ -0,0 +1,64 @@
++/*
 + * The copyright in this software is being made available under the 2-clauses 
 + * BSD License, included below. This software may be subject to other third 
 + * party and contributor rights, including patent rights, and no such rights
 + * are granted under this license.
 + *
 + * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes at c-s.fr>
-  * All rights reserved.
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -27,49 +29,36 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
--#ifndef __JPT_H
--#define __JPT_H
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
 +#ifndef __INVERT_H
 +#define __INVERT_H
- /**
-- at file jpt.h
-- at brief JPT-stream reader (JPEG 2000, JPIP)
++/**
 + at file invert.h
 + at brief Implementation of the matrix inversion
- 
--JPT-stream functions are implemented in J2K.C. 
++
 +The function in INVERT.H compute a matrix inversion with a LUP method
- */
- 
--/**
--Message Header JPT stream structure
--*/
--typedef struct opj_jpt_msg_header {
--	/** In-class Identifier */
--	unsigned int Id;
--	/** Last byte information */
--	unsigned int last_byte;	
--	/** Class Identifier */
--	unsigned int Class_Id;	
--	/** CSn : index identifier */
--	unsigned int CSn_Id;
--	/** Message offset */
--	unsigned int Msg_offset;
--	/** Message length */
--	unsigned int Msg_length;
--	/** Auxiliary for JPP case */
--	unsigned int Layer_nb;
--} opj_jpt_msg_header_t;
--
++*/
++
 +/** @defgroup INVERT INVERT - Implementation of a matrix inversion */
 +/*@{*/
 +/** @name Exported functions */
 +/*@{*/
- /* ----------------------------------------------------------------------- */
- 
- /**
--Initialize the value of the message header structure 
-- at param header Message header structure
--*/
--void jpt_init_msg_header(opj_jpt_msg_header_t * header);
++/* ----------------------------------------------------------------------- */
++
++/**
 + * Calculates a n x n double matrix inversion with a LUP method. Data is aligned, rows after rows (or columns after columns).
 + * The function does not take ownership of any memory block, data must be fred by the user.
 + *
@@ -4499,20 +4688,12 @@ index eb01f98eb..2fae8e54b 100644
 +                                OPJ_UINT32 nb_compo);
 +/* ----------------------------------------------------------------------- */
 +/*@}*/
- 
--/**
--Read the message header for a JPP/JPT - stream
-- at param cinfo Codec context info
-- at param cio CIO handle
-- at param header Message header structure
--*/
--void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header);
++
 +/*@}*/
- 
--#endif
++
 +#endif /* __INVERT_H */ 
 diff --git a/extern/libopenjpeg/j2k.c b/extern/libopenjpeg/j2k.c
-index 93e5c9eb8..881cc72c7 100644
+index 93e5c9e..881cc72 100644
 --- a/extern/libopenjpeg/j2k.c
 +++ b/extern/libopenjpeg/j2k.c
 @@ -1,12 +1,21 @@
@@ -17261,7 +17442,7 @@ index 93e5c9eb8..881cc72c7 100644
 +        return OPJ_TRUE;
  }
 diff --git a/extern/libopenjpeg/j2k.h b/extern/libopenjpeg/j2k.h
-index 6338c290d..d0f59d727 100644
+index 6338c29..d0f59d7 100644
 --- a/extern/libopenjpeg/j2k.h
 +++ b/extern/libopenjpeg/j2k.h
 @@ -1,11 +1,21 @@
@@ -18226,8 +18407,133 @@ index 6338c290d..d0f59d727 100644
 +
  
  #endif /* __J2K_H */
+diff --git a/extern/libopenjpeg/j2k_lib.c b/extern/libopenjpeg/j2k_lib.c
+deleted file mode 100644
+index a66e31e..0000000
+--- a/extern/libopenjpeg/j2k_lib.c
++++ /dev/null
+@@ -1,59 +0,0 @@
+-/*
+- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+- * POSSIBILITY OF SUCH DAMAGE.
+- */
+-
+-#ifdef _WIN32
+-#include <windows.h>
+-#else
+-#include <sys/time.h>
+-#include <sys/resource.h>
+-#include <sys/times.h>
+-#endif /* _WIN32 */
+-#include "opj_includes.h"
+-
+-double opj_clock(void) {
+-#ifdef _WIN32
+-	/* _WIN32: use QueryPerformance (very accurate) */
+-    LARGE_INTEGER freq , t ;
+-    /* freq is the clock speed of the CPU */
+-    QueryPerformanceFrequency(&freq) ;
+-	/* cout << "freq = " << ((double) freq.QuadPart) << endl; */
+-    /* t is the high resolution performance counter (see MSDN) */
+-    QueryPerformanceCounter ( & t ) ;
+-    return ( t.QuadPart /(double) freq.QuadPart ) ;
+-#else
+-	/* Unix or Linux: use resource usage */
+-    struct rusage t;
+-    double procTime;
+-    /* (1) Get the rusage data structure at this moment (man getrusage) */
+-    getrusage(0,&t);
+-    /* (2) What is the elapsed time ? - CPU time = User time + System time */
+-	/* (2a) Get the seconds */
+-    procTime = t.ru_utime.tv_sec + t.ru_stime.tv_sec;
+-    /* (2b) More precisely! Get the microseconds part ! */
+-    return ( procTime + (t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ;
+-#endif
+-}
+-
+diff --git a/extern/libopenjpeg/j2k_lib.h b/extern/libopenjpeg/j2k_lib.h
+deleted file mode 100644
+index 5f3406e..0000000
+--- a/extern/libopenjpeg/j2k_lib.h
++++ /dev/null
+@@ -1,54 +0,0 @@
+-/*
+- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+- * POSSIBILITY OF SUCH DAMAGE.
+- */
+-#ifndef __J2K_LIB_H
+-#define __J2K_LIB_H
+-/**
+- at file j2k_lib.h
+- at brief Internal functions
+-
+-The functions in J2K_LIB.C are internal utilities mainly used for timing.
+-*/
+-
+-/** @defgroup MISC MISC - Miscellaneous internal functions */
+-/*@{*/
+-
+-/** @name Exported functions */
+-/*@{*/
+-/* ----------------------------------------------------------------------- */
+-
+-/**
+-Difference in successive opj_clock() calls tells you the elapsed time
+- at return Returns time in seconds
+-*/
+-double opj_clock(void);
+-
+-/* ----------------------------------------------------------------------- */
+-/*@}*/
+-
+-/*@}*/
+-
+-#endif /* __J2K_LIB_H */
+-
 diff --git a/extern/libopenjpeg/jp2.c b/extern/libopenjpeg/jp2.c
-index d3322603c..5c88c4d74 100644
+index d332260..5c88c4d 100644
 --- a/extern/libopenjpeg/jp2.c
 +++ b/extern/libopenjpeg/jp2.c
 @@ -1,11 +1,19 @@
@@ -21917,7 +22223,7 @@ index d3322603c..5c88c4d74 100644
 +#endif
 +#endif /* USE_JPIP */
 diff --git a/extern/libopenjpeg/jp2.h b/extern/libopenjpeg/jp2.h
-index acb643cad..c11d2f313 100644
+index acb643c..c11d2f3 100644
 --- a/extern/libopenjpeg/jp2.h
 +++ b/extern/libopenjpeg/jp2.h
 @@ -1,8 +1,15 @@
@@ -22499,7 +22805,7 @@ index acb643cad..c11d2f313 100644
  /*@}*/
 diff --git a/extern/libopenjpeg/jpt.c b/extern/libopenjpeg/jpt.c
 deleted file mode 100644
-index a2566ea88..000000000
+index a2566ea..0000000
 --- a/extern/libopenjpeg/jpt.c
 +++ /dev/null
 @@ -1,155 +0,0 @@
@@ -22658,8 +22964,126 @@ index a2566ea88..000000000
 -		header->Layer_nb = jpt_read_VBAS_info(cio, header->Layer_nb);
 -	}
 -}
+diff --git a/extern/libopenjpeg/jpt.h b/extern/libopenjpeg/jpt.h
+deleted file mode 100644
+index eb01f98..0000000
+--- a/extern/libopenjpeg/jpt.h
++++ /dev/null
+@@ -1,75 +0,0 @@
+-/*
+- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+- * Copyright (c) 2002-2007, Professor Benoit Macq
+- * Copyright (c) 2002-2003, Yannick Verschueren
+- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+- * POSSIBILITY OF SUCH DAMAGE.
+- */
+-
+-#ifndef __JPT_H
+-#define __JPT_H
+-/**
+- at file jpt.h
+- at brief JPT-stream reader (JPEG 2000, JPIP)
+-
+-JPT-stream functions are implemented in J2K.C. 
+-*/
+-
+-/**
+-Message Header JPT stream structure
+-*/
+-typedef struct opj_jpt_msg_header {
+-	/** In-class Identifier */
+-	unsigned int Id;
+-	/** Last byte information */
+-	unsigned int last_byte;	
+-	/** Class Identifier */
+-	unsigned int Class_Id;	
+-	/** CSn : index identifier */
+-	unsigned int CSn_Id;
+-	/** Message offset */
+-	unsigned int Msg_offset;
+-	/** Message length */
+-	unsigned int Msg_length;
+-	/** Auxiliary for JPP case */
+-	unsigned int Layer_nb;
+-} opj_jpt_msg_header_t;
+-
+-/* ----------------------------------------------------------------------- */
+-
+-/**
+-Initialize the value of the message header structure 
+- at param header Message header structure
+-*/
+-void jpt_init_msg_header(opj_jpt_msg_header_t * header);
+-
+-/**
+-Read the message header for a JPP/JPT - stream
+- at param cinfo Codec context info
+- at param cio CIO handle
+- at param header Message header structure
+-*/
+-void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header);
+-
+-#endif
+diff --git a/extern/libopenjpeg/license.txt b/extern/libopenjpeg/license.txt
+deleted file mode 100644
+index d1e5b6a..0000000
+--- a/extern/libopenjpeg/license.txt
++++ /dev/null
+@@ -1,30 +0,0 @@
+-/*
+- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+- * Copyright (c) 2002-2007, Professor Benoit Macq
+- * Copyright (c) 2001-2003, David Janssens
+- * Copyright (c) 2002-2003, Yannick Verschueren
+- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+- * POSSIBILITY OF SUCH DAMAGE.
+- */
+\ No newline at end of file
 diff --git a/extern/libopenjpeg/mct.c b/extern/libopenjpeg/mct.c
-index 870993b06..60ee0969d 100644
+index 870993b..60ee096 100644
 --- a/extern/libopenjpeg/mct.c
 +++ b/extern/libopenjpeg/mct.c
 @@ -1,10 +1,18 @@
@@ -22980,7 +23404,7 @@ index 870993b06..60ee0969d 100644
 +	}
  }
 diff --git a/extern/libopenjpeg/mct.h b/extern/libopenjpeg/mct.h
-index 84e3f8add..1c1f4d0c4 100644
+index 84e3f8a..1c1f4d0 100644
 --- a/extern/libopenjpeg/mct.h
 +++ b/extern/libopenjpeg/mct.h
 @@ -1,10 +1,18 @@
@@ -23105,7 +23529,7 @@ index 84e3f8add..1c1f4d0c4 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/mqc.c b/extern/libopenjpeg/mqc.c
-index 14129fbf4..18fcc4760 100644
+index 14129fb..18fcc47 100644
 --- a/extern/libopenjpeg/mqc.c
 +++ b/extern/libopenjpeg/mqc.c
 @@ -1,10 +1,17 @@
@@ -23638,7 +24062,7 @@ index 14129fbf4..18fcc4760 100644
  
  
 diff --git a/extern/libopenjpeg/mqc.h b/extern/libopenjpeg/mqc.h
-index d00cd1067..69a2d4602 100644
+index d00cd10..69a2d46 100644
 --- a/extern/libopenjpeg/mqc.h
 +++ b/extern/libopenjpeg/mqc.h
 @@ -1,10 +1,17 @@
@@ -23830,7 +24254,7 @@ index d00cd1067..69a2d4602 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/openjpeg.c b/extern/libopenjpeg/openjpeg.c
-index 180cc844a..4665d906e 100644
+index 180cc84..4665d90 100644
 --- a/extern/libopenjpeg/openjpeg.c
 +++ b/extern/libopenjpeg/openjpeg.c
 @@ -1,5 +1,12 @@
@@ -24884,7 +25308,7 @@ index 180cc844a..4665d906e 100644
 +    return l_stream;
 +}
 diff --git a/extern/libopenjpeg/openjpeg.h b/extern/libopenjpeg/openjpeg.h
-index 59147c8b3..988db7200 100644
+index 59147c8..988db72 100644
 --- a/extern/libopenjpeg/openjpeg.h
 +++ b/extern/libopenjpeg/openjpeg.h
 @@ -1,12 +1,21 @@
@@ -26551,109 +26975,144 @@ index 59147c8b3..988db7200 100644
  
  
  #ifdef __cplusplus
-diff --git a/extern/libopenjpeg/j2k_lib.c b/extern/libopenjpeg/opj_clock.c
-similarity index 80%
-rename from extern/libopenjpeg/j2k_lib.c
-rename to extern/libopenjpeg/opj_clock.c
-index a66e31e9a..0df99ef04 100644
---- a/extern/libopenjpeg/j2k_lib.c
+diff --git a/extern/libopenjpeg/opj_clock.c b/extern/libopenjpeg/opj_clock.c
+new file mode 100644
+index 0000000..0df99ef
+--- /dev/null
 +++ b/extern/libopenjpeg/opj_clock.c
-@@ -1,4 +1,9 @@
- /*
+@@ -0,0 +1,64 @@
++/*
 + * The copyright in this software is being made available under the 2-clauses 
 + * BSD License, included below. This software may be subject to other third 
 + * party and contributor rights, including patent rights, and no such rights
 + * are granted under this license.
 + *
-  * Copyright (c) 2005, Herve Drolon, FreeImage Team
-  * All rights reserved.
-  *
-@@ -33,7 +38,7 @@
- #endif /* _WIN32 */
- #include "opj_includes.h"
- 
--double opj_clock(void) {
++ * Copyright (c) 2005, Herve Drolon, FreeImage Team
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifdef _WIN32
++#include <windows.h>
++#else
++#include <sys/time.h>
++#include <sys/resource.h>
++#include <sys/times.h>
++#endif /* _WIN32 */
++#include "opj_includes.h"
++
 +OPJ_FLOAT64 opj_clock(void) {
- #ifdef _WIN32
- 	/* _WIN32: use QueryPerformance (very accurate) */
-     LARGE_INTEGER freq , t ;
-@@ -42,18 +47,18 @@ double opj_clock(void) {
- 	/* cout << "freq = " << ((double) freq.QuadPart) << endl; */
-     /* t is the high resolution performance counter (see MSDN) */
-     QueryPerformanceCounter ( & t ) ;
--    return ( t.QuadPart /(double) freq.QuadPart ) ;
++#ifdef _WIN32
++	/* _WIN32: use QueryPerformance (very accurate) */
++    LARGE_INTEGER freq , t ;
++    /* freq is the clock speed of the CPU */
++    QueryPerformanceFrequency(&freq) ;
++	/* cout << "freq = " << ((double) freq.QuadPart) << endl; */
++    /* t is the high resolution performance counter (see MSDN) */
++    QueryPerformanceCounter ( & t ) ;
 +    return ( t.QuadPart /(OPJ_FLOAT64) freq.QuadPart ) ;
- #else
- 	/* Unix or Linux: use resource usage */
-     struct rusage t;
--    double procTime;
++#else
++	/* Unix or Linux: use resource usage */
++    struct rusage t;
 +    OPJ_FLOAT64 procTime;
-     /* (1) Get the rusage data structure at this moment (man getrusage) */
-     getrusage(0,&t);
-     /* (2) What is the elapsed time ? - CPU time = User time + System time */
- 	/* (2a) Get the seconds */
--    procTime = t.ru_utime.tv_sec + t.ru_stime.tv_sec;
++    /* (1) Get the rusage data structure at this moment (man getrusage) */
++    getrusage(0,&t);
++    /* (2) What is the elapsed time ? - CPU time = User time + System time */
++	/* (2a) Get the seconds */
 +    procTime = (OPJ_FLOAT64)(t.ru_utime.tv_sec + t.ru_stime.tv_sec);
-     /* (2b) More precisely! Get the microseconds part ! */
--    return ( procTime + (t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ;
++    /* (2b) More precisely! Get the microseconds part ! */
 +    return ( procTime + (OPJ_FLOAT64)(t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ;
- #endif
- }
- 
-diff --git a/extern/libopenjpeg/j2k_lib.h b/extern/libopenjpeg/opj_clock.h
-similarity index 78%
-rename from extern/libopenjpeg/j2k_lib.h
-rename to extern/libopenjpeg/opj_clock.h
-index 5f3406e51..6f5168b57 100644
---- a/extern/libopenjpeg/j2k_lib.h
++#endif
++}
++
+diff --git a/extern/libopenjpeg/opj_clock.h b/extern/libopenjpeg/opj_clock.h
+new file mode 100644
+index 0000000..6f5168b
+--- /dev/null
 +++ b/extern/libopenjpeg/opj_clock.h
-@@ -1,4 +1,9 @@
- /*
+@@ -0,0 +1,59 @@
++/*
 + * The copyright in this software is being made available under the 2-clauses 
 + * BSD License, included below. This software may be subject to other third 
 + * party and contributor rights, including patent rights, and no such rights
 + * are granted under this license.
 + *
-  * Copyright (c) 2005, Herve Drolon, FreeImage Team
-  * All rights reserved.
-  *
-@@ -23,13 +28,13 @@
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
--#ifndef __J2K_LIB_H
--#define __J2K_LIB_H
++ * Copyright (c) 2005, Herve Drolon, FreeImage Team
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
 +#ifndef __OPJ_CLOCK_H
 +#define __OPJ_CLOCK_H
- /**
-- at file j2k_lib.h
-- at brief Internal functions
++/**
 + at file opj_clock.h
 + at brief Internal function for timing
- 
--The functions in J2K_LIB.C are internal utilities mainly used for timing.
++
 +The functions in OPJ_CLOCK.C are internal utilities mainly used for timing.
- */
- 
- /** @defgroup MISC MISC - Miscellaneous internal functions */
-@@ -43,12 +48,12 @@ The functions in J2K_LIB.C are internal utilities mainly used for timing.
- Difference in successive opj_clock() calls tells you the elapsed time
- @return Returns time in seconds
- */
--double opj_clock(void);
++*/
++
++/** @defgroup MISC MISC - Miscellaneous internal functions */
++/*@{*/
++
++/** @name Exported functions */
++/*@{*/
++/* ----------------------------------------------------------------------- */
++
++/**
++Difference in successive opj_clock() calls tells you the elapsed time
++ at return Returns time in seconds
++*/
 +OPJ_FLOAT64 opj_clock(void);
- 
- /* ----------------------------------------------------------------------- */
- /*@}*/
- 
- /*@}*/
- 
--#endif /* __J2K_LIB_H */
++
++/* ----------------------------------------------------------------------- */
++/*@}*/
++
++/*@}*/
++
 +#endif /* __OPJ_CLOCK_H */
- 
++
 diff --git a/extern/libopenjpeg/opj_codec.h b/extern/libopenjpeg/opj_codec.h
 new file mode 100644
-index 000000000..4fdfa7d8b
+index 0000000..4fdfa7d
 --- /dev/null
 +++ b/extern/libopenjpeg/opj_codec.h
 @@ -0,0 +1,165 @@
@@ -26823,7 +27282,7 @@ index 000000000..4fdfa7d8b
 +#endif /* __OPJ_CODEC_H */
 +
 diff --git a/extern/libopenjpeg/opj_config.h b/extern/libopenjpeg/opj_config.h
-index 5d0a877b8..815ed3d1d 100644
+index 5d0a877..815ed3d 100644
 --- a/extern/libopenjpeg/opj_config.h
 +++ b/extern/libopenjpeg/opj_config.h
 @@ -1,39 +1,5 @@
@@ -26872,7 +27331,7 @@ index 5d0a877b8..815ed3d1d 100644
 +#define OPJ_VERSION_BUILD 0
 diff --git a/extern/libopenjpeg/opj_config_private.h b/extern/libopenjpeg/opj_config_private.h
 new file mode 100644
-index 000000000..61f82ec48
+index 0000000..61f82ec
 --- /dev/null
 +++ b/extern/libopenjpeg/opj_config_private.h
 @@ -0,0 +1,6 @@
@@ -26883,7 +27342,7 @@ index 000000000..61f82ec48
 +
 +// #define OPJ_HAVE_FSEEKO ON
 diff --git a/extern/libopenjpeg/opj_includes.h b/extern/libopenjpeg/opj_includes.h
-index e9194fd98..d9238b1bf 100644
+index e9194fd..d9238b1 100644
 --- a/extern/libopenjpeg/opj_includes.h
 +++ b/extern/libopenjpeg/opj_includes.h
 @@ -1,5 +1,12 @@
@@ -26899,19 +27358,19 @@ index e9194fd98..d9238b1bf 100644
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
-@@ -27,6 +34,12 @@
+@@ -26,6 +33,12 @@
+ #ifndef OPJ_INCLUDES_H
  #define OPJ_INCLUDES_H
  
- /*
++/*
 + * This must be included before any system headers,
 + * since they can react to macro defined there
 + */
 +#include "opj_config_private.h"
 +
-+/*
+ /*
   ==========================================================
     Standard includes used by the library
-  ==========================================================
 @@ -40,6 +53,41 @@
  #include <stdio.h>
  #include <stdarg.h>
@@ -27054,17 +27513,13 @@ index e9194fd98..d9238b1bf 100644
 +
 +
  #endif /* OPJ_INCLUDES_H */
-diff --git a/extern/libopenjpeg/int.h b/extern/libopenjpeg/opj_intmath.h
-similarity index 54%
-rename from extern/libopenjpeg/int.h
-rename to extern/libopenjpeg/opj_intmath.h
-index 4e5fe08eb..dc8989530 100644
---- a/extern/libopenjpeg/int.h
+diff --git a/extern/libopenjpeg/opj_intmath.h b/extern/libopenjpeg/opj_intmath.h
+new file mode 100644
+index 0000000..dc89895
+--- /dev/null
 +++ b/extern/libopenjpeg/opj_intmath.h
-@@ -1,9 +1,15 @@
- /*
-- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
-- * Copyright (c) 2002-2007, Professor Benoit Macq
+@@ -0,0 +1,178 @@
++/*
 + * The copyright in this software is being made available under the 2-clauses 
 + * BSD License, included below. This software may be subject to other third 
 + * party and contributor rights, including patent rights, and no such rights
@@ -27072,36 +27527,53 @@ index 4e5fe08eb..dc8989530 100644
 + *
 + * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
 + * Copyright (c) 2002-2014, Professor Benoit Macq
-  * Copyright (c) 2001-2003, David Janssens
-  * Copyright (c) 2002-2003, Yannick Verschueren
-- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
++ * Copyright (c) 2001-2003, David Janssens
++ * Copyright (c) 2002-2003, Yannick Verschueren
 + * Copyright (c) 2003-2007, Francois-Olivier Devaux 
 + * Copyright (c) 2003-2014, Antonin Descampe
-  * Copyright (c) 2005, Herve Drolon, FreeImage Team
-  * All rights reserved.
-  *
-@@ -31,13 +37,13 @@
- #ifndef __INT_H
- #define __INT_H
- /**
-- at file int.h
++ * Copyright (c) 2005, Herve Drolon, FreeImage Team
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++#ifndef __INT_H
++#define __INT_H
++/**
 + at file opj_intmath.h
- @brief Implementation of operations on integers (INT)
- 
--The functions in INT.H have for goal to realize operations on integers.
++ at brief Implementation of operations on integers (INT)
++
 +The functions in OPJ_INTMATH.H have for goal to realize operations on integers.
- */
- 
--/** @defgroup INT INT - Implementation of operations on integers */
++*/
++
 +/** @defgroup OPJ_INTMATH OPJ_INTMATH - Implementation of operations on integers */
- /*@{*/
- 
- /** @name Exported functions (see also openjpeg.h) */
-@@ -47,16 +53,34 @@ The functions in INT.H have for goal to realize operations on integers.
- Get the minimum of two integers
- @return Returns a if a < b else b
- */
--static INLINE int int_min(int a, int b) {
++/*@{*/
++
++/** @name Exported functions (see also openjpeg.h) */
++/*@{*/
++/* ----------------------------------------------------------------------- */
++/**
++Get the minimum of two integers
++ at return Returns a if a < b else b
++*/
 +static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b) {
 +	return a < b ? a : b;
 +}
@@ -27111,17 +27583,16 @@ index 4e5fe08eb..dc8989530 100644
 + at return Returns a if a < b else b
 +*/
 +static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {
- 	return a < b ? a : b;
- }
++	return a < b ? a : b;
++}
 +
- /**
- Get the maximum of two integers
- @return Returns a if a > b else b
- */
--static INLINE int int_max(int a, int b) {
++/**
++Get the maximum of two integers
++ at return Returns a if a > b else b
++*/
 +static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b) {
- 	return (a > b) ? a : b;
- }
++	return (a > b) ? a : b;
++}
 +
 +/**
 +Get the maximum of two integers
@@ -27131,31 +27602,32 @@ index 4e5fe08eb..dc8989530 100644
 +	return (a > b) ? a : b;
 +}
 +
- /**
- Clamp an integer inside an interval
- @return
-@@ -66,7 +90,7 @@ Clamp an integer inside an interval
- <li>Returns min if (a < min) 
- </ul>
- */
--static INLINE int int_clamp(int a, int min, int max) {
++/**
++Clamp an integer inside an interval
++ at return
++<ul>
++<li>Returns a if (min < a < max)
++<li>Returns max if (a > max)
++<li>Returns min if (a < min) 
++</ul>
++*/
 +static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min, OPJ_INT32 max) {
- 	if (a < min)
- 		return min;
- 	if (a > max)
-@@ -76,41 +100,76 @@ static INLINE int int_clamp(int a, int min, int max) {
- /**
- @return Get absolute value of integer
- */
--static INLINE int int_abs(int a) {
++	if (a < min)
++		return min;
++	if (a > max)
++		return max;
++	return a;
++}
++/**
++ at return Get absolute value of integer
++*/
 +static INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a) {
- 	return a < 0 ? -a : a;
- }
- /**
- Divide an integer and round upwards
- @return Returns a divided by b
- */
--static INLINE int int_ceildiv(int a, int b) {
++	return a < 0 ? -a : a;
++}
++/**
++Divide an integer and round upwards
++ at return Returns a divided by b
++*/
 +static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b) {
 +  assert(b);
 +	return (a + b - 1) / b;
@@ -27166,39 +27638,34 @@ index 4e5fe08eb..dc8989530 100644
 + at return Returns a divided by b
 +*/
 +static INLINE OPJ_UINT32  opj_uint_ceildiv(OPJ_UINT32  a, OPJ_UINT32  b) {
- 	return (a + b - 1) / b;
- }
++	return (a + b - 1) / b;
++}
 +
- /**
- Divide an integer by a power of 2 and round upwards
- @return Returns a divided by 2^b
- */
--static INLINE int int_ceildivpow2(int a, int b) {
--	return (a + (1 << b) - 1) >> b;
++/**
++Divide an integer by a power of 2 and round upwards
++ at return Returns a divided by 2^b
++*/
 +static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b) {
 +	return (OPJ_INT32)((a + (OPJ_INT64)(1 << b) - 1) >> b);
- }
- /**
- Divide an integer by a power of 2 and round downwards
- @return Returns a divided by 2^b
- */
--static INLINE int int_floordivpow2(int a, int b) {
++}
++/**
++Divide an integer by a power of 2 and round downwards
++ at return Returns a divided by 2^b
++*/
 +static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b) {
- 	return a >> b;
- }
- /**
- Get logarithm of an integer and round downwards
- @return Returns log2(a)
- */
--static INLINE int int_floorlog2(int a) {
--	int l;
++	return a >> b;
++}
++/**
++Get logarithm of an integer and round downwards
++ at return Returns log2(a)
++*/
 +static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a) {
 +	OPJ_INT32 l;
- 	for (l = 0; a > 1; l++) {
- 		a >>= 1;
- 	}
- 	return l;
- }
++	for (l = 0; a > 1; l++) {
++		a >>= 1;
++	}
++	return l;
++}
 +/**
 +Get logarithm of an integer and round downwards
 + at return Returns log2(a)
@@ -27224,39 +27691,47 @@ index 4e5fe08eb..dc8989530 100644
 +    return (OPJ_INT32) (temp >> 13) ;
 +}
 +
- /* ----------------------------------------------------------------------- */
- /*@}*/
- 
-diff --git a/extern/libopenjpeg/license.txt b/extern/libopenjpeg/opj_inttypes.h
-similarity index 66%
-rename from extern/libopenjpeg/license.txt
-rename to extern/libopenjpeg/opj_inttypes.h
-index d1e5b6a53..e74aed6a1 100644
---- a/extern/libopenjpeg/license.txt
++/* ----------------------------------------------------------------------- */
++/*@}*/
++
++/*@}*/
++
++#endif
+diff --git a/extern/libopenjpeg/opj_inttypes.h b/extern/libopenjpeg/opj_inttypes.h
+new file mode 100644
+index 0000000..e74aed6
+--- /dev/null
 +++ b/extern/libopenjpeg/opj_inttypes.h
-@@ -1,10 +1,10 @@
- /*
-- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
-- * Copyright (c) 2002-2007, Professor Benoit Macq
-- * Copyright (c) 2001-2003, David Janssens
-- * Copyright (c) 2002-2003, Yannick Verschueren
-- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
-- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+@@ -0,0 +1,48 @@
++/*
 + * The copyright in this software is being made available under the 2-clauses 
 + * BSD License, included below. This software may be subject to other third 
 + * party and contributor rights, including patent rights, and no such rights
 + * are granted under this license.
 + *
 + * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre at gmail.com>
-  * All rights reserved.
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -27,4 +27,22 @@
-  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-- */
-\ No newline at end of file
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
 + */
 +#ifndef OPJ_INTTYPES_H
 +#define OPJ_INTTYPES_H
@@ -27277,7 +27752,7 @@ index d1e5b6a53..e74aed6a1 100644
 +
 +#endif /* OPJ_INTTYPES_H */
 diff --git a/extern/libopenjpeg/opj_malloc.h b/extern/libopenjpeg/opj_malloc.h
-index aef2ee3b8..5007b0c9e 100644
+index aef2ee3..5007b0c 100644
 --- a/extern/libopenjpeg/opj_malloc.h
 +++ b/extern/libopenjpeg/opj_malloc.h
 @@ -1,4 +1,9 @@
@@ -27332,41 +27807,45 @@ index aef2ee3b8..5007b0c9e 100644
  
  /**
  Deallocates or frees a memory block.
-diff --git a/extern/libopenjpeg/fix.h b/extern/libopenjpeg/opj_stdint.h
-similarity index 56%
-rename from extern/libopenjpeg/fix.h
-rename to extern/libopenjpeg/opj_stdint.h
-index bcb2acb54..b8556a193 100644
---- a/extern/libopenjpeg/fix.h
+diff --git a/extern/libopenjpeg/opj_stdint.h b/extern/libopenjpeg/opj_stdint.h
+new file mode 100644
+index 0000000..b8556a1
+--- /dev/null
 +++ b/extern/libopenjpeg/opj_stdint.h
-@@ -1,10 +1,10 @@
- /*
-- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
-- * Copyright (c) 2002-2007, Professor Benoit Macq
-- * Copyright (c) 2001-2003, David Janssens
-- * Copyright (c) 2002-2003, Yannick Verschueren
-- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
-- * Copyright (c) 2005, Herve Drolon, FreeImage Team
+@@ -0,0 +1,52 @@
++/*
 + * The copyright in this software is being made available under the 2-clauses 
 + * BSD License, included below. This software may be subject to other third 
 + * party and contributor rights, including patent rights, and no such rights
 + * are granted under this license.
 + *
 + * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre at gmail.com>
-  * All rights reserved.
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -28,37 +28,25 @@
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
--#ifndef __FIX_H
--#define __FIX_H
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
 +#ifndef OPJ_STDINT_H
 +#define OPJ_STDINT_H
- 
--#if defined(_MSC_VER) || defined(__BORLANDC__)
--#define int64 __int64
++
 +#include "opj_config.h"
 +#ifdef OPJ_HAVE_STDINT_H
 +#include <stdint.h>
@@ -27380,40 +27859,14 @@ index bcb2acb54..b8556a193 100644
 +typedef unsigned __int32  uint32_t;
 +typedef   signed __int64  int64_t;
 +typedef unsigned __int64  uint64_t;
- #else
--#define int64 long long
++#else
 +#error unsupported platform
 +#endif
- #endif
- 
--/**
-- at file fix.h
-- at brief Implementation of operations of specific multiplication (FIX)
--
--The functions in FIX.H have for goal to realize specific multiplication.
--*/
--
--/** @defgroup FIX FIX - Implementation of operations of specific multiplication */
--/*@{*/
--
--/**
--Multiply two fixed-precision rational numbers.
-- at param a
-- at param b
-- at return Returns a * b
--*/
--static INLINE int fix_mul(int a, int b) {
--    int64 temp = (int64) a * (int64) b ;
--    temp += temp & 4096;
--    return (int) (temp >> 13) ;
--}
--
--/*@}*/
--
--#endif /* __FIX_H */
++#endif
++
 +#endif /* OPJ_STDINT_H */
 diff --git a/extern/libopenjpeg/phix_manager.c b/extern/libopenjpeg/phix_manager.c
-index 60a028117..5a3e88387 100644
+index 60a0281..5a3e883 100644
 --- a/extern/libopenjpeg/phix_manager.c
 +++ b/extern/libopenjpeg/phix_manager.c
 @@ -1,8 +1,8 @@
@@ -27620,7 +28073,7 @@ index 60a028117..5a3e88387 100644
 +  return (int)len;
  }
 diff --git a/extern/libopenjpeg/pi.c b/extern/libopenjpeg/pi.c
-index e8e33bfe6..1d8db41b0 100644
+index e8e33bf..1d8db41 100644
 --- a/extern/libopenjpeg/pi.c
 +++ b/extern/libopenjpeg/pi.c
 @@ -1,9 +1,15 @@
@@ -29951,7 +30404,7 @@ index e8e33bfe6..1d8db41b0 100644
 +	return OPJ_FALSE;
 +}
 diff --git a/extern/libopenjpeg/pi.h b/extern/libopenjpeg/pi.h
-index cf9135fd1..f239679f5 100644
+index cf9135f..f239679 100644
 --- a/extern/libopenjpeg/pi.h
 +++ b/extern/libopenjpeg/pi.h
 @@ -1,9 +1,15 @@
@@ -30175,7 +30628,7 @@ index cf9135fd1..f239679f5 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/ppix_manager.c b/extern/libopenjpeg/ppix_manager.c
-index 58d324ceb..fce514899 100644
+index 58d324c..fce5148 100644
 --- a/extern/libopenjpeg/ppix_manager.c
 +++ b/extern/libopenjpeg/ppix_manager.c
 @@ -1,8 +1,8 @@
@@ -30380,7 +30833,7 @@ index 58d324ceb..fce514899 100644
 +  return (int)len;
  }
 diff --git a/extern/libopenjpeg/raw.c b/extern/libopenjpeg/raw.c
-index 3d231bfdc..2498761c4 100644
+index 3d231bf..2498761 100644
 --- a/extern/libopenjpeg/raw.c
 +++ b/extern/libopenjpeg/raw.c
 @@ -1,7 +1,13 @@
@@ -30442,7 +30895,7 @@ index 3d231bfdc..2498761c4 100644
  		raw->ct = 8;
  		if (raw->len == raw->lenmax) {
 diff --git a/extern/libopenjpeg/raw.h b/extern/libopenjpeg/raw.h
-index 3c4b372f3..572c66617 100644
+index 3c4b372..572c666 100644
 --- a/extern/libopenjpeg/raw.h
 +++ b/extern/libopenjpeg/raw.h
 @@ -1,7 +1,13 @@
@@ -30527,7 +30980,7 @@ index 3c4b372f3..572c66617 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/t1.c b/extern/libopenjpeg/t1.c
-index ed9cdc3fe..0d6c2f606 100644
+index ed9cdc3..0d6c2f6 100644
 --- a/extern/libopenjpeg/t1.c
 +++ b/extern/libopenjpeg/t1.c
 @@ -1,9 +1,15 @@
@@ -33199,7 +33652,7 @@ index ed9cdc3fe..0d6c2f606 100644
 +}				/* VSC and  BYPASS by Antonin */
 +#endif
 diff --git a/extern/libopenjpeg/t1.h b/extern/libopenjpeg/t1.h
-index 572ec88d2..e5be70ed5 100644
+index 572ec88..e5be70e 100644
 --- a/extern/libopenjpeg/t1.h
 +++ b/extern/libopenjpeg/t1.h
 @@ -1,9 +1,15 @@
@@ -33318,7 +33771,7 @@ index 572ec88d2..e5be70ed5 100644
  
 diff --git a/extern/libopenjpeg/t1_generate_luts.c b/extern/libopenjpeg/t1_generate_luts.c
 new file mode 100644
-index 000000000..1997d3997
+index 0000000..1997d39
 --- /dev/null
 +++ b/extern/libopenjpeg/t1_generate_luts.c
 @@ -0,0 +1,282 @@
@@ -33605,7 +34058,7 @@ index 000000000..1997d3997
 +	return 0;
 +}
 diff --git a/extern/libopenjpeg/t1_luts.h b/extern/libopenjpeg/t1_luts.h
-index e5e33f665..37776b65a 100644
+index e5e33f6..37776b6 100644
 --- a/extern/libopenjpeg/t1_luts.h
 +++ b/extern/libopenjpeg/t1_luts.h
 @@ -1,6 +1,6 @@
@@ -33671,7 +34124,7 @@ index e5e33f665..37776b65a 100644
    0x1880, 0x1780, 0x1700, 0x1600, 0x1500, 0x1480, 0x1380, 0x1300, 
    0x1200, 0x1180, 0x1080, 0x1000, 0x0f00, 0x0e80, 0x0e00, 0x0d00, 
 diff --git a/extern/libopenjpeg/t2.c b/extern/libopenjpeg/t2.c
-index 2585c3d56..37f981492 100644
+index 2585c3d..37f9814 100644
 --- a/extern/libopenjpeg/t2.c
 +++ b/extern/libopenjpeg/t2.c
 @@ -1,10 +1,18 @@
@@ -35728,7 +36181,7 @@ index 2585c3d56..37f981492 100644
 +        return OPJ_TRUE;
 +}
 diff --git a/extern/libopenjpeg/t2.h b/extern/libopenjpeg/t2.h
-index 2151ba67f..931141e05 100644
+index 2151ba6..931141e 100644
 --- a/extern/libopenjpeg/t2.h
 +++ b/extern/libopenjpeg/t2.h
 @@ -1,10 +1,18 @@
@@ -35854,7 +36307,7 @@ index 2151ba67f..931141e05 100644
  /* ----------------------------------------------------------------------- */
  /*@}*/
 diff --git a/extern/libopenjpeg/tcd.c b/extern/libopenjpeg/tcd.c
-index 62904eb2c..79262fcd3 100644
+index 62904eb..79262fc 100644
 --- a/extern/libopenjpeg/tcd.c
 +++ b/extern/libopenjpeg/tcd.c
 @@ -1,11 +1,19 @@
@@ -39491,7 +39944,7 @@ index 62904eb2c..79262fcd3 100644
 +        return OPJ_TRUE;
 +}
 diff --git a/extern/libopenjpeg/tcd.h b/extern/libopenjpeg/tcd.h
-index e3f93adc3..360923b15 100644
+index e3f93ad..360923b 100644
 --- a/extern/libopenjpeg/tcd.h
 +++ b/extern/libopenjpeg/tcd.h
 @@ -1,10 +1,18 @@
@@ -39965,7 +40418,7 @@ index e3f93adc3..360923b15 100644
  /* ----------------------------------------------------------------------- */
  /*@}*/
 diff --git a/extern/libopenjpeg/tgt.c b/extern/libopenjpeg/tgt.c
-index a5dbcd3ce..e77adb3bb 100644
+index a5dbcd3..e77adb3 100644
 --- a/extern/libopenjpeg/tgt.c
 +++ b/extern/libopenjpeg/tgt.c
 @@ -1,10 +1,18 @@
@@ -40448,7 +40901,7 @@ index a5dbcd3ce..e77adb3bb 100644
 +        return (node->value < threshold) ? 1 : 0;
  }
 diff --git a/extern/libopenjpeg/tgt.h b/extern/libopenjpeg/tgt.h
-index c08c8da0a..3d152f8a9 100644
+index c08c8da..3d152f8 100644
 --- a/extern/libopenjpeg/tgt.h
 +++ b/extern/libopenjpeg/tgt.h
 @@ -1,10 +1,19 @@
@@ -40577,7 +41030,7 @@ index c08c8da0a..3d152f8a9 100644
  /*@}*/
  
 diff --git a/extern/libopenjpeg/thix_manager.c b/extern/libopenjpeg/thix_manager.c
-index aa55f217c..0967b1e9a 100644
+index aa55f21..0967b1e 100644
 --- a/extern/libopenjpeg/thix_manager.c
 +++ b/extern/libopenjpeg/thix_manager.c
 @@ -1,8 +1,8 @@
@@ -40737,7 +41190,7 @@ index aa55f217c..0967b1e9a 100644
 +  return (int)len;
  }
 diff --git a/extern/libopenjpeg/tpix_manager.c b/extern/libopenjpeg/tpix_manager.c
-index 9ba9e7fda..74c02ba7c 100644
+index 9ba9e7f..74c02ba 100644
 --- a/extern/libopenjpeg/tpix_manager.c
 +++ b/extern/libopenjpeg/tpix_manager.c
 @@ -1,8 +1,8 @@
@@ -40955,7 +41408,7 @@ index 9ba9e7fda..74c02ba7c 100644
  
  int get_num_max_tile_parts( opj_codestream_info_t cstr_info)
 diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
-index 2bd7cbcf6..19d37871a 100644
+index 2bd7cbc..19d3787 100644
 --- a/source/blender/imbuf/intern/IMB_filetype.h
 +++ b/source/blender/imbuf/intern/IMB_filetype.h
 @@ -82,8 +82,9 @@ int imb_saveiris(struct ImBuf *ibuf, const char *name, int flags);
@@ -40971,7 +41424,7 @@ index 2bd7cbcf6..19d37871a 100644
  /* jpeg */
  int imb_is_a_jpeg(const unsigned char *mem);
 diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c
-index 3d3e8a064..7ffb575cd 100644
+index 3d3e8a0..7ffb575 100644
 --- a/source/blender/imbuf/intern/filetype.c
 +++ b/source/blender/imbuf/intern/filetype.c
 @@ -81,7 +81,7 @@ const ImFileType IMB_FILE_TYPES[] = {
@@ -40984,7 +41437,7 @@ index 3d3e8a064..7ffb575cd 100644
  #ifdef WITH_DDS
  	{NULL, NULL, imb_is_a_dds, NULL, imb_ftype_default, imb_load_dds, NULL, NULL, NULL, 0, IMB_FTYPE_DDS, COLOR_ROLE_DEFAULT_BYTE},
 diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
-index 390f2502e..923318fbe 100644
+index 388c273..aae16d3 100644
 --- a/source/blender/imbuf/intern/jp2.c
 +++ b/source/blender/imbuf/intern/jp2.c
 @@ -38,7 +38,7 @@
diff --git a/debian/patches/0008-fix_ppc64el_FTBFS.patch b/debian/patches/0008-fix_ppc64el_FTBFS.patch
deleted file mode 100644
index e810e5c..0000000
--- a/debian/patches/0008-fix_ppc64el_FTBFS.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From f7a8afa878d163ae669b5dfc923e2c4d2993a49a Mon Sep 17 00:00:00 2001
-From: Sergey Sharybin <sergey at blender.org>
-Date: Tue, 06 Jun 2017 11:31:13 +0200
-Subject: fix_ppc64el_FTBFS
-
----
- extern/clew/include/clew.h               | 2 +-
- extern/glog/src/stacktrace_powerpc-inl.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/extern/clew/include/clew.h b/extern/clew/include/clew.h
-index 1f79c12481b..08040af4bc1 100644
---- a/extern/clew/include/clew.h
-+++ b/extern/clew/include/clew.h
-@@ -369,7 +369,7 @@ typedef unsigned int cl_GLenum;
- #endif
- 
- /* Define basic vector types */
--#if defined( __VEC__ )
-+#if defined( __VEC__ ) && !(defined(__PPC64__) && defined(__LITTLE_ENDIAN__))
-    #include <altivec.h>   /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
-    typedef vector unsigned char     __cl_uchar16;
-    typedef vector signed char       __cl_char16;
-diff --git a/extern/glog/src/stacktrace_powerpc-inl.h b/extern/glog/src/stacktrace_powerpc-inl.h
-index 1090ddedbc7..03b91089aad 100644
---- a/extern/glog/src/stacktrace_powerpc-inl.h
-+++ b/extern/glog/src/stacktrace_powerpc-inl.h
-@@ -111,7 +111,7 @@ int GetStackTrace(void** result, int max_depth, int skip_count) {
-       result[n++] = *(sp+2);
- #elif defined(_CALL_SYSV)
-       result[n++] = *(sp+1);
--#elif defined(__APPLE__) || (defined(__linux) && defined(__PPC64__))
-+#elif defined(__APPLE__) || ((defined(__linux) || defined(__linux__)) && defined(__PPC64__))
-       // This check is in case the compiler doesn't define _CALL_AIX/etc.
-       result[n++] = *(sp+2);
- #elif defined(__linux)
--- 
-2.11.0
-
diff --git a/debian/patches/0009-fix_Hurd_FTBFS.patch b/debian/patches/0009-fix_Hurd_FTBFS.patch
deleted file mode 100644
index 89a9d36..0000000
--- a/debian/patches/0009-fix_Hurd_FTBFS.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Sergey Sharybin <sergey at blender.org>
-Date: Wed, 23 Nov 2016 14:44:29 +0100
-Subject: fix_Hurd_FTBFS
-
----
- extern/glog/src/raw_logging.cc | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/extern/glog/src/raw_logging.cc b/extern/glog/src/raw_logging.cc
-index 7a7409bbf..8517129fa 100644
---- a/extern/glog/src/raw_logging.cc
-+++ b/extern/glog/src/raw_logging.cc
-@@ -59,7 +59,8 @@
- # include <unistd.h>
- #endif
- 
--#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)
-+// Hurd does not have SYS_write.
-+#if (defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)) && !defined(__GNU__)
- # define safe_write(fd, s, len)  syscall(SYS_write, fd, s, len)
- #else
-   // Not so safe, but what can you do?
diff --git a/debian/patches/0010-fix_AMD_UI_glitches.patch b/debian/patches/0010-fix_AMD_UI_glitches.patch
deleted file mode 100644
index ba8b13d..0000000
--- a/debian/patches/0010-fix_AMD_UI_glitches.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Tue, 13 Dec 2016 22:27:15 +0100
-Subject: fix_AMD_UI_glitches
-
-Upstream issue:
- https://developer.blender.org/T49945
----
- source/blender/gpu/intern/gpu_extensions.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
-index d41573b68..b6ccbdc14 100644
---- a/source/blender/gpu/intern/gpu_extensions.c
-+++ b/source/blender/gpu/intern/gpu_extensions.c
-@@ -173,7 +173,10 @@ void gpu_extensions_init(void)
- 		GG.device = GPU_DEVICE_INTEL;
- 		GG.driver = GPU_DRIVER_OFFICIAL;
- 	}
--	else if (strstr(renderer, "Mesa DRI R") || (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) {
-+	else if ((strstr(renderer, "Mesa DRI R")) ||
-+	         (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI ")) ||
-+	         (strstr(renderer, "Gallium ") && strstr(renderer, " on AMD ")))
-+	{
- 		GG.device = GPU_DEVICE_ATI;
- 		GG.driver = GPU_DRIVER_OPENSOURCE;
- 	}
diff --git a/debian/patches/series b/debian/patches/series
index a72261e..0c67f45 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,6 +5,3 @@
 0005-do_not_use_version_number_in_system_path.patch
 0006-look_for_dejavu_ttf_with_fontconfig.patch
 0007-fix_OpenJPEG2_build.patch
-0008-fix_ppc64el_FTBFS.patch
-0009-fix_Hurd_FTBFS.patch
-0010-fix_AMD_UI_glitches.patch

-- 
blender packaging



More information about the pkg-multimedia-commits mailing list