diff --git a/files/0007-fix_OpenJPEG2_build.patch b/files/0007-fix_OpenJPEG2_build.patch --- a/files/0007-fix_OpenJPEG2_build.patch +++ b/files/0007-fix_OpenJPEG2_build.patch @@ -6,92 +6,104 @@ 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 HINTS ${_openjpeg_SEARCH_DIRS} PATH_SUFFIXES -+ openjpeg-2.1 -+ include/openjpeg-2.1 ++ openjpeg-2.2 ++ include/openjpeg-2.2 include - include/openjpeg-1.5 ) @@ -104,7 +116,7 @@ ${_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 @@ 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 @@ + 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 @@ /*@}*/ 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 @@ 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 @@ #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 @@ + 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 @@ #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 @@ } - 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 @@ /*@}*/ 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 @@ +} + 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 @@ /*@}*/ /*@}*/ +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 +- +-/** +-@file fix.h +-@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. +-@param a +-@param b +-@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 @@ +} 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 @@ +#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 @@ + 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 @@ #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 @@ + 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 +-/** +-@file int.h +-@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 +-@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 +-@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 +-@return +- +-*/ +-static INLINE int int_clamp(int a, int min, int max) { +- if (a < min) +- return min; +- if (a > max) +- return max; +- return a; +-} +-/** +-@return Get absolute value of integer +-*/ +-static INLINE int int_abs(int 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 + 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 downwards +-@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 +-@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 @@ + } +} + -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 - * 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 - /** --@file jpt.h --@brief JPT-stream reader (JPEG 2000, JPIP) ++/** +@file invert.h +@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 --@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 @@ + OPJ_UINT32 nb_compo); +/* ----------------------------------------------------------------------- */ +/*@}*/ - --/** --Read the message header for a JPP/JPT - stream --@param cinfo Codec context info --@param cio CIO handle --@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 @@ + 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 @@ + #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 +-#else +-#include +-#include +-#include +-#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 +-/** +-@file j2k_lib.h +-@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 +-@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 @@ @@ -19886,7 +20192,7 @@ + } + else if (jp2->meth > 2) + { -+ /* ISO/IEC 15444-1:2004 (E), Table I.9 ュ Legal METH values: ++ /* ISO/IEC 15444-1:2004 (E), Table I.9 Legal METH values: + conforming JP2 reader shall ignore the entire Colour Specification box.*/ + opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), " + "so we will ignore the entire Colour Specification box. \n", jp2->meth); @@ -21917,7 +22223,7 @@ +#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 @@ /*@}*/ 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 @@ @@ -22531,135 +22837,253 @@ - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -- --#include "opj_includes.h" -- --/* -- * Read the information contains in VBAS [JPP/JPT stream message header] -- * Store information (7 bits) in value -- * -- */ --unsigned int jpt_read_VBAS_info(opj_cio_t *cio, unsigned int value) { -- unsigned char elmt; -- -- elmt = cio_read(cio, 1); -- while ((elmt >> 7) == 1) { -- value = (value << 7); -- value |= (elmt & 0x7f); -- elmt = cio_read(cio, 1); -- } -- value = (value << 7); -- value |= (elmt & 0x7f); -- -- return value; --} -- --/* -- * Initialize the value of the message header structure -- * -- */ --void jpt_init_msg_header(opj_jpt_msg_header_t * header) { -- header->Id = 0; /* In-class Identifier */ -- header->last_byte = 0; /* Last byte information */ -- header->Class_Id = 0; /* Class Identifier */ -- header->CSn_Id = 0; /* CSn : index identifier */ -- header->Msg_offset = 0; /* Message offset */ -- header->Msg_length = 0; /* Message length */ -- header->Layer_nb = 0; /* Auxiliary for JPP case */ --} -- --/* -- * Re-initialize the value of the message header structure -- * -- * Only parameters always present in message header -- * -- */ --void jpt_reinit_msg_header(opj_jpt_msg_header_t * header) { -- header->Id = 0; /* In-class Identifier */ -- header->last_byte = 0; /* Last byte information */ -- header->Msg_offset = 0; /* Message offset */ -- header->Msg_length = 0; /* Message length */ --} -- --/* -- * Read the message header for a JPP/JPT - stream -- * -- */ --void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header) { -- unsigned char elmt, Class = 0, CSn = 0; -- jpt_reinit_msg_header(header); -- -- /* ------------- */ -- /* VBAS : Bin-ID */ -- /* ------------- */ -- elmt = cio_read(cio, 1); -- -- /* See for Class and CSn */ -- switch ((elmt >> 5) & 0x03) { -- case 0: -- opj_event_msg(cinfo, EVT_ERROR, "Forbidden value encounter in message header !!\n"); -- break; -- case 1: -- Class = 0; -- CSn = 0; -- break; -- case 2: -- Class = 1; -- CSn = 0; -- break; -- case 3: -- Class = 1; -- CSn = 1; -- break; -- default: -- break; -- } -- -- /* see information on bits 'c' [p 10 : A.2.1 general, ISO/IEC FCD 15444-9] */ -- if (((elmt >> 4) & 0x01) == 1) -- header->last_byte = 1; -- -- /* In-class identifier */ -- header->Id |= (elmt & 0x0f); -- if ((elmt >> 7) == 1) -- header->Id = jpt_read_VBAS_info(cio, header->Id); -- -- /* ------------ */ -- /* VBAS : Class */ -- /* ------------ */ -- if (Class == 1) { -- header->Class_Id = 0; -- header->Class_Id = jpt_read_VBAS_info(cio, header->Class_Id); -- } -- -- /* ---------- */ -- /* VBAS : CSn */ -- /* ---------- */ -- if (CSn == 1) { -- header->CSn_Id = 0; -- header->CSn_Id = jpt_read_VBAS_info(cio, header->CSn_Id); -- } -- -- /* ----------------- */ -- /* VBAS : Msg_offset */ -- /* ----------------- */ -- header->Msg_offset = jpt_read_VBAS_info(cio, header->Msg_offset); -- -- /* ----------------- */ -- /* VBAS : Msg_length */ -- /* ----------------- */ -- header->Msg_length = jpt_read_VBAS_info(cio, header->Msg_length); -- -- /* ---------- */ -- /* VBAS : Aux */ -- /* ---------- */ -- if ((header->Class_Id & 0x01) == 1) { -- header->Layer_nb = 0; -- header->Layer_nb = jpt_read_VBAS_info(cio, header->Layer_nb); -- } --} +- +-#include "opj_includes.h" +- +-/* +- * Read the information contains in VBAS [JPP/JPT stream message header] +- * Store information (7 bits) in value +- * +- */ +-unsigned int jpt_read_VBAS_info(opj_cio_t *cio, unsigned int value) { +- unsigned char elmt; +- +- elmt = cio_read(cio, 1); +- while ((elmt >> 7) == 1) { +- value = (value << 7); +- value |= (elmt & 0x7f); +- elmt = cio_read(cio, 1); +- } +- value = (value << 7); +- value |= (elmt & 0x7f); +- +- return value; +-} +- +-/* +- * Initialize the value of the message header structure +- * +- */ +-void jpt_init_msg_header(opj_jpt_msg_header_t * header) { +- header->Id = 0; /* In-class Identifier */ +- header->last_byte = 0; /* Last byte information */ +- header->Class_Id = 0; /* Class Identifier */ +- header->CSn_Id = 0; /* CSn : index identifier */ +- header->Msg_offset = 0; /* Message offset */ +- header->Msg_length = 0; /* Message length */ +- header->Layer_nb = 0; /* Auxiliary for JPP case */ +-} +- +-/* +- * Re-initialize the value of the message header structure +- * +- * Only parameters always present in message header +- * +- */ +-void jpt_reinit_msg_header(opj_jpt_msg_header_t * header) { +- header->Id = 0; /* In-class Identifier */ +- header->last_byte = 0; /* Last byte information */ +- header->Msg_offset = 0; /* Message offset */ +- header->Msg_length = 0; /* Message length */ +-} +- +-/* +- * Read the message header for a JPP/JPT - stream +- * +- */ +-void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header) { +- unsigned char elmt, Class = 0, CSn = 0; +- jpt_reinit_msg_header(header); +- +- /* ------------- */ +- /* VBAS : Bin-ID */ +- /* ------------- */ +- elmt = cio_read(cio, 1); +- +- /* See for Class and CSn */ +- switch ((elmt >> 5) & 0x03) { +- case 0: +- opj_event_msg(cinfo, EVT_ERROR, "Forbidden value encounter in message header !!\n"); +- break; +- case 1: +- Class = 0; +- CSn = 0; +- break; +- case 2: +- Class = 1; +- CSn = 0; +- break; +- case 3: +- Class = 1; +- CSn = 1; +- break; +- default: +- break; +- } +- +- /* see information on bits 'c' [p 10 : A.2.1 general, ISO/IEC FCD 15444-9] */ +- if (((elmt >> 4) & 0x01) == 1) +- header->last_byte = 1; +- +- /* In-class identifier */ +- header->Id |= (elmt & 0x0f); +- if ((elmt >> 7) == 1) +- header->Id = jpt_read_VBAS_info(cio, header->Id); +- +- /* ------------ */ +- /* VBAS : Class */ +- /* ------------ */ +- if (Class == 1) { +- header->Class_Id = 0; +- header->Class_Id = jpt_read_VBAS_info(cio, header->Class_Id); +- } +- +- /* ---------- */ +- /* VBAS : CSn */ +- /* ---------- */ +- if (CSn == 1) { +- header->CSn_Id = 0; +- header->CSn_Id = jpt_read_VBAS_info(cio, header->CSn_Id); +- } +- +- /* ----------------- */ +- /* VBAS : Msg_offset */ +- /* ----------------- */ +- header->Msg_offset = jpt_read_VBAS_info(cio, header->Msg_offset); +- +- /* ----------------- */ +- /* VBAS : Msg_length */ +- /* ----------------- */ +- header->Msg_length = jpt_read_VBAS_info(cio, header->Msg_length); +- +- /* ---------- */ +- /* VBAS : Aux */ +- /* ---------- */ +- if ((header->Class_Id & 0x01) == 1) { +- header->Layer_nb = 0; +- 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 +-/** +-@file jpt.h +-@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 +-@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 +-@param cinfo Codec context info +-@param cio CIO handle +-@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 @@ + } } 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 @@ /*@}*/ 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 @@ 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 @@ /*@}*/ 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 @@ + 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 @@ #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 ++#else ++#include ++#include ++#include ++#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 - /** --@file j2k_lib.h --@brief Internal functions ++/** +@file opj_clock.h +@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 ++@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 @@ +#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 @@ +#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 @@ + +// #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 @@ * 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 #include @@ -27054,17 +27513,13 @@ + + #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 @@ + * + * 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 - /** --@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 ++/** +@file opj_intmath.h - @brief Implementation of operations on integers (INT) - --The functions in INT.H have for goal to realize operations on integers. ++@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 ++@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 @@ +@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 ++@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 @@ + return (a > b) ? a : b; +} + - /** - Clamp an integer inside an interval - @return -@@ -66,7 +90,7 @@ Clamp an integer inside an interval -
  • Returns min if (a < min) - - */ --static INLINE int int_clamp(int a, int min, int max) { ++/** ++Clamp an integer inside an interval ++@return ++
      ++
    • Returns a if (min < a < max) ++
    • Returns max if (a > max) ++
    • Returns min if (a < min) ++
    ++*/ +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; ++} ++/** ++@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 ++@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 @@ +@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 ++@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 ++@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 ++@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 +@return Returns log2(a) @@ -27224,39 +27691,47 @@ + 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 - * 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 @@ + +#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 @@ /** 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 - * 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 @@ -27380,40 +27859,14 @@ +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 - --/** --@file fix.h --@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. --@param a --@param b --@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 @@ + 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 @@ + 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 @@ /*@}*/ 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 @@ + 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 @@ 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 @@ /*@}*/ 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 @@ +} /* 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 @@ 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 @@ + 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 @@ 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 @@ + 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 @@ /* ----------------------------------------------------------------------- */ /*@}*/ 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 @@ + 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 @@ /* ----------------------------------------------------------------------- */ /*@}*/ 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 @@ + 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 @@ /*@}*/ 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 @@ + 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 @@ 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 @@ /* 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 @@ #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 @@ @@ -41691,3 +42144,4 @@ + + return ok; } + diff --git a/package.yml b/package.yml --- a/package.yml +++ b/package.yml @@ -1,9 +1,9 @@ name : blender -version : 2.78c -release : 22 +version : 2.79 +release : 23 source : - - http://download.blender.org/source/blender-2.78c.tar.gz : 64a98ff30300f79385ddb9ad016aa790a92720ff2feb84ddb1d097e6531dd338 -license : GPL-2.0+ + - https://download.blender.org/source/blender-2.79.tar.gz : a9de03e769a2a4a0bf92186556896c4f4d32fd9ac4480915ae92d7f95b25c899 +license : GPL-2.0 component : multimedia.graphics summary : A fully integrated 3D graphics creation suite description: | @@ -17,6 +17,7 @@ - pkgconfig(libopenjp2) - pkgconfig(libpng) - pkgconfig(libtiff-4) + - pkgconfig(libturbojpeg) - pkgconfig(openal) - pkgconfig(OpenColorIO) - pkgconfig(OpenEXR) @@ -26,7 +27,6 @@ - pkgconfig(x11) - pkgconfig(xi) - jemalloc-devel - - libjpeg-turbo-devel - libboost-devel - llvm-devel - openimageio-devel @@ -40,7 +40,6 @@ -DPYTHON_LIBPATH=%libdir% \ -DPYTHON_LIBRARY=python3.5m \ -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m \ - -DWITH_SYSTEM_GLEW=ON \ -DWITH_INSTALL_PORTABLE=OFF \ -DWITH_PYTHON_INSTALL=OFF \ -DWITH_SDL=ON \ diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml --- a/pspec_x86_64.xml +++ b/pspec_x86_64.xml @@ -2,10 +2,10 @@ blender - Peter O'Connor - peter@solus-project.com + Pierre-Yves + pyu@riseup.net - GPL-2.0+ + GPL-2.0 multimedia.graphics A fully integrated 3D graphics creation suite A fully integrated 3D graphics creation suite @@ -33,12 +33,12 @@ - - 2017-06-30 - 2.78c + + 2017-11-21 + 2.79 Packaging update - Peter O'Connor - peter@solus-project.com + Pierre-Yves + pyu@riseup.net \ No newline at end of file