[packages/svt-jpeg-xs] - new, with patch to disable x86_64 specific asm on 32-bit ABIs
qboosh
qboosh at pld-linux.org
Mon Mar 24 20:16:59 CET 2025
commit e513adfab3dd11292c6265de879570326b88e8e4
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon Mar 24 20:04:26 2025 +0100
- new, with patch to disable x86_64 specific asm on 32-bit ABIs
svt-jpeg-xs-no-asm.patch | 91 ++++++++++++++++++++++++++++++++++++++++++++++++
svt-jpeg-xs.spec | 82 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 173 insertions(+)
---
diff --git a/svt-jpeg-xs.spec b/svt-jpeg-xs.spec
new file mode 100644
index 0000000..adc3861
--- /dev/null
+++ b/svt-jpeg-xs.spec
@@ -0,0 +1,82 @@
+# TODO: system cpuinfo (when released? note: different project than packaged in cpuinfo.spec)
+Summary: Scalable Video Technology for JPEG-XS (SVT-JPEG-XS Encoder and Decoder)
+Summary(pl.UTF-8): Scalable Video Technology dla JPEG-XS (koder i dekoder SVT-JPEG-XS)
+Name: svt-jpeg-xs
+Version: 0.9.0
+Release: 1
+License: BSD
+Group: Libraries
+#Source0Download: https://github.com/OpenVisualCloud/SVT-JPEG-XS/releases
+Source0: https://github.com/OpenVisualCloud/SVT-JPEG-XS/archive/v%{version}/SVT-JPEG-XS-%{version}.tar.gz
+# Source0-md5: c9d92f9158927698e074d3658464952f
+Patch0: %{name}-no-asm.patch
+URL: https://github.com/OpenVisualCloud/SVT-JPEG-XS
+BuildRequires: cmake >= 3.5
+BuildRequires: libstdc++-devel >= 6:4.7
+BuildRequires: rpmbuild(macros) >= 1.605
+%ifarch %{x8664}
+# preferred by cmake; also nasm >= 2.13 possible
+BuildRequires: yasm >= 1.2.0
+%endif
+# other archs can be supported by removing ARCH_X86_64 define (which enables SIMD support via gcc intrinsics)
+ExclusiveArch: %{ix86} %{x8664} x32
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This library is implementation of ISO/IEC 21122 protocol.
+
+%description -l pl.UTF-8
+Ta biblioteka to implementacja protokołu ISO/IEC 21122.
+
+%package devel
+Summary: Header files for SVT-JPEG-XS library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki SVT-JPEG-XS
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files for SVT-JPEG-XS library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki SVT-JPEG-XS.
+
+%prep
+%setup -q -n SVT-JPEG-XS-%{version}
+
+%build
+install -d build
+cd build
+%cmake .. \
+%ifnarch %{x8664}
+ -DDISABLE_ASM=ON
+%endif
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE.md README.md
+%attr(755,root,root) %{_bindir}/SvtJpegxsDecApp
+%attr(755,root,root) %{_bindir}/SvtJpegxsEncApp
+%attr(755,root,root) %{_bindir}/SvtJpegxsSampleDecoder
+%attr(755,root,root) %{_bindir}/SvtJpegxsSampleEncoder
+%attr(755,root,root) %{_libdir}/libSvtJpegxs.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libSvtJpegxs.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libSvtJpegxs.so
+%{_includedir}/svt-jpegxs
+%{_pkgconfigdir}/SvtJpegxs.pc
diff --git a/svt-jpeg-xs-no-asm.patch b/svt-jpeg-xs-no-asm.patch
new file mode 100644
index 0000000..cd138ba
--- /dev/null
+++ b/svt-jpeg-xs-no-asm.patch
@@ -0,0 +1,91 @@
+--- SVT-JPEG-XS-0.9.0/CMakeLists.txt.orig 2024-03-27 07:55:04.000000000 +0100
++++ SVT-JPEG-XS-0.9.0/CMakeLists.txt 2025-03-24 19:53:06.965501855 +0100
+@@ -29,6 +29,11 @@ endif()
+
+ include(CheckCSourceCompiles)
+
++option(DISABLE_ASM "Disable x86-64 assembler" OFF)
++
++if(DISABLE_ASM)
++ add_definitions(-DDISABLE_X86_64_ASM=1)
++else()
+ find_program(YASM_EXE yasm)
+ option(ENABLE_NASM "Use nasm if available (Uses yasm by default if found)" OFF)
+ if(YASM_EXE AND NOT CMAKE_ASM_NASM_COMPILER MATCHES "yasm" AND NOT ENABLE_NASM)
+@@ -49,6 +54,8 @@ else()
+ endif()
+ endif()
+ enable_language(ASM_NASM)
++endif()
++# enables SSE/AVX code via gcc intrinsics
+ add_definitions(-DARCH_X86_64=1)
+
+ include(GNUInstallDirs)
+--- SVT-JPEG-XS-0.9.0/Source/Lib/Common/ASM_SSE2/CMakeLists.txt.orig 2024-03-27 07:55:04.000000000 +0100
++++ SVT-JPEG-XS-0.9.0/Source/Lib/Common/ASM_SSE2/CMakeLists.txt 2025-03-24 19:53:57.885225999 +0100
+@@ -23,4 +23,6 @@ set(asm_files
+
+ add_library(COMMON_ASM_SSE2 OBJECT ${all_files})
+
++if(NOT DISABLE_ASM)
+ asm_compile_to_target(COMMON_ASM_SSE2 ${asm_files})
++endif()
+--- SVT-JPEG-XS-0.9.0/Source/Lib/Encoder/ASM_SSE2/CMakeLists.txt.orig 2024-03-27 07:55:04.000000000 +0100
++++ SVT-JPEG-XS-0.9.0/Source/Lib/Encoder/ASM_SSE2/CMakeLists.txt 2025-03-24 19:54:17.411786882 +0100
+@@ -22,4 +22,6 @@ set(asm_files
+
+ add_library(ENCODER_ASM_SSE2 OBJECT ${all_files})
+
++if(NOT DISABLE_ASM)
+ asm_compile_to_target(ENCODER_ASM_SSE2 ${asm_files})
++endif()
+--- SVT-JPEG-XS-0.9.0/Source/Lib/Common/Codec/common_dsp_rtcd.c.orig 2024-03-27 07:55:04.000000000 +0100
++++ SVT-JPEG-XS-0.9.0/Source/Lib/Common/Codec/common_dsp_rtcd.c 2025-03-24 19:55:31.151387400 +0100
+@@ -111,5 +111,7 @@ void setup_common_rtcd_internal(CPU_FLAG
+ (void)flags;
+ #endif
+
++#ifndef DISABLE_X86_64_ASM
+ SET_SSE2(svt_log2_32, log2_32_c, Log2_32_ASM);
++#endif
+ }
+--- SVT-JPEG-XS-0.9.0/Source/Lib/Encoder/ASM_AVX2/RateControl_avx2.c.orig 2025-03-24 19:57:56.130601980 +0100
++++ SVT-JPEG-XS-0.9.0/Source/Lib/Encoder/ASM_AVX2/RateControl_avx2.c 2025-03-24 19:57:59.260585024 +0100
+@@ -101,6 +101,7 @@ uint32_t rate_control_calc_vpred_cost_no
+ return pack_size_gcli_no_sigf;
+ }
+
++#ifndef DISABLE_X86_64_ASM
+ void gc_precinct_stage_scalar_avx2(uint8_t *gcli_data_ptr, uint16_t *coeff_data_ptr_16bit, uint32_t group_size, uint32_t width) {
+ UNUSED(group_size);
+ assert(group_size == GROUP_SIZE);
+@@ -172,6 +173,7 @@ void gc_precinct_stage_scalar_avx2(uint8
+ }
+ }
+ }
++#endif
+
+ void convert_packed_to_planar_rgb_8bit_avx2(const void *in_rgb, void *out_comp1, void *out_comp2, void *out_comp3,
+ uint32_t line_width) {
+--- SVT-JPEG-XS-0.9.0/Source/Lib/Encoder/Codec/encoder_dsp_rtcd.c.orig 2024-03-27 07:55:04.000000000 +0100
++++ SVT-JPEG-XS-0.9.0/Source/Lib/Encoder/Codec/encoder_dsp_rtcd.c 2025-03-24 19:58:41.513689452 +0100
+@@ -128,7 +128,9 @@ void setup_encoder_rtcd_internal(CPU_FLA
+ transform_vertical_loop_lf_hf_hf_line_last_even_avx2,
+ transform_vertical_loop_lf_hf_hf_line_last_even_avx512);
+
++#ifndef DISABLE_X86_64_ASM
+ SET_AVX2(gc_precinct_stage_scalar, gc_precinct_stage_scalar_c, gc_precinct_stage_scalar_avx2);
++#endif
+ SET_SSE41_AVX2(quantization, quantization_c, quantization_sse4_1, quantization_avx2);
+ SET_AVX2_AVX512(linear_input_scaling_line_8bit,
+ linear_input_scaling_line_8bit_c,
+@@ -140,7 +142,9 @@ void setup_encoder_rtcd_internal(CPU_FLA
+ linear_input_scaling_line_16bit_avx512);
+
+ SET_AVX2_AVX512(pack_data_single_group, pack_data_single_group_c, NULL, pack_data_single_group_avx512);
++#ifndef DISABLE_X86_64_ASM
+ SET_SSE2(gc_precinct_stage_scalar_loop, gc_precinct_stage_scalar_loop_c, gc_precinct_stage_scalar_loop_ASM);
++#endif
+ SET_SSE41(gc_precinct_sigflags_max, gc_precinct_sigflags_max_c, gc_precinct_sigflags_max_sse4_1);
+ SET_AVX2_AVX512(rate_control_calc_vpred_cost_nosigf,
+ rate_control_calc_vpred_cost_nosigf_c,
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/svt-jpeg-xs.git/commitdiff/e513adfab3dd11292c6265de879570326b88e8e4
More information about the pld-cvs-commit
mailing list