Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package zimg for openSUSE:Factory checked in at 2021-10-04 18:38:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zimg (Old) and /work/SRC/openSUSE:Factory/.zimg.new.2443 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zimg" Mon Oct 4 18:38:57 2021 rev:37 rq:922016 version:3.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/zimg/zimg.changes 2020-09-25 16:22:07.915390850 +0200 +++ /work/SRC/openSUSE:Factory/.zimg.new.2443/zimg.changes 2021-10-04 18:39:01.597966069 +0200 @@ -1,0 +2,18 @@ +Wed Sep 22 17:19:43 UTC 2021 - Michael Gorse <[email protected]> + +- Update to 3.0.3: + * depth: fix out-of-bounds read in SSE2/AVX2 error diffusion + (introduced in 2.5) + * colorspace: revert SMPTE 240M behavior change (introduced in + 3.0.2) + * Changes in version 3.0.2: + * api: default to ZIMG_CPU_AUTO when graph params are null + * colorspace: fix incorrect SMPTE 240M transfer function + * colorspace: fix underflow in AVX-512 ST.2084 transfer functions + * graph: fix conversion from fullrange grey to RGB + * arm: fix data alignment + * x86: optimizations for AMD Zen3 processors +- Add zimg-s390x-unit-tests.patch: fix unit tests on big endian + systems. + +------------------------------------------------------------------- Old: ---- zimg-3.0.1.obscpio New: ---- zimg-3.0.3.obscpio zimg-s390x-unit-tests.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zimg.spec ++++++ --- /var/tmp/diff_new_pack.hgpXT6/_old 2021-10-04 18:39:02.249967128 +0200 +++ /var/tmp/diff_new_pack.hgpXT6/_new 2021-10-04 18:39:02.253967135 +0200 @@ -18,7 +18,7 @@ %define sover 2 Name: zimg -Version: 3.0.1 +Version: 3.0.3 Release: 0 Summary: Scaling, colorspace conversion, and dithering library License: WTFPL @@ -26,6 +26,7 @@ URL: https://github.com/sekrit-twc/zimg Source0: zimg-%{version}.tar.xz Source99: baselibs.conf +Patch0: zimg-s390x-unit-tests.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: cmake @@ -56,6 +57,7 @@ %prep %setup -q +%patch0 -p1 %build autoreconf -fiv ++++++ _service ++++++ --- /var/tmp/diff_new_pack.hgpXT6/_old 2021-10-04 18:39:02.285967187 +0200 +++ /var/tmp/diff_new_pack.hgpXT6/_new 2021-10-04 18:39:02.285967187 +0200 @@ -3,8 +3,8 @@ <param name="url">https://github.com/sekrit-twc/zimg.git</param> <param name="scm">git</param> <param name="versionformat">@PARENT_TAG@</param> - <param name="versionrewrite-pattern">release([0-9\.]*)</param> - <param name="revision">release-3.0.1</param> + <param name="versionrewrite-pattern">release-([0-9\.]*)</param> + <param name="revision">release-3.0.3</param> </service> <service name="tar" mode="buildtime" /> <service name="recompress" mode="buildtime"> ++++++ zimg-3.0.1.obscpio -> zimg-3.0.3.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/.gitignore new/zimg-3.0.3/.gitignore --- old/zimg-3.0.1/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/zimg-3.0.3/.gitignore 2021-09-05 19:21:14.000000000 +0200 @@ -0,0 +1,54 @@ +# Output files from testapp. +*.bin +*.bmp +*.yuv + +# MSVC files. +*.db +*.opendb +*.opensdf +*.sdf +*.suo +*.user +_msvc/.vs +Debug +Release + +# autotools files. +*.o +*.la +*.lo +*.pc +*.so +*.dll +*.log +*.trs +.libs +.deps/ +.dirstamp +doc/example/alpha_example +doc/example/api_example +doc/example/api_example_c +doc/example/hdr_example +doc/example/interlace_example +doc/example/tile_example +m4/libtool.m4 +m4/lt*.m4 +test/unit_test +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +compile +config.* +configure +depcomp +install-sh +libtool +ltmain.sh +missing +testapp +test-driver +test-suite.log + +!doc/example/Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/ChangeLog new/zimg-3.0.3/ChangeLog --- old/zimg-3.0.1/ChangeLog 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/ChangeLog 2021-09-05 19:21:14.000000000 +0200 @@ -1,3 +1,15 @@ +3.0.3 +depth: fix out-of-bounds read in SSE2/AVX2 error diffusion (introduced in 2.5) +colorspace: revert SMPTE 240M behavior change (introduced in 3.0.2) + +3.0.2 +api: default to ZIMG_CPU_AUTO when graph params are null +colorspace: fix incorrect SMPTE 240M transfer function +colorspace: fix underflow in AVX-512 ST.2084 transfer functions +graph: fix conversion from fullrange grey to RGB +arm: fix data alignment +x86: optimizations for AMD Zen3 processors + 3.0.1 graph: fix handling of default nominal_peak_luminance (introduced in 3.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/configure.ac new/zimg-3.0.3/configure.ac --- old/zimg-3.0.1/configure.ac 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/configure.ac 2021-09-05 19:21:14.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([zimg], [3.0.1], [https://github.com/sekrit-twc/zimg/pulls], [zimg], [https://github.com/sekrit-twc/zimg]) +AC_INIT([zimg], [3.0.3], [https://github.com/sekrit-twc/zimg/pulls], [zimg], [https://github.com/sekrit-twc/zimg]) AC_CONFIG_MACRO_DIR([m4]) : ${CFLAGS=""} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/testapp/cpuinfoapp.cpp new/zimg-3.0.3/src/testapp/cpuinfoapp.cpp --- old/zimg-3.0.1/src/testapp/cpuinfoapp.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/testapp/cpuinfoapp.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -45,6 +45,7 @@ std::cout << "Piledriver: " << yes_no(caps.piledriver) << '\n'; std::cout << "Zen1: " << yes_no(caps.zen1) << '\n'; std::cout << "Zen2: " << yes_no(caps.zen2) << '\n'; + std::cout << "Zen3: " << yes_no(caps.zen3) << '\n'; std::cout << '\n'; const zimg::X86CacheHierarchy cache = zimg::query_x86_cache_hierarchy(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/api/zimg.cpp new/zimg-3.0.3/src/zimg/api/zimg.cpp --- old/zimg-3.0.1/src/zimg/api/zimg.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/api/zimg.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -37,7 +37,7 @@ thread_local zimg_error_code_e g_last_error = ZIMG_ERROR_SUCCESS; thread_local std::string g_last_error_msg; -constexpr unsigned VERSION_INFO[] = { 3, 0, 1 }; +constexpr unsigned VERSION_INFO[] = { 3, 0, 3 }; template <class T, class U> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/colorspace/x86/gamma_constants_avx512.cpp new/zimg-3.0.3/src/zimg/colorspace/x86/gamma_constants_avx512.cpp --- old/zimg-3.0.1/src/zimg/colorspace/x86/gamma_constants_avx512.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/colorspace/x86/gamma_constants_avx512.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -1,6 +1,7 @@ #ifdef ZIMG_X86_AVX512 #include <algorithm> +#include <cfloat> #include <cmath> #include "gamma_constants_avx512.h" @@ -261,6 +262,8 @@ float result; int idx; + x = std::max(x, FLT_MIN); + if (Log) { int exp; frexp_1_2(x, &exp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/colorspace/x86/operation_impl_avx512.cpp new/zimg-3.0.3/src/zimg/colorspace/x86/operation_impl_avx512.cpp --- old/zimg-3.0.1/src/zimg/colorspace/x86/operation_impl_avx512.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/colorspace/x86/operation_impl_avx512.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -1,5 +1,6 @@ #ifdef ZIMG_X86_AVX512 +#include <cfloat> #include <immintrin.h> #include "common/align.h" #include "common/ccdep.h" @@ -218,6 +219,8 @@ if (Prescale) x = _mm512_mul_ps(x, scale); + x = _mm512_max_ps(x, _mm512_set1_ps(FLT_MIN)); + if (Log) { // Classify the argument into one of 32 segments by its exponent. const __m512i exponent_min = _mm512_set1_epi32(127 - 32); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/common/align.h new/zimg-3.0.3/src/zimg/common/align.h --- old/zimg-3.0.1/src/zimg/common/align.h 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/common/align.h 2021-09-05 19:21:14.000000000 +0200 @@ -8,9 +8,12 @@ /** * 64-byte alignment allows the use of instructions up to AVX-512. */ -#ifdef ZIMG_X86 +#if defined(ZIMG_X86) constexpr int ALIGNMENT = 64; constexpr int ALIGNMENT_RELAXED = 32; +#elif defined(ZIMG_ARM) +constexpr int ALIGNMENT = 16; +constexpr int ALIGNMENT_RELAXED = 16; #else constexpr int ALIGNMENT = sizeof(long double); constexpr int ALIGNMENT_RELAXED = sizeof(long double); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/common/x86/cpuinfo_x86.cpp new/zimg-3.0.3/src/zimg/common/x86/cpuinfo_x86.cpp --- old/zimg-3.0.1/src/zimg/common/x86/cpuinfo_x86.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/common/x86/cpuinfo_x86.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -119,16 +119,15 @@ model = (regs[0] >> 4) & 0x0FU; family = (regs[0] >> 8) & 0x0FU; - if (family == 6) { - family += ((regs[0] >> 20) & 0x0FU); - } else if (family == 15) { + if (family == 15) { family += ((regs[0] >> 20) & 0x0FU); model += ((regs[0] >> 16) & 0x0FU) << 4; } caps.piledriver = family == 0x15 && model == 0x02; - caps.zen1 = family == 0x17 && model <= 0x1FU; - caps.zen2 = family == 0x17 && model >= 0x20U; + caps.zen1 = family == 0x17 && model <= 0x2F; + caps.zen2 = family == 0x17 && model >= 0x30; + caps.zen3 = family == 0x19; } return caps; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/common/x86/cpuinfo_x86.h new/zimg-3.0.3/src/zimg/common/x86/cpuinfo_x86.h --- old/zimg-3.0.1/src/zimg/common/x86/cpuinfo_x86.h 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/common/x86/cpuinfo_x86.h 2021-09-05 19:21:14.000000000 +0200 @@ -39,14 +39,15 @@ unsigned piledriver : 1; unsigned zen1 : 1; unsigned zen2 : 1; + unsigned zen3 : 1; }; /* 17 cycles per store on Piledriver. */ constexpr bool cpu_has_slow_avx(const X86Capabilities &caps) { return caps.piledriver; } -/* 2+ cycles per value on AMD. */ +/* 2+ cycles per value on AMD. Still >1 cycle on Zen3, but usable. */ constexpr bool cpu_has_slow_gather(const X86Capabilities &caps) { return caps.xop || caps.zen1 || caps.zen2; } -/* 4 cycles per vpermd on Zen. */ -constexpr bool cpu_has_slow_permute(const X86Capabilities &caps) { return caps.zen1 || caps.zen2; } +/* 4 cycles per vpermd on Zen. Higher throughput on Zen3, but still long latency. */ +constexpr bool cpu_has_slow_permute(const X86Capabilities &caps) { return caps.zen1 || caps.zen2 || caps.zen3; } constexpr bool cpu_has_avx512_f_dq_bw_vl(const X86Capabilities &caps) { return caps.avx512f && caps.avx512dq && caps.avx512bw && caps.avx512vl; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/depth/x86/error_diffusion_avx2.cpp new/zimg-3.0.3/src/zimg/depth/x86/error_diffusion_avx2.cpp --- old/zimg-3.0.1/src/zimg/depth/x86/error_diffusion_avx2.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/depth/x86/error_diffusion_avx2.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -127,13 +127,14 @@ typename dst_traits::type *dst_p = static_cast<typename dst_traits::type *>(dst); float err_left = error_cur[0]; - float err_top_right = error_top[1 + 1]; + float err_top_right; float err_top = error_top[0 + 1]; float err_top_left = error_top[0]; for (unsigned j = 0; j < width; ++j) { // Error array is padded by one on each side. unsigned j_err = j + 1; + err_top_right = error_top[j_err + 1]; float x = fma(src_traits::load1(src_p + j), scale, offset); float err, err0, err1; @@ -156,7 +157,6 @@ err_left = err; err_top_left = err_top; err_top = err_top_right; - err_top_right = error_top[j_err + 2]; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/depth/x86/error_diffusion_sse2.cpp new/zimg-3.0.3/src/zimg/depth/x86/error_diffusion_sse2.cpp --- old/zimg-3.0.1/src/zimg/depth/x86/error_diffusion_sse2.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/depth/x86/error_diffusion_sse2.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -99,13 +99,14 @@ U *dst_p = static_cast<U *>(dst); float err_left = error_cur[0]; - float err_top_right = error_top[1 + 1]; + float err_top_right; float err_top = error_top[0 + 1]; float err_top_left = error_top[0]; for (unsigned j = 0; j < width; ++j) { // Error array is padded by one on each side. unsigned j_err = j + 1; + err_top_right = error_top[j_err + 1]; float x = static_cast<float>(src_p[j]) * scale + offset; float err; @@ -125,7 +126,6 @@ err_left = err; err_top_left = err_top; err_top = err_top_right; - err_top_right = error_top[j_err + 2]; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/src/zimg/graph/graphbuilder.cpp new/zimg-3.0.3/src/zimg/graph/graphbuilder.cpp --- old/zimg-3.0.1/src/zimg/graph/graphbuilder.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/src/zimg/graph/graphbuilder.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -651,6 +651,15 @@ }); } + void reinterpret_limited_to_full(internal_state &target, plane_mask mask) + { + apply_mask(mask, [&](int p) + { + m_state.planes[p].format.fullrange = true; + target.planes[p].format.fullrange = true; + }); + } + PixelFormat choose_resize_format(const internal_state &target, const params ¶ms, int p) { if (params.unresize) @@ -693,7 +702,7 @@ if (params.unresize) { if (src_plane.width != src_plane.active_width || src_plane.height != src_plane.active_height || - dst_plane.width != dst_plane.active_height || dst_plane.height != dst_plane.active_height) + dst_plane.width != dst_plane.active_width || dst_plane.height != dst_plane.active_height) { error::throw_<error::ResamplingNotAvailable>("unresize not supported for for given subregion"); } @@ -812,6 +821,7 @@ void connect_plane(internal_state &target, const params ¶ms, FilterObserver &observer, ConnectMode mode, bool reinterpret_range) { plane_mask mask{}; + bool reinterpreted = false; int p; if (mode == ConnectMode::LUMA) { @@ -834,6 +844,7 @@ src_format.depth == dst_format.depth) { reinterpret_full_to_limited(target, mask); + reinterpreted = true; } } @@ -846,6 +857,10 @@ if (m_state.planes[p].format != target.planes[p].format) convert_pixel_format(target.planes[p].format, params, observer, mask, p); + // Undo temporary changes. + if (reinterpreted) + reinterpret_limited_to_full(target, mask); + iassert(m_state.planes[p] == target.planes[p]); } @@ -1015,7 +1030,7 @@ peak_luminance{ NAN }, approximate_gamma{}, scene_referred{}, - cpu{} + cpu{ CPUClass::AUTO } { static const resize::BicubicFilter bicubic; static const resize::BilinearFilter bilinear; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/test/colorspace/x86/colorspace_avx512_test.cpp new/zimg-3.0.3/test/colorspace/x86/colorspace_avx512_test.cpp --- old/zimg-3.0.1/test/colorspace/x86/colorspace_avx512_test.cpp 2020-08-23 15:47:57.000000000 +0200 +++ new/zimg-3.0.3/test/colorspace/x86/colorspace_avx512_test.cpp 2021-09-05 19:21:14.000000000 +0200 @@ -123,17 +123,17 @@ const char *expected_sha1[][3] = { { "a0d7b4c6dc3381e8831aa84ab7ba05eb86cafd2b", - "6345c0b2fdf0ee348ba118079d42ceefaaf8246a", - "a9b9b13c86994111b90b7ad27e7b97023ad740a1" + "de66d5dba367ceaede45ebe67c69bfe37d9d93ca", + "d05cd2436d1fd07d7f86c0652a590cbe1486d610" }, { "e64ec0811294da6869b6220ff00c6f7d3dda7399", - "f5d36d61da9d7b137101b21e2ce269d001e80c8e", - "6d70abd6fcf589ceb01d0e9b26f9314af146a06a" + "8337219bbe647c04db8b78f6eefc83198d00c989", + "008a31ae15dc49d78c4920a755c436b55fb6ba66" }, }; - const double expected_tolinear_snr = 70.0; - const double expected_togamma_snr = 80.0; + const double expected_tolinear_snr = 90.0; + const double expected_togamma_snr = 100.0; SCOPED_TRACE("tolinear"); test_case({ MatrixCoefficients::RGB, TransferCharacteristics::ST_2084, ColorPrimaries::UNSPECIFIED }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zimg-3.0.1/test/extra/googletest/.gitignore new/zimg-3.0.3/test/extra/googletest/.gitignore --- old/zimg-3.0.1/test/extra/googletest/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/zimg-3.0.3/test/extra/googletest/.gitignore 2021-09-05 19:21:14.000000000 +0200 @@ -0,0 +1,84 @@ +# Ignore CI build directory +build/ +xcuserdata +cmake-build-debug/ +.idea/ +bazel-bin +bazel-genfiles +bazel-googletest +bazel-out +bazel-testlogs +# python +*.pyc + +# Visual Studio files +.vs +*.sdf +*.opensdf +*.VC.opendb +*.suo +*.user +_ReSharper.Caches/ +Win32-Debug/ +Win32-Release/ +x64-Debug/ +x64-Release/ + +# Ignore autoconf / automake files +Makefile.in +aclocal.m4 +configure +build-aux/ +autom4te.cache/ +googletest/m4/libtool.m4 +googletest/m4/ltoptions.m4 +googletest/m4/ltsugar.m4 +googletest/m4/ltversion.m4 +googletest/m4/lt~obsolete.m4 +googlemock/m4 + +# Ignore generated directories. +googlemock/fused-src/ +googletest/fused-src/ + +# macOS files +.DS_Store +googletest/.DS_Store +googletest/xcode/.DS_Store + +# Ignore cmake generated directories and files. +CMakeFiles +CTestTestfile.cmake +Makefile +cmake_install.cmake +googlemock/CMakeFiles +googlemock/CTestTestfile.cmake +googlemock/Makefile +googlemock/cmake_install.cmake +googlemock/gtest +/bin +/googlemock/gmock.dir +/googlemock/gmock_main.dir +/googlemock/RUN_TESTS.vcxproj.filters +/googlemock/RUN_TESTS.vcxproj +/googlemock/INSTALL.vcxproj.filters +/googlemock/INSTALL.vcxproj +/googlemock/gmock_main.vcxproj.filters +/googlemock/gmock_main.vcxproj +/googlemock/gmock.vcxproj.filters +/googlemock/gmock.vcxproj +/googlemock/gmock.sln +/googlemock/ALL_BUILD.vcxproj.filters +/googlemock/ALL_BUILD.vcxproj +/lib +/Win32 +/ZERO_CHECK.vcxproj.filters +/ZERO_CHECK.vcxproj +/RUN_TESTS.vcxproj.filters +/RUN_TESTS.vcxproj +/INSTALL.vcxproj.filters +/INSTALL.vcxproj +/googletest-distribution.sln +/CMakeCache.txt +/ALL_BUILD.vcxproj.filters +/ALL_BUILD.vcxproj ++++++ zimg-s390x-unit-tests.patch ++++++ >From b2bee8460a0f6ecf049e27d0a2090c87e871d951 Mon Sep 17 00:00:00 2001 From: Mike Gorse <[email protected]> Date: Wed, 22 Sep 2021 11:57:47 -0500 Subject: [PATCH] FIx unit tests on big endian systems --- test/extra/sha1/config.h | 6 ++++++ test/graph/filter_validator.cpp | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/test/extra/sha1/config.h b/test/extra/sha1/config.h index ea853f0..7bc4e00 100644 --- a/test/extra/sha1/config.h +++ b/test/extra/sha1/config.h @@ -1,3 +1,5 @@ +#include <endian.h> + #ifndef LITTLE_ENDIAN #define LITTLE_ENDIAN 4321 #endif @@ -7,5 +9,9 @@ #endif #ifndef BYTE_ORDER +#if defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN) + #define BYTE_ORDER BIG_ENDIAN +#else #define BYTE_ORDER LITTLE_ENDIAN #endif +#endif diff --git a/test/graph/filter_validator.cpp b/test/graph/filter_validator.cpp index f0d6859..d768ebf 100644 --- a/test/graph/filter_validator.cpp +++ b/test/graph/filter_validator.cpp @@ -13,6 +13,8 @@ #include "gtest/gtest.h" +#include <endian.h> + extern "C" { #include "sha1/sha1.h" } @@ -40,7 +42,13 @@ void hash_buffer(const AuditBuffer<T> &buf, unsigned p, unsigned width, unsigned for (unsigned i = 0; i < height; ++i) { const unsigned char *ptr = static_cast<const unsigned char *>(image_buffer[p][i]); +#if (__BYTE_ORDER == __LITTLE_ENDIAN) SHA1Update(&sha_ctx, ptr, width * sizeof(T)); +#else + for (unsigned j = 0; j < width; j++) + for (int k = sizeof(T) - 1; k >= 0; k--) + SHA1Update(&sha_ctx, ptr + (j * sizeof(T)) + k, 1); +#endif } SHA1Final(digest, &sha_ctx); -- 2.32.0 ++++++ zimg.obsinfo ++++++ --- /var/tmp/diff_new_pack.hgpXT6/_old 2021-10-04 18:39:02.649967778 +0200 +++ /var/tmp/diff_new_pack.hgpXT6/_new 2021-10-04 18:39:02.649967778 +0200 @@ -1,5 +1,5 @@ name: zimg -version: 3.0.1 -mtime: 1598190477 -commit: e17ee6cf72509c32c15067b32615849e69486367 +version: 3.0.3 +mtime: 1630862474 +commit: 1658ce429cf944e88868a88d8aef4683425d4e78
