From b1dc0c7c09bbf2fd92aa06d91deb6079376f1ffe Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 4 Apr 2025 09:36:29 +0200 Subject: [PATCH 1/2] contrib: update to x264 rev 3214 --- contrib/x264/A00-version-string.patch | 9 ++++----- contrib/x264/module.defs | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/contrib/x264/A00-version-string.patch b/contrib/x264/A00-version-string.patch index 52eb8f863bb3..d96fb5064a33 100644 --- a/contrib/x264/A00-version-string.patch +++ b/contrib/x264/A00-version-string.patch @@ -1,12 +1,11 @@ diff --git a/x264.h b/x264.h -index d685efbd..7f270c4b 100644 +index cc22f05d..2cdfad99 100644 --- a/x264.h +++ b/x264.h @@ -45,7 +45,24 @@ extern "C" { #include "x264_config.h" --#define X264_BUILD 164 +/* + * Define the full version explicitly so that it survives a git --archive. + * @@ -22,9 +21,9 @@ index d685efbd..7f270c4b 100644 +#ifdef X264_POINTVER +#undef X264_POINTVER +#endif -+#define X264_BUILD 164 -+#define X264_VERSION " r3186 585e0199" -+#define X264_POINTVER "0.164.3186 585e0199" + #define X264_BUILD 165 ++#define X264_VERSION " r3214 fe9e4a7f" ++#define X264_POINTVER "0.165.3214 fe9e4a7f" #ifdef _WIN32 # define X264_DLL_IMPORT __declspec(dllimport) diff --git a/contrib/x264/module.defs b/contrib/x264/module.defs index 7d00638bcc6c..41e066d86f75 100644 --- a/contrib/x264/module.defs +++ b/contrib/x264/module.defs @@ -1,8 +1,8 @@ $(eval $(call import.MODULE.defs,X264,x264)) $(eval $(call import.CONTRIB.defs,X264)) -X264.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs/x264-snapshot-20240314-3186.tar.gz -X264.FETCH.sha256 = e7f4311f6f84bcbf6587dcfc9a41c7459f4f0f7d8c0153270749947e41255b60 +X264.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x264-snapshot-20250225-3214.tar.gz +X264.FETCH.sha256 = 194b2b55231c3266448330b3242a1743b0b4e4249169d6587a7194b6c187e1c9 X264.GCC.args.c_std = From d3bf6410ea8dc4e52834c2baf7bebf394df320d4 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 4 Apr 2025 09:36:42 +0200 Subject: [PATCH 2/2] contrib: update to x265 rev 13212 --- ...o-not-set-thread-priority-on-Windows.patch | 4 +- contrib/x265/A02-Apple-Silicon-tuning.patch | 4 +- ...ent-ambient-viewing-environment-sei.patch} | 14 ++-- ...ix-crash-when-SEI-length-is-variable.patch | 29 ------- ...w-matrix-coefficients-from-H.273-v3.patch} | 14 ++-- ...x-Dolby-Vision-RPU-memory-management.patch | 8 +- ...-and-improve-macOS-cross-compilation.patch | 55 +++++++++++++ ...A06-Simplify-macOS-cross-compilation.patch | 26 ------- ...-Fix-shared-link-issue-R_X86_64_PC32.patch | 78 +++++++++++++++++++ .../x265/A08-Enable-scanPosLast-Neon.patch | 36 +++++++++ contrib/x265/A09-Update-version-strings.patch | 24 ++++++ contrib/x265/module.defs | 4 +- contrib/x265_10bit/module.defs | 4 +- contrib/x265_12bit/module.defs | 4 +- contrib/x265_8bit/module.defs | 4 +- 15 files changed, 223 insertions(+), 85 deletions(-) rename contrib/x265/{A04-implement-ambient-viewing-environment-sei.patch => A03-Implement-ambient-viewing-environment-sei.patch} (91%) delete mode 100644 contrib/x265/A03-fix-crash-when-SEI-length-is-variable.patch rename contrib/x265/{A07-add-new-matrix-coefficients-from-H.273-v3.patch => A04-add-new-matrix-coefficients-from-H.273-v3.patch} (91%) create mode 100644 contrib/x265/A06-Fix-and-improve-macOS-cross-compilation.patch delete mode 100644 contrib/x265/A06-Simplify-macOS-cross-compilation.patch create mode 100644 contrib/x265/A07-Revert-Fix-shared-link-issue-R_X86_64_PC32.patch create mode 100644 contrib/x265/A08-Enable-scanPosLast-Neon.patch create mode 100644 contrib/x265/A09-Update-version-strings.patch diff --git a/contrib/x265/A01-Do-not-set-thread-priority-on-Windows.patch b/contrib/x265/A01-Do-not-set-thread-priority-on-Windows.patch index 96c98f081365..305c9a0b43cf 100644 --- a/contrib/x265/A01-Do-not-set-thread-priority-on-Windows.patch +++ b/contrib/x265/A01-Do-not-set-thread-priority-on-Windows.patch @@ -1,7 +1,7 @@ -From f069ed8e59da8d89b771e9f9fe7e7a39ae9d8f5b Mon Sep 17 00:00:00 2001 +From 933faae215b8788afe32714148b64499942e40ba Mon Sep 17 00:00:00 2001 From: Max Dmitrichenko Date: Thu, 22 Aug 2024 07:40:48 +0200 -Subject: [PATCH 1/5] Do not set thread priority on Windows +Subject: [PATCH 1/7] Do not set thread priority on Windows --- source/common/threadpool.cpp | 6 ------ diff --git a/contrib/x265/A02-Apple-Silicon-tuning.patch b/contrib/x265/A02-Apple-Silicon-tuning.patch index 80452b8f462e..7d66984a1f8a 100644 --- a/contrib/x265/A02-Apple-Silicon-tuning.patch +++ b/contrib/x265/A02-Apple-Silicon-tuning.patch @@ -1,7 +1,7 @@ -From a7921f411ee52f1f77cbdfea20d982351483eb7e Mon Sep 17 00:00:00 2001 +From ab704bef1773da3dba45b57cd9392f3118dd3817 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 13 Sep 2024 16:08:25 +0200 -Subject: [PATCH 2/5] Apple Silicon tuning +Subject: [PATCH 2/7] Apple Silicon tuning --- source/common/threadpool.cpp | 8 +++++++- diff --git a/contrib/x265/A04-implement-ambient-viewing-environment-sei.patch b/contrib/x265/A03-Implement-ambient-viewing-environment-sei.patch similarity index 91% rename from contrib/x265/A04-implement-ambient-viewing-environment-sei.patch rename to contrib/x265/A03-Implement-ambient-viewing-environment-sei.patch index 864d1a356882..4290592cfe36 100644 --- a/contrib/x265/A04-implement-ambient-viewing-environment-sei.patch +++ b/contrib/x265/A03-Implement-ambient-viewing-environment-sei.patch @@ -1,7 +1,7 @@ -From 39f1065dc6e6c85780c42123033391233f7104af Mon Sep 17 00:00:00 2001 +From 6e9b7185420f1d4fec64a1b6a671c88400bb9e97 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 22 Nov 2024 10:49:10 +0100 -Subject: [PATCH 4/5] Implement ambient viewing environment sei +Subject: [PATCH 3/7] Implement ambient viewing environment sei Defined in ISO/IEC 23008-2:2017, D.2.39. --- @@ -12,7 +12,7 @@ Defined in ISO/IEC 23008-2:2017, D.2.39. 4 files changed, 43 insertions(+) diff --git a/source/common/param.cpp b/source/common/param.cpp -index a35b06339..92f70b6bf 100755 +index 02cface59..c9b1bfa49 100755 --- a/source/common/param.cpp +++ b/source/common/param.cpp @@ -408,6 +408,7 @@ void x265_param_default(x265_param* param) @@ -23,7 +23,7 @@ index a35b06339..92f70b6bf 100755 param->bEnableFrameDuplication = 0; param->dupThreshold = 70; -@@ -1963,6 +1964,7 @@ int x265_check_params(x265_param* param) +@@ -1965,6 +1966,7 @@ int x265_check_params(x265_param* param) || param->bEmitIDRRecoverySEI || !!param->interlaceMode || param->preferredTransferCharacteristics > 1 @@ -31,7 +31,7 @@ index a35b06339..92f70b6bf 100755 || strlen(param->toneMapFile) || strlen(param->naluFile)); -@@ -2910,6 +2912,10 @@ void x265_copy_params(x265_param* dst, x265_param* src) +@@ -2925,6 +2927,10 @@ void x265_copy_params(x265_param* dst, x265_param* src) dst->bEmitCLL = src->bEmitCLL; dst->maxCLL = src->maxCLL; dst->maxFALL = src->maxFALL; @@ -43,10 +43,10 @@ index a35b06339..92f70b6bf 100755 dst->bEmitVUIHRDInfo = src->bEmitVUIHRDInfo; dst->bEmitVUITimingInfo = src->bEmitVUITimingInfo; diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp -index 6670c814d..752e41a8a 100644 +index cf2e95988..39ca2ada1 100644 --- a/source/encoder/encoder.cpp +++ b/source/encoder/encoder.cpp -@@ -3367,6 +3367,15 @@ void Encoder::getStreamHeaders(NALList& list, Entropy& sbacCoder, Bitstream& bs) +@@ -3375,6 +3375,15 @@ void Encoder::getStreamHeaders(NALList& list, Entropy& sbacCoder, Bitstream& bs) } } diff --git a/contrib/x265/A03-fix-crash-when-SEI-length-is-variable.patch b/contrib/x265/A03-fix-crash-when-SEI-length-is-variable.patch deleted file mode 100644 index 7e80ecd2515d..000000000000 --- a/contrib/x265/A03-fix-crash-when-SEI-length-is-variable.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d0e5dc02fbf21b66abec2a7dd6302a522bcd468b Mon Sep 17 00:00:00 2001 -From: harlanc -Date: Thu, 1 Dec 2022 07:46:13 +0000 -Subject: [PATCH 3/5] 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 2e65cb1a9..6670c814d 100644 ---- a/source/encoder/encoder.cpp -+++ b/source/encoder/encoder.cpp -@@ -1102,6 +1102,12 @@ void Encoder::copyUserSEIMessages(Frame *frame, const x265_picture* pic_in) - 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]; - memcpy(frame->m_userSEI.payloads[i].payload, input.payload, input.payloadSize); --- -2.39.5 (Apple Git-154) - diff --git a/contrib/x265/A07-add-new-matrix-coefficients-from-H.273-v3.patch b/contrib/x265/A04-add-new-matrix-coefficients-from-H.273-v3.patch similarity index 91% rename from contrib/x265/A07-add-new-matrix-coefficients-from-H.273-v3.patch rename to contrib/x265/A04-add-new-matrix-coefficients-from-H.273-v3.patch index 6b46ae1e8eeb..3f75a5c22a87 100644 --- a/contrib/x265/A07-add-new-matrix-coefficients-from-H.273-v3.patch +++ b/contrib/x265/A04-add-new-matrix-coefficients-from-H.273-v3.patch @@ -1,7 +1,7 @@ -From c934fcd99aa7f4f9e9c7e8eb4315a29dd0c13c66 Mon Sep 17 00:00:00 2001 +From e40c6c83a27797c05067c85fcd4eba80a6afcfb1 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Sat, 30 Nov 2024 08:59:51 +0100 -Subject: [PATCH] add new matrix coefficients from H.273 v3 +Subject: [PATCH 4/7] add new matrix coefficients from H.273 v3 --- doc/reST/cli.rst | 3 +++ @@ -25,10 +25,10 @@ index 6bb99f92e..e9bc86d23 100755 .. option:: --chromaloc <0..5> diff --git a/source/common/param.cpp b/source/common/param.cpp -index a35b06339..58806c0c2 100755 +index c9b1bfa49..1fdbb5c61 100755 --- a/source/common/param.cpp +++ b/source/common/param.cpp -@@ -1803,10 +1803,10 @@ int x265_check_params(x265_param* param) +@@ -1806,10 +1806,10 @@ int x265_check_params(x265_param* param) " smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e," " iec61966-2-1, bt2020-10, bt2020-12, smpte-st-2084, smpte-st-428 or arib-std-b67"); CHECK(param->vui.matrixCoeffs < 0 @@ -42,10 +42,10 @@ index a35b06339..58806c0c2 100755 || param->vui.chromaSampleLocTypeTopField > 5, "Chroma Sample Location Type Top Field must be 0-5"); diff --git a/source/x265.h b/source/x265.h -index 7241beda2..bd93a8cc7 100644 +index c9fd99984..2d5aa0479 100644 --- a/source/x265.h +++ b/source/x265.h -@@ -746,7 +746,7 @@ static const char * const x265_transfer_names[] = { "reserved", "bt709", "unknow +@@ -747,7 +747,7 @@ static const char * const x265_transfer_names[] = { "reserved", "bt709", "unknow "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte2084", "smpte428", "arib-std-b67", 0 }; static const char * const x265_colmatrix_names[] = { "gbr", "bt709", "unknown", "", "fcc", "bt470bg", "smpte170m", "smpte240m", @@ -55,7 +55,7 @@ index 7241beda2..bd93a8cc7 100644 "32:11", "80:33", "18:11", "15:11", "64:33", "160:99", "4:3", "3:2", "2:1", 0 }; static const char * const x265_interlace_names[] = { "prog", "tff", "bff", 0 }; diff --git a/source/x265cli.cpp b/source/x265cli.cpp -index 6ca6fb495..74a5f74f1 100755 +index c5fd26a68..47e69c85d 100755 --- a/source/x265cli.cpp +++ b/source/x265cli.cpp @@ -327,7 +327,7 @@ namespace X265_NS { diff --git a/contrib/x265/A05-Fix-Dolby-Vision-RPU-memory-management.patch b/contrib/x265/A05-Fix-Dolby-Vision-RPU-memory-management.patch index dbd7e60b534f..e67e2abd8c69 100644 --- a/contrib/x265/A05-Fix-Dolby-Vision-RPU-memory-management.patch +++ b/contrib/x265/A05-Fix-Dolby-Vision-RPU-memory-management.patch @@ -1,7 +1,7 @@ -From 3a71553731ce49117397ada92ffd858cc550195a Mon Sep 17 00:00:00 2001 +From fbb4a1305e39910de5376bc82f78c1f767736a08 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 22 Nov 2024 10:51:25 +0100 -Subject: [PATCH 5/5] Fix Dolby Vision RPU memory management +Subject: [PATCH 5/7] Fix Dolby Vision RPU memory management --- source/common/frame.cpp | 5 +++++ @@ -25,10 +25,10 @@ index 200717425..1244fdc24 100644 { uint32_t widthInCU = (m_param->sourceWidth + m_param->maxCUSize - 1) >> m_param->maxLog2CUSize; diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp -index 752e41a8a..8117a90b2 100644 +index 39ca2ada1..4461ed8e2 100644 --- a/source/encoder/encoder.cpp +++ b/source/encoder/encoder.cpp -@@ -1681,11 +1681,20 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out) +@@ -1689,11 +1689,20 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out) } copyUserSEIMessages(inFrame[0], inputPic[0]); diff --git a/contrib/x265/A06-Fix-and-improve-macOS-cross-compilation.patch b/contrib/x265/A06-Fix-and-improve-macOS-cross-compilation.patch new file mode 100644 index 000000000000..8cccc06acc67 --- /dev/null +++ b/contrib/x265/A06-Fix-and-improve-macOS-cross-compilation.patch @@ -0,0 +1,55 @@ +From 81e6bd32c1d128a34456774af09c4a28ee6c8f84 Mon Sep 17 00:00:00 2001 +From: Damiano Galassi +Date: Fri, 4 Apr 2025 11:34:52 +0200 +Subject: [PATCH 6/7] Fix and improve macOS cross compilation + +--- + source/CMakeLists.txt | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 4f5b3ed82..8fd13a2d1 100755 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -6,18 +6,12 @@ if(NOT CMAKE_BUILD_TYPE) + FORCE) + endif() + message(STATUS "cmake version ${CMAKE_VERSION}") +-if(POLICY CMP0025) +- cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang +-endif() + if(POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH + endif() +-if(POLICY CMP0054) +- cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted +-endif() + + project (x265) +-cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8 ++cmake_minimum_required (VERSION 3.5) + include(CheckIncludeFiles) + include(CheckFunctionExists) + include(CheckSymbolExists) +@@ -168,7 +162,7 @@ if(APPLE) + add_definitions(-DMACOS=1) + endif() + +-if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") + set(CLANG 1) + endif() + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") +@@ -753,6 +747,9 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY) + elseif(ARM64 OR CROSS_COMPILE_ARM64) + # compile ARM64 arch asm files here + enable_language(ASM) ++ if(APPLE) ++ set(ARM_ARGS ${ARM_ARGS} -arch ${CMAKE_OSX_ARCHITECTURES}) ++ endif() + foreach(ASM ${ARM_ASMS}) + set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/aarch64/${ASM}) + list(APPEND ASM_SRCS ${ASM_SRC}) +-- +2.39.5 (Apple Git-154) + diff --git a/contrib/x265/A06-Simplify-macOS-cross-compilation.patch b/contrib/x265/A06-Simplify-macOS-cross-compilation.patch deleted file mode 100644 index 2221da5b1d2e..000000000000 --- a/contrib/x265/A06-Simplify-macOS-cross-compilation.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4a56a4255cbbc008c1973eb74ab26bfbea204103 Mon Sep 17 00:00:00 2001 -From: Damiano Galassi -Date: Fri, 22 Nov 2024 11:05:34 +0100 -Subject: [PATCH] Simplify macOS cross-compilation - ---- - source/CMakeLists.txt | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt -index 5c6dda9e8..a31cde199 100755 ---- a/source/CMakeLists.txt -+++ b/source/CMakeLists.txt -@@ -736,6 +736,9 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY) - elseif(ARM64 OR CROSS_COMPILE_ARM64) - # compile ARM64 arch asm files here - enable_language(ASM) -+ if(APPLE) -+ set(ARM_ARGS ${ARM_ARGS} -arch ${CMAKE_OSX_ARCHITECTURES}) -+ endif() - foreach(ASM ${ARM_ASMS}) - set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/aarch64/${ASM}) - list(APPEND ASM_SRCS ${ASM_SRC}) --- -2.39.5 (Apple Git-154) - diff --git a/contrib/x265/A07-Revert-Fix-shared-link-issue-R_X86_64_PC32.patch b/contrib/x265/A07-Revert-Fix-shared-link-issue-R_X86_64_PC32.patch new file mode 100644 index 000000000000..e484224a7be8 --- /dev/null +++ b/contrib/x265/A07-Revert-Fix-shared-link-issue-R_X86_64_PC32.patch @@ -0,0 +1,78 @@ +From a660be18018804bf74d80f7770c2ab2455610981 Mon Sep 17 00:00:00 2001 +From: Damiano Galassi +Date: Fri, 4 Apr 2025 09:48:02 +0200 +Subject: [PATCH 7/7] Revert "Fix shared link issue (R_X86_64_PC32)" + +This reverts commit f5e4a648727ea86828df236eb44742fe3e3bf366. +--- + source/common/x86/cpu-a.asm | 7 ------- + source/common/x86/pixel-util8.asm | 18 +----------------- + 2 files changed, 1 insertion(+), 24 deletions(-) + +diff --git a/source/common/x86/cpu-a.asm b/source/common/x86/cpu-a.asm +index 747b921f7..0930e142b 100644 +--- a/source/common/x86/cpu-a.asm ++++ b/source/common/x86/cpu-a.asm +@@ -174,14 +174,7 @@ cglobal safe_intel_cpu_indicator_init + sub rsp, 32 ; shadow space + %endif + and rsp, ~31 +-%if WIN64 +- lea rax, [intel_cpu_indicator_init] +- call rax +-%elif UNIX64 +- call [rel intel_cpu_indicator_init wrt ..plt] +-%else + call intel_cpu_indicator_init +-%endif + leave + %if ARCH_X86_64 + pop r14 +diff --git a/source/common/x86/pixel-util8.asm b/source/common/x86/pixel-util8.asm +index 6ad2852d3..3f8c6be35 100644 +--- a/source/common/x86/pixel-util8.asm ++++ b/source/common/x86/pixel-util8.asm +@@ -8484,13 +8484,7 @@ cglobal costCoeffNxN, 6,11,6 + ; r4 - nonZero + ; r5 - scanFlagMask + ; r6 - sum +- +-%if UNIX64 +- mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc] +-%else + lea r0, [private_prefix %+ _entropyStateBits] +- ;mov r0, private_prefix %+ _entropyStateBits +-%endif + mov r1, r6mp + xor r6d, r6d + xor r4d, r4d +@@ -8670,12 +8664,7 @@ cglobal costCoeffNxN, 6,10,5 + ; r6 - sum + ; {r3,r4} - ctxSig[15-0] + ; r8m - (numNonZero != 0) || (subPosBase == 0) +-%if UNIX64 +- mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc] +-%else + lea r0, [private_prefix %+ _entropyStateBits] +- ;mov r0, private_prefix %+ _entropyStateBits +-%endif + mov r1, r6mp + xor r6d, r6d + xor r8d, r8d +@@ -8914,12 +8903,7 @@ cglobal costC1C2Flag, 4,12,2 + or r11d, 0x100 ; default value setting to 8 + bsf r11d, r11d + +-%if UNIX64 +- mov r5, [private_prefix %+ _entropyStateBits wrt ..gotpc] +-%else +- lea r5, [private_prefix %+ _entropyStateBits] +- ;mov r5, private_prefix %+ _entropyStateBits +-%endif ++ lea r5, [private_prefix %+ _entropyStateBits] + xor r6d, r6d + mov r4d, 0xFFFFFFF9 + +-- +2.39.5 (Apple Git-154) + diff --git a/contrib/x265/A08-Enable-scanPosLast-Neon.patch b/contrib/x265/A08-Enable-scanPosLast-Neon.patch new file mode 100644 index 000000000000..9c74f118bb35 --- /dev/null +++ b/contrib/x265/A08-Enable-scanPosLast-Neon.patch @@ -0,0 +1,36 @@ +>From d6201e6131aec95cc0e72ea99a659685d848c459 Mon Sep 17 00:00:00 2001 +From: George Steed +Date: Fri, 14 Mar 2025 11:48:48 +0000 +Subject: [PATCH] Enable scanPosLast_neon on Apple Silicon and for high + bit-depth + +Currently the Neon implementation of scanPosLast is only used for +standard bit-depth and is not used at all on Apple Silicon platforms. +This patch moves the setup such that it is now used on all platforms and +used on both standard and high bit-depth. +--- + source/common/aarch64/asm-primitives.cpp | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/source/common/aarch64/asm-primitives.cpp b/source/common/aarch64/asm-primitives.cpp +index c1317eb74..7f2f6f09e 100644 +--- a/source/common/aarch64/asm-primitives.cpp ++++ b/source/common/aarch64/asm-primitives.cpp +@@ -736,12 +736,11 @@ void setupNeonPrimitives(EncoderPrimitives &p) + p.cu[BLOCK_4x4].psy_cost_pp = PFX(psyCost_4x4_neon); + + p.weight_pp = PFX(weight_pp_neon); +-#if !defined(__APPLE__) +- p.scanPosLast = PFX(scanPosLast_neon); +-#endif + p.costCoeffNxN = PFX(costCoeffNxN_neon); + #endif + ++ p.scanPosLast = PFX(scanPosLast_neon); ++ + // quant + p.quant = PFX(quant_neon); + p.nquant = PFX(nquant_neon); +-- +2.34.1 + diff --git a/contrib/x265/A09-Update-version-strings.patch b/contrib/x265/A09-Update-version-strings.patch new file mode 100644 index 000000000000..3a7440924ae7 --- /dev/null +++ b/contrib/x265/A09-Update-version-strings.patch @@ -0,0 +1,24 @@ +From 75fae0bf453f0e9fa46abad704a00c1ad3ec3f72 Mon Sep 17 00:00:00 2001 +From: Damiano Galassi +Date: Fri, 4 Apr 2025 11:40:36 +0200 +Subject: [PATCH] Update version strings + +--- + x265Version.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/x265Version.txt b/x265Version.txt +index 8e450033e..9daa622ff 100644 +--- a/x265Version.txt ++++ b/x265Version.txt +@@ -1,4 +1,4 @@ + #Attribute: Values +-repositorychangeset: 6318f22 +-releasetagdistance: 1 +-releasetag: 4.0 ++repositorychangeset: b354c00 ++releasetagdistance: 79 ++releasetag: 4.1 +-- +2.39.5 (Apple Git-154) + diff --git a/contrib/x265/module.defs b/contrib/x265/module.defs index 99d122f74377..44ccca66528c 100644 --- a/contrib/x265/module.defs +++ b/contrib/x265/module.defs @@ -2,9 +2,9 @@ __deps__ := X265_8 X265_10 X265_12 $(eval $(call import.MODULE.defs,X265,x265,$(__deps__))) $(eval $(call import.CONTRIB.defs,X265)) -X265.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz +X265.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250224-13212.tar.gz #X265.FETCH.url += https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.1.tar.gz -X265.FETCH.sha256 = ef05940bdbf8e2f24c93d799ae8c5d19f43cd235d01c17fa5acf3fa77b48c032 +X265.FETCH.sha256 = 110d31d4e133c32138dbbf9bcdc4104b8b14a0d6bab2b74a51168eafd927d7d1 # Silence "warning: overriding recipe for target" messages X265.FETCH.target = diff --git a/contrib/x265_10bit/module.defs b/contrib/x265_10bit/module.defs index f4d646e0432d..68c881da0571 100644 --- a/contrib/x265_10bit/module.defs +++ b/contrib/x265_10bit/module.defs @@ -2,9 +2,9 @@ __deps__ := X265_8 $(eval $(call import.MODULE.defs,X265_10,x265_10,$(__deps__),x265)) $(eval $(call import.CONTRIB.defs,X265_10)) -X265_10.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz +X265_10.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250224-13212.tar.gz #X265_10.FETCH.url += https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.1.tar.gz -X265_10.FETCH.sha256 = ef05940bdbf8e2f24c93d799ae8c5d19f43cd235d01c17fa5acf3fa77b48c032 +X265_10.FETCH.sha256 = 110d31d4e133c32138dbbf9bcdc4104b8b14a0d6bab2b74a51168eafd927d7d1 # Silence "warning: overriding recipe for target" messages X265_10.FETCH.target = diff --git a/contrib/x265_12bit/module.defs b/contrib/x265_12bit/module.defs index 792bf668cbe4..a072605bca86 100644 --- a/contrib/x265_12bit/module.defs +++ b/contrib/x265_12bit/module.defs @@ -2,9 +2,9 @@ __deps__ := X265_8 $(eval $(call import.MODULE.defs,X265_12,x265_12,$(__deps__),x265)) $(eval $(call import.CONTRIB.defs,X265_12)) -X265_12.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz +X265_12.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250224-13212.tar.gz #X265_12.FETCH.url += https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.1.tar.gz -X265_12.FETCH.sha256 = ef05940bdbf8e2f24c93d799ae8c5d19f43cd235d01c17fa5acf3fa77b48c032 +X265_12.FETCH.sha256 = 110d31d4e133c32138dbbf9bcdc4104b8b14a0d6bab2b74a51168eafd927d7d1 # Silence "warning: overriding recipe for target" messages X265_12.FETCH.target = diff --git a/contrib/x265_8bit/module.defs b/contrib/x265_8bit/module.defs index c18c2b3eedb0..3715b968e910 100644 --- a/contrib/x265_8bit/module.defs +++ b/contrib/x265_8bit/module.defs @@ -2,9 +2,9 @@ __deps__ := $(eval $(call import.MODULE.defs,X265_8,x265_8,$(__deps__),x265)) $(eval $(call import.CONTRIB.defs,X265_8)) -X265_8.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz +X265_8.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250224-13212.tar.gz #X265_8.FETCH.url += https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.1.tar.gz -X265_8.FETCH.sha256 = ef05940bdbf8e2f24c93d799ae8c5d19f43cd235d01c17fa5acf3fa77b48c032 +X265_8.FETCH.sha256 = 110d31d4e133c32138dbbf9bcdc4104b8b14a0d6bab2b74a51168eafd927d7d1 X265_8.build_dir = 8bit X265_8.CONFIGURE.exe = cmake