From 5f095ba305d7cb08ce77f9add68bd004e3ca37b6 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Tue, 9 Jan 2024 12:46:15 -0600 Subject: [PATCH] CR3-Qstep table: avoid wrong 64-bit code generation patch --- LibRaw.spec | 8 +++- ...b01a49ce37d2add75e2a8f7ece5602f00457.patch | 40 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 e231b01a49ce37d2add75e2a8f7ece5602f00457.patch diff --git a/LibRaw.spec b/LibRaw.spec index 07f383e..d94c5e6 100644 --- a/LibRaw.spec +++ b/LibRaw.spec @@ -3,11 +3,12 @@ Summary: Library for reading RAW files obtained from digital photo cameras Name: LibRaw Version: 0.21.2 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD-3-Clause and (CDDL-1.0 or LGPL-2.1-only) URL: https://www.libraw.org Source0: %{url}/data/%{name}-%{version}.tar.gz Patch0: LibRaw-pkgconfig.patch +Patch1: e231b01a49ce37d2add75e2a8f7ece5602f00457.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig(lcms2) @@ -108,7 +109,10 @@ rm -fv %{buildroot}%{_libdir}/lib*.la %changelog -* Thu Dec 21 2023 Gwyn Ciesla - 0.21.2 +* Tue Jan 09 2024 Gwyn Ciesla - 0.21.2-2 +- CR3-Qstep table: avoid wrong 64-bit code generation patch + +* Thu Dec 21 2023 Gwyn Ciesla - 0.21.2-1 - 0.21.2, enable zlib support. * Tue Nov 28 2023 Orion Poplawski - 0.21.1-7 diff --git a/e231b01a49ce37d2add75e2a8f7ece5602f00457.patch b/e231b01a49ce37d2add75e2a8f7ece5602f00457.patch new file mode 100644 index 0000000..e20d856 --- /dev/null +++ b/e231b01a49ce37d2add75e2a8f7ece5602f00457.patch @@ -0,0 +1,40 @@ +From e231b01a49ce37d2add75e2a8f7ece5602f00457 Mon Sep 17 00:00:00 2001 +From: Alex Tutubalin +Date: Thu, 4 Jan 2024 15:36:38 +0300 +Subject: [PATCH] CR3-Qstep table: avoid wrong 64-bit code generation + +--- + src/decoders/crx.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/decoders/crx.cpp b/src/decoders/crx.cpp +index 30a70205..0289c075 100644 +--- a/src/decoders/crx.cpp ++++ b/src/decoders/crx.cpp +@@ -2032,7 +2032,7 @@ int crxMakeQStep(CrxImage *img, CrxTile *tile, int32_t *qpTable, uint32_t /*tota + // not sure about this nonsense - why is it not just avg like with 2 levels? + quantVal = ((quantVal < 0) * 3 + quantVal) >> 2; + if (quantVal / 6 >= 6) +- *qStepTbl = q_step_tbl[quantVal % 6] * (1 << (quantVal / 6 + 26)); ++ *qStepTbl = q_step_tbl[quantVal % 6] << ((quantVal / 6 - 6 ) & 0x1f); + else + *qStepTbl = q_step_tbl[quantVal % 6] >> (6 - quantVal / 6); + } +@@ -2052,7 +2052,7 @@ int crxMakeQStep(CrxImage *img, CrxTile *tile, int32_t *qpTable, uint32_t /*tota + { + int32_t quantVal = (qpTable[row0Idx++] + qpTable[row1Idx++]) / 2; + if (quantVal / 6 >= 6) +- *qStepTbl = q_step_tbl[quantVal % 6] * (1 << (quantVal / 6 + 26)); ++ *qStepTbl = q_step_tbl[quantVal % 6] << ((quantVal / 6 - 6) & 0x1f); + else + *qStepTbl = q_step_tbl[quantVal % 6] >> (6 - quantVal / 6); + } +@@ -2066,7 +2066,7 @@ int crxMakeQStep(CrxImage *img, CrxTile *tile, int32_t *qpTable, uint32_t /*tota + for (int qpRow = 0; qpRow < qpHeight; ++qpRow) + for (int qpCol = 0; qpCol < qpWidth; ++qpCol, ++qStepTbl, ++qpTable) + if (*qpTable / 6 >= 6) +- *qStepTbl = q_step_tbl[*qpTable % 6] * (1 << (*qpTable / 6 + 26)); ++ *qStepTbl = q_step_tbl[*qpTable % 6] << ((*qpTable / 6 - 6) & 0x1f); + else + *qStepTbl = q_step_tbl[*qpTable % 6] >> (6 - *qpTable / 6); +