pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/x265 Fix x265 on non-x86 architectures. Pat...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/591efc79decd
branches:  trunk
changeset: 326658:591efc79decd
user:      jklos <jklos%pkgsrc.org@localhost>
date:      Tue Dec 11 17:55:56 2018 +0000

description:
Fix x265 on non-x86 architectures. Patches are from maya%netbsd.org@localhost. Thanks!

diffstat:

 multimedia/x265/distinfo                       |   5 ++++-
 multimedia/x265/patches/patch-common_cpu.cpp   |  26 ++++++++++++++++++++++++++
 multimedia/x265/patches/patch-common_cpu.h     |  15 +++++++++++++++
 multimedia/x265/patches/patch-common_quant.cpp |  23 +++++++++++++++++++++++
 4 files changed, 68 insertions(+), 1 deletions(-)

diffs (92 lines):

diff -r 608ff7362a3c -r 591efc79decd multimedia/x265/distinfo
--- a/multimedia/x265/distinfo  Tue Dec 11 17:49:47 2018 +0000
+++ b/multimedia/x265/distinfo  Tue Dec 11 17:55:56 2018 +0000
@@ -1,8 +1,11 @@
-$NetBSD: distinfo,v 1.26 2018/10/06 12:12:48 adam Exp $
+$NetBSD: distinfo,v 1.27 2018/12/11 17:55:56 jklos Exp $
 
 SHA1 (x265_2.9.tar.gz) = 3c005b4ab409c6f996b36ad88d780ff85fbc9abf
 RMD160 (x265_2.9.tar.gz) = ea6772ec426c141eb1756cdf6bb2def3d6319f47
 SHA512 (x265_2.9.tar.gz) = 270818c7fd84947fde371e32bef225c1880cfb0bcd95378d95b51f50577a134d7cd585fcdfa43b103a24d76c5ad826b09509a07eb9e208e8f2b56f2f77365cf3
 Size (x265_2.9.tar.gz) = 1385848 bytes
 SHA1 (patch-CMakeLists.txt) = fbf4d08133a48b342a060f1b45bab0253455a1b1
+SHA1 (patch-common_cpu.cpp) = 78ca000d57dba65bd0bf6d6c4d3bd878ae3387e7
+SHA1 (patch-common_cpu.h) = 33e3bb9bc9cb60735aa09efa185c474ebd3e6af5
+SHA1 (patch-common_quant.cpp) = 8cbaf6f00c1799ffaa503ffa372f05b76e97ae3b
 SHA1 (patch-encoder_encoder.cpp) = 907db18c8e9afd51684ed886da70c23ac3d3652a
diff -r 608ff7362a3c -r 591efc79decd multimedia/x265/patches/patch-common_cpu.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x265/patches/patch-common_cpu.cpp      Tue Dec 11 17:55:56 2018 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-common_cpu.cpp,v 1.1 2018/12/11 17:55:56 jklos Exp $
+
+Retire detect512, make enable512 a global.
+
+--- common/cpu.cpp.orig        2018-10-05 12:14:40.000000000 +0000
++++ common/cpu.cpp
+@@ -58,7 +58,7 @@ static void sigill_handler(int sig)
+ #endif // if X265_ARCH_ARM
+ 
+ namespace X265_NS {
+-static bool enable512 = false;
++bool enable512 = false;
+ const cpu_name_t cpu_names[] =
+ {
+ #if X265_ARCH_X86
+@@ -123,10 +123,6 @@ uint64_t PFX(cpu_xgetbv)(int xcr);
+ #pragma warning(disable: 4309) // truncation of constant value
+ #endif
+ 
+-bool detect512()
+-{
+-    return(enable512);
+-}
+ uint32_t cpu_detect(bool benableavx512 )
+ {
+ 
diff -r 608ff7362a3c -r 591efc79decd multimedia/x265/patches/patch-common_cpu.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x265/patches/patch-common_cpu.h        Tue Dec 11 17:55:56 2018 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_cpu.h,v 1.1 2018/12/11 17:55:56 jklos Exp $
+
+Retire detect512, use enable512 as a global
+
+--- common/cpu.h.orig  2018-10-05 12:14:40.000000000 +0000
++++ common/cpu.h
+@@ -50,7 +50,7 @@ extern "C" void PFX(safe_intel_cpu_indic
+ 
+ namespace X265_NS {
+ uint32_t cpu_detect(bool);
+-bool detect512();
++extern bool enable512;
+ 
+ struct cpu_name_t
+ {
diff -r 608ff7362a3c -r 591efc79decd multimedia/x265/patches/patch-common_quant.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x265/patches/patch-common_quant.cpp    Tue Dec 11 17:55:56 2018 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-common_quant.cpp,v 1.1 2018/12/11 17:55:56 jklos Exp $
+
+Use enable512 as a global, not through detect512
+
+--- common/quant.cpp.orig      2018-10-05 12:14:40.000000000 +0000
++++ common/quant.cpp
+@@ -723,7 +723,6 @@ uint32_t Quant::rdoQuant(const CUData& c
+             X265_CHECK(coeffNum[cgScanPos] == 0, "count of coeff failure\n");
+             uint32_t scanPosBase = (cgScanPos << MLS_CG_SIZE);
+             uint32_t blkPos      = codeParams.scan[scanPosBase];
+-            bool enable512 = detect512();
+             if (enable512)
+                 primitives.cu[log2TrSize - 2].psyRdoQuant(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
+             else
+@@ -805,8 +804,6 @@ uint32_t Quant::rdoQuant(const CUData& c
+             uint32_t blkPos = codeParams.scan[scanPosBase];
+             if (usePsyMask)
+             {
+-                bool enable512 = detect512();
+-
+                 if (enable512)
+                     primitives.cu[log2TrSize - 2].psyRdoQuant(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
+                 else



Home | Main Index | Thread Index | Old Index