Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package openjph for openSUSE:Factory checked in at 2025-09-29 16:31:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openjph (Old) and /work/SRC/openSUSE:Factory/.openjph.new.11973 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openjph" Mon Sep 29 16:31:38 2025 rev:10 rq:1307651 version:0.24.1 Changes: -------- --- /work/SRC/openSUSE:Factory/openjph/openjph.changes 2025-09-26 22:24:41.938457324 +0200 +++ /work/SRC/openSUSE:Factory/.openjph.new.11973/openjph.changes 2025-09-29 16:32:59.380334596 +0200 @@ -1,0 +2,14 @@ +Mon Sep 29 05:49:27 UTC 2025 - Michael Vetter <[email protected]> + +- Update to 0.24.1: + * Fix compilation failure on MinGW #210 + +------------------------------------------------------------------- +Mon Sep 29 05:48:34 UTC 2025 - Michael Vetter <[email protected]> + +- Update to 0.24.0: + * Use aligned memory allocation for mem_outfile #200 + * Set the needed C++ standard at configuration time #206 + * Install 64bit library in /lib64 instead of /lib #207 + +------------------------------------------------------------------- Old: ---- 0.23.1.tar.gz New: ---- 0.24.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openjph.spec ++++++ --- /var/tmp/diff_new_pack.hKrLa6/_old 2025-09-29 16:32:59.916357059 +0200 +++ /var/tmp/diff_new_pack.hKrLa6/_new 2025-09-29 16:32:59.916357059 +0200 @@ -17,7 +17,7 @@ Name: openjph -Version: 0.23.1 +Version: 0.24.1 Release: 0 Summary: An implementation of JPEG2000 Part-15 License: BSD-2-Clause @@ -33,11 +33,11 @@ This package contains libopenjph, a library implementing the JPEG-2000 standard Part 15. -%package -n libopenjph0_23 +%package -n libopenjph0_24 Summary: JPEG-2000 Part-15 library Group: System/Libraries -%description -n libopenjph0_23 +%description -n libopenjph0_24 This is an implementation of High-throughput JPEG2000 (HTJ2K), also known as JPH, JPEG2000 Part 15, ISO/IEC 15444-15, or ITU-T T.814. Only the LGT 5/3 wavelet transform for lossless compression and the @@ -47,7 +47,7 @@ Summary: Development files for libopenjph, a JPEG-2000 Part 15 library Group: Development/Libraries/C and C++ Requires: libjpeg-devel -Requires: libopenjph0_23 = %{version} +Requires: libopenjph0_24 = %{version} %description devel This package contains libopenjph, a library implementing the JPEG-2000 @@ -68,7 +68,7 @@ %install %cmake_install -%ldconfig_scriptlets -n libopenjph0_23 +%ldconfig_scriptlets -n libopenjph0_24 %files %license LICENSE @@ -76,7 +76,7 @@ %{_bindir}/ojph_compress %{_bindir}/ojph_expand -%files -n libopenjph0_23 +%files -n libopenjph0_24 %{_libdir}/libopenjph*.so.* %files devel ++++++ 0.23.1.tar.gz -> 0.24.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.23.1/CMakeLists.txt new/OpenJPH-0.24.1/CMakeLists.txt --- old/OpenJPH-0.23.1/CMakeLists.txt 2025-09-17 06:50:39.000000000 +0200 +++ new/OpenJPH-0.24.1/CMakeLists.txt 2025-09-24 01:07:57.000000000 +0200 @@ -13,7 +13,7 @@ ## Target architecture # We use the target architecture to help with arranging files in "source_group" commands. -# The code does not use the results provided by target_arch.cmake, and relies, instead, +# The code does not use the results provided by target_arch.cmake, and relies, instead, # on its own logic, which matches that in target_arch.cmake, to identify the architecture include(target_arch.cmake) target_architecture(OJPH_TARGET_ARCH) @@ -58,8 +58,8 @@ "which is architecture agnostic. If you do not specify any, the default is " "OJPH_DISABLE_SIMD=OFF.") set(OJPH_DISABLE_SIMD ${OJPH_DISABLE_INTEL_SIMD}) - message(STATUS "OJPH_DISABLE_SIMD is set to ${OJPH_DISABLE_SIMD}") - unset(OJPH_DISABLE_INTEL_SIMD) + message(STATUS "OJPH_DISABLE_SIMD is set to ${OJPH_DISABLE_SIMD}") + unset(OJPH_DISABLE_INTEL_SIMD) endif() if (DEFINED OJPH_ENABLE_INTEL_AVX512) message(STATUS "OJPH_ENABLE_INTEL_AVX512 is being deprecated, use \"OJPH_DISABLE_AVX512\" instead." @@ -69,21 +69,21 @@ else() set(OJPH_DISABLE_AVX512 ON) endif() - message(STATUS "OJPH_DISABLE_AVX512 is set to ${OJPH_DISABLE_AVX512}") + message(STATUS "OJPH_DISABLE_AVX512 is set to ${OJPH_DISABLE_AVX512}") unset(OJPH_ENABLE_INTEL_AVX512) endif() ## Setting some of the options if EMSCRIPTEN is the compiler -# In previous releases, the cmake script used to produce both non-SIMD and -# SIMD builds in one go. At the time of this writing, all interpreters and -# compilers of WASM code, such as web-browser and node, support SIMD, therefore -# it is time to make the SIMD build the default. In other words, this cmake +# In previous releases, the cmake script used to produce both non-SIMD and +# SIMD builds in one go. At the time of this writing, all interpreters and +# compilers of WASM code, such as web-browser and node, support SIMD, therefore +# it is time to make the SIMD build the default. In other words, this cmake # script builds only WASM SIMD code by default, if desired, a non-SIMD build -# can be generated using the OJPH_DISABLE_SIMD option (in this case, the +# can be generated using the OJPH_DISABLE_SIMD option (in this case, the # WASM SIMD code is not generated). # It is worth remembering that the SIMD/non-SIMD issue arose because it is # NOT possible to have multiple execution paths in the code, one for non-SIMD -# and one for SIMD, as we do for CPUs, letting the program select, at run-time, +# and one for SIMD, as we do for CPUs, letting the program select, at run-time, # the best path to follow. if(EMSCRIPTEN) set(BUILD_SHARED_LIBS OFF) @@ -119,16 +119,20 @@ ## C++ version and flags # C++14 is needed for gtest, otherwise, C++11 is sufficient for the library -set(CMAKE_CXX_STANDARD 14) +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() +message(STATUS "C++ Standard is set to ${CMAKE_CXX_STANDARD}") + if (MSVC) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") add_compile_options( - -fexceptions - -Wall - -Wextra - -Wconversion + -fexceptions + -Wall + -Wextra + -Wconversion -Wunused-parameter ) endif() @@ -170,6 +174,7 @@ endif() ## Build library and applications +include(GNUInstallDirs) add_subdirectory(src/core) if (OJPH_BUILD_EXECUTABLES) add_subdirectory(src/apps) @@ -179,8 +184,6 @@ # Install ################################################################################################ -include(GNUInstallDirs) - install(EXPORT openjph-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.23.1/src/core/common/ojph_file.h new/OpenJPH-0.24.1/src/core/common/ojph_file.h --- old/OpenJPH-0.23.1/src/core/common/ojph_file.h 2025-09-17 06:50:39.000000000 +0200 +++ new/OpenJPH-0.24.1/src/core/common/ojph_file.h 2025-09-24 01:07:57.000000000 +0200 @@ -2,21 +2,21 @@ // This software is released under the 2-Clause BSD license, included // below. // -// Copyright (c) 2019, Aous Naman +// Copyright (c) 2019, Aous Naman // Copyright (c) 2019, Kakadu Software Pty Ltd, Australia // Copyright (c) 2019, The University of New South Wales, Australia -// +// // 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 @@ -84,10 +84,10 @@ virtual size_t write(const void *ptr, size_t size) = 0; virtual si64 tell() { return 0; } - virtual int seek(si64 offset, enum outfile_base::seek origin) - { + virtual int seek(si64 offset, enum outfile_base::seek origin) + { ojph_unused(offset); ojph_unused(origin); - return -1; /* always fail, to remind you to write an implementation */ + return -1; /* always fail, to remind you to write an implementation */ } virtual void flush() {} virtual void close() {} @@ -131,19 +131,19 @@ /** A destructor */ ~mem_outfile() override; - /** + /** * @brief Call this function to open a memory file. * * This function creates a memory buffer to be used for storing * the generated j2k codestream. - * + * * @param initial_size is the initial memory buffer size. * The default value is 2^16. * @param clear_mem if set to true, all allocated memory is reset to 0 */ void open(size_t initial_size = 65536, bool clear_mem = false); - /** + /** * @brief Call this function to write data to the memory file. * * This function adds new data to the memory file. The memory buffer @@ -154,16 +154,16 @@ */ size_t write(const void *ptr, size_t size) override; - /** - * @brief Call this function to know the file size (i.e., number of + /** + * @brief Call this function to know the file size (i.e., number of * bytes used to store the file). * * @return the file size. */ si64 tell() override { return cur_ptr - buf; } - /** - * @brief Call this function to change write pointer location; the + /** + * @brief Call this function to change write pointer location; the * function can expand file storage. * * @return 0 on success, non-zero otherwise (not used). @@ -176,7 +176,7 @@ */ void close() override; - /** + /** * @brief Call this function to access memory file data. * * It is not recommended to store the returned value because buffer @@ -186,8 +186,8 @@ */ const ui8* get_data() { return buf; } - /** - * @brief Call this function to access memory file data (for const + /** + * @brief Call this function to access memory file data (for const * objects) * * This is similar to the above function, except that it can be used @@ -197,7 +197,7 @@ */ const ui8* get_data() const { return buf; } - /** + /** * @brief Call this function to write the memory file data to a file * */ @@ -221,10 +221,10 @@ private: /** * @brief This function expands storage by x1.5 needed space. - * + * * It sets cur_ptr correctly, and clears the extended area of the * buffer. It optionally clear the whole buffer - * + * * @param new_size New size of the buffer * @param clear_all Set to true to clear whole buffer, not just expansion */ @@ -237,6 +237,9 @@ size_t used_size; ui8 *buf; ui8 *cur_ptr; + + private: + static const size_t ALIGNED_ALLOC_MASK = 4096 - 1; }; //////////////////////////////////////////////////////////////////////////// diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.23.1/src/core/common/ojph_mem.h new/OpenJPH-0.24.1/src/core/common/ojph_mem.h --- old/OpenJPH-0.23.1/src/core/common/ojph_mem.h 2025-09-17 06:50:39.000000000 +0200 +++ new/OpenJPH-0.24.1/src/core/common/ojph_mem.h 2025-09-24 01:07:57.000000000 +0200 @@ -48,6 +48,29 @@ namespace ojph { + //////////////////////////////////////////////////////////////////////////// +#ifdef OJPH_OS_WINDOWS + inline void* ojph_aligned_malloc(size_t alignment, size_t size) + { + return _aligned_malloc(size, alignment); + } + + inline void ojph_aligned_free(void* pointer) + { + return _aligned_free(pointer); + } +#else + inline void* ojph_aligned_malloc(size_t alignment, size_t size) + { + return aligned_alloc(alignment, size); + } + + inline void ojph_aligned_free(void* pointer) + { + return free(pointer); + } +#endif + ///////////////////////////////////////////////////////////////////////////// class mem_fixed_allocator { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.23.1/src/core/common/ojph_version.h new/OpenJPH-0.24.1/src/core/common/ojph_version.h --- old/OpenJPH-0.23.1/src/core/common/ojph_version.h 2025-09-17 06:50:39.000000000 +0200 +++ new/OpenJPH-0.24.1/src/core/common/ojph_version.h 2025-09-24 01:07:57.000000000 +0200 @@ -34,5 +34,5 @@ //***************************************************************************/ #define OPENJPH_VERSION_MAJOR 0 -#define OPENJPH_VERSION_MINOR 23 +#define OPENJPH_VERSION_MINOR 24 #define OPENJPH_VERSION_PATCH 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.23.1/src/core/others/ojph_file.cpp new/OpenJPH-0.24.1/src/core/others/ojph_file.cpp --- old/OpenJPH-0.23.1/src/core/others/ojph_file.cpp 2025-09-17 06:50:39.000000000 +0200 +++ new/OpenJPH-0.24.1/src/core/others/ojph_file.cpp 2025-09-24 01:07:57.000000000 +0200 @@ -43,6 +43,7 @@ #include <cassert> #include <cstddef> +#include "ojph_mem.h" #include "ojph_file.h" #include "ojph_message.h" @@ -110,7 +111,7 @@ mem_outfile::~mem_outfile() { if (buf) - free(buf); + ojph_aligned_free(buf); is_open = clear_mem = false; buf_size = used_size = 0; buf = cur_ptr = NULL; @@ -201,18 +202,27 @@ if (needed_size > buf_size) { needed_size += (needed_size + 1) >> 1; // x1.5 - si64 used_size = tell(); // current used size + // expand buffer to multiples of (ALIGNED_ALLOC_MASK + 1) + needed_size = (needed_size + ALIGNED_ALLOC_MASK) & (~ALIGNED_ALLOC_MASK); - if (this->buf) - this->buf = (ui8*)realloc(this->buf, needed_size); - else - this->buf = (ui8*)malloc(needed_size); + ui8* new_buf; + new_buf = (ui8*)ojph_aligned_malloc(ALIGNED_ALLOC_MASK + 1, needed_size); + if (new_buf == NULL) + OJPH_ERROR(0x00060005, "failed to allocate memory (%zu bytes)", + needed_size); + + if (this->buf != NULL) + { + if (!clear_all) + memcpy(new_buf, this->buf, used_size); + ojph_aligned_free(this->buf); + } + this->cur_ptr = new_buf + tell(); + this->buf = new_buf; if (clear_mem && !clear_all) // will be cleared later memset(this->buf + buf_size, 0, needed_size - this->buf_size); - this->buf_size = needed_size; - this->cur_ptr = this->buf + used_size; } if (clear_all) memset(this->buf, 0, this->buf_size); ++++++ baselibs.conf ++++++ --- /var/tmp/diff_new_pack.hKrLa6/_old 2025-09-29 16:33:00.212369464 +0200 +++ /var/tmp/diff_new_pack.hKrLa6/_new 2025-09-29 16:33:00.216369632 +0200 @@ -1,2 +1,2 @@ -libopenjph0_23 +libopenjph0_24
