From 4f8f9540a5fd18a64b08bec284dca3c120af9195 Mon Sep 17 00:00:00 2001 From: tigro Date: Wed, 25 Dec 2024 21:51:35 +0300 Subject: [PATCH] import x265-3.6-3.el10 --- .gitignore | 2 +- .x265.metadata | 1 + .../x265-high-bit-depth-soname.patch | 0 x265-pic.patch => SOURCES/x265-pic.patch | 0 .../x265-pkgconfig_path_fix.patch | 0 SOURCES/x265-sei-length-crash-fix.patch | 29 +++++++++ x265.spec => SPECS/x265.spec | 38 ++++++++--- sources | 1 - x265-arm-cflags.patch | 63 ------------------- x265-detect_cpu_armhfp.patch | 15 ----- 10 files changed, 59 insertions(+), 90 deletions(-) create mode 100644 .x265.metadata rename x265-high-bit-depth-soname.patch => SOURCES/x265-high-bit-depth-soname.patch (100%) rename x265-pic.patch => SOURCES/x265-pic.patch (100%) rename x265-pkgconfig_path_fix.patch => SOURCES/x265-pkgconfig_path_fix.patch (100%) create mode 100644 SOURCES/x265-sei-length-crash-fix.patch rename x265.spec => SPECS/x265.spec (89%) delete mode 100644 sources delete mode 100644 x265-arm-cflags.patch delete mode 100644 x265-detect_cpu_armhfp.patch diff --git a/.gitignore b/.gitignore index 084d5b8..a441cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -x265*.tar.gz +SOURCES/x265_3.6.tar.gz diff --git a/.x265.metadata b/.x265.metadata new file mode 100644 index 0000000..caec914 --- /dev/null +++ b/.x265.metadata @@ -0,0 +1 @@ +51fc4592a9f1e340d87a51233361cc5a3ffd739d SOURCES/x265_3.6.tar.gz diff --git a/x265-high-bit-depth-soname.patch b/SOURCES/x265-high-bit-depth-soname.patch similarity index 100% rename from x265-high-bit-depth-soname.patch rename to SOURCES/x265-high-bit-depth-soname.patch diff --git a/x265-pic.patch b/SOURCES/x265-pic.patch similarity index 100% rename from x265-pic.patch rename to SOURCES/x265-pic.patch diff --git a/x265-pkgconfig_path_fix.patch b/SOURCES/x265-pkgconfig_path_fix.patch similarity index 100% rename from x265-pkgconfig_path_fix.patch rename to SOURCES/x265-pkgconfig_path_fix.patch diff --git a/SOURCES/x265-sei-length-crash-fix.patch b/SOURCES/x265-sei-length-crash-fix.patch new file mode 100644 index 0000000..87c6d49 --- /dev/null +++ b/SOURCES/x265-sei-length-crash-fix.patch @@ -0,0 +1,29 @@ +From 8454caf458c5f5d20cce711ff8ea8de55ec1ae50 Mon Sep 17 00:00:00 2001 +From: harlanc +Date: Thu, 1 Dec 2022 07:46:13 +0000 +Subject: [PATCH] fix crash when SEI length is variable + +--- + source/encoder/encoder.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp +index 0fea6553c..5a3fcafc7 100644 +--- a/source/encoder/encoder.cpp ++++ b/source/encoder/encoder.cpp +@@ -1103,6 +1103,12 @@ void Encoder::copyUserSEIMessages(Frame *frame, const x265_picture* pic_in) + input = seiMsg; + else + input = pic_in->userSEI.payloads[i]; ++ ++ if (frame->m_userSEI.payloads[i].payload && (frame->m_userSEI.payloads[i].payloadSize < input.payloadSize)) ++ { ++ delete[] frame->m_userSEI.payloads[i].payload; ++ frame->m_userSEI.payloads[i].payload = NULL; ++ } + + if (!frame->m_userSEI.payloads[i].payload) + frame->m_userSEI.payloads[i].payload = new uint8_t[input.payloadSize]; +-- +2.45.0 + diff --git a/x265.spec b/SPECS/x265.spec similarity index 89% rename from x265.spec rename to SPECS/x265.spec index 894f562..57f8937 100644 --- a/x265.spec +++ b/SPECS/x265.spec @@ -1,12 +1,12 @@ # Use old cmake macro %global __cmake_in_source_build 1 -%global _so_version 199 +%global _so_version 209 Summary: H.265/HEVC encoder Name: x265 -Version: 3.5 -Release: 5%{?dist} +Version: 3.6 +Release: 3%{?dist} URL: http://x265.org/ # source/Lib/TLibCommon - BSD # source/Lib/TLibEncoder - BSD @@ -17,13 +17,13 @@ Source0: https://bitbucket.org/multicoreware/%{name}_git/downloads/%{name}_%{ # fix building as PIC Patch0: x265-pic.patch Patch1: x265-high-bit-depth-soname.patch -Patch2: x265-detect_cpu_armhfp.patch -Patch3: x265-arm-cflags.patch -Patch4: x265-pkgconfig_path_fix.patch +Patch2: x265-pkgconfig_path_fix.patch +# https://bitbucket.org/multicoreware/x265_git/pull-requests/10 +Patch3: https://bitbucket.org/harlancc/x265_git/commits/8454caf458c5f5d20cce711ff8ea8de55ec1ae50/raw#/x265-sei-length-crash-fix.patch BuildRequires: gcc-c++ BuildRequires: git -BuildRequires: cmake3 +BuildRequires: cmake %{?el7:BuildRequires: epel-rpm-macros} BuildRequires: nasm BuildRequires: ninja-build @@ -72,7 +72,7 @@ This package contains the shared library development files. # 10bit: libx265_main10.so build() { -%cmake3 -Wno-dev -G "Ninja" \ +%cmake -Wno-dev -G "Ninja" \ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \ -DCMAKE_SKIP_RPATH:BOOL=YES \ -DENABLE_PIC:BOOL=ON \ @@ -82,7 +82,7 @@ build() { -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy \ $* \ ../source -%cmake3_build +%cmake_build } # High depth 10/12 bit libraries are supported only on 64 bit. They require @@ -113,7 +113,7 @@ popd for i in 8 10 12; do if [ -d ${i}bit ]; then pushd ${i}bit - %cmake3_install + %cmake_install # Remove unversioned library, should not be linked to rm -f %{buildroot}%{_libdir}/libx265_main${i}.so popd @@ -154,6 +154,24 @@ done %{_libdir}/pkgconfig/x265.pc %changelog +* Wed Dec 25 2024 Arkady L. Shane - 3.6-3 +- Rebuilt for MSVSphere 10 + +* Fri Aug 02 2024 RPM Fusion Release Engineering - 3.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu May 16 2024 Dominik Mierzejewski - 3.6-2 +- Backport a fix for crashes when encoding with variable length SEI + +* Sat Apr 06 2024 Leigh Scott - 3.6-1 +- Update to 3.6 + +* Sun Feb 04 2024 RPM Fusion Release Engineering - 3.5-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Aug 02 2023 RPM Fusion Release Engineering - 3.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Thu Dec 29 2022 Nicolas Chauvet - 3.5-5 - Enable ENABLE_HDR10_PLUS everywhere rfbz#6454 diff --git a/sources b/sources deleted file mode 100644 index af884a1..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (x265_3.5.tar.gz) = 230e683239c3e262096ba96246c6f67229a1625d163f86647a411733bb1cf349685858aee3017bce818bb6992448d0abaa9241615a5b620561ce47ecb164f997 diff --git a/x265-arm-cflags.patch b/x265-arm-cflags.patch deleted file mode 100644 index 8cd5c86..0000000 --- a/x265-arm-cflags.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- x265_3.4/source/CMakeLists.txt.cflags -+++ x265_3.4/source/CMakeLists.txt -@@ -238,28 +238,6 @@ - endif() - endif() - endif() -- if(ARM AND CROSS_COMPILE_ARM) -- if(ARM64) -- set(ARM_ARGS -fPIC) -- else() -- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) -- endif() -- message(STATUS "cross compile arm") -- elseif(ARM) -- if(ARM64) -- set(ARM_ARGS -fPIC) -- add_definitions(-DHAVE_NEON) -- else() -- find_package(Neon) -- if(CPU_HAS_NEON) -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) -- add_definitions(-DHAVE_NEON) -- else() -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) -- endif() -- endif() -- endif() -- add_definitions(${ARM_ARGS}) - if(FPROFILE_GENERATE) - if(INTEL_CXX) - add_definitions(-prof-gen -prof-dir="${CMAKE_CURRENT_BINARY_DIR}") -@@ -546,7 +524,7 @@ - add_custom_command( - OUTPUT ${ASM}.${SUFFIX} - COMMAND ${CMAKE_CXX_COMPILER} -- ARGS ${ARM_ARGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX} -+ ARGS ${CFLAGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX} - DEPENDS ${ASM_SRC}) - endforeach() - elseif(X86) - ---- x265_3.4/source/dynamicHDR10/CMakeLists.txt.cflags -+++ x265_3.4/source/dynamicHDR10/CMakeLists.txt -@@ -42,18 +42,6 @@ - endif() - endif() - endif() -- if(ARM AND CROSS_COMPILE_ARM) -- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) -- elseif(ARM) -- find_package(Neon) -- if(CPU_HAS_NEON) -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) -- add_definitions(-DHAVE_NEON) -- else() -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) -- endif() -- endif() -- add_definitions(${ARM_ARGS}) - if(FPROFILE_GENERATE) - if(INTEL_CXX) - add_definitions(-prof-gen -prof-dir="${CMAKE_CURRENT_BINARY_DIR}") - diff --git a/x265-detect_cpu_armhfp.patch b/x265-detect_cpu_armhfp.patch deleted file mode 100644 index 797ad04..0000000 --- a/x265-detect_cpu_armhfp.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- x265_v2.6/source/test/testharness.h.orig 2017-12-30 22:27:49.827620181 +0000 -+++ x265_v2.6/source/test/testharness.h 2017-12-30 22:30:53.239500941 +0000 -@@ -70,9 +70,10 @@ protected: - #include - #elif (!defined(__APPLE__) && (defined (__GNUC__) && (defined(__x86_64__) || defined(__i386__)))) - #include --#elif ( !defined(__APPLE__) && defined (__GNUC__) && defined(__ARM_NEON__)) --#include - #elif defined(__GNUC__) && (!defined(__clang__) || __clang_major__ < 4) -+#if ( !defined(__APPLE__) && defined(__ARM_NEON__)) -+#include -+#endif - /* fallback for older GCC/MinGW */ - static inline uint32_t __rdtsc(void) - {