[Cin] x265 10/12 bit patch3 a bit reworked

Andrew Randrianasulu randrianasulu at gmail.com
Sun Aug 2 01:59:34 CEST 2020


I used advice from 

https://stackoverflow.com/questions/106387/is-it-possible-to-detect-32-bit-vs-64-bit-in-a-bash-script

and reworked my patch like this:

--- /dev/null   2020-07-19 09:07:01.788494015 +0300
+++ multilib.sh 2020-08-02 02:34:58.444933214 +0300
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+mkdir -p 8bit 10bit 12bit
+
+
+cd 12bit
+if [ $(uname -m) == 'x86_64' ]; then
+  # 64-bit stuff here
+cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+else
+  # 32-bit stuff here
+cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+fi
+make  -j 1
+
+cd ../10bit
+if [ $(uname -m) == 'x86_64' ]; then
+  # 64-bit stuff here
+cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+else
+  # 32-bit stuff here
+cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+fi
+make -j 1
+
+cd ../8bit
+ln -sf ../10bit/libx265.a libx265_main10.a
+ln -sf ../12bit/libx265.a libx265_main12.a
+cmake ../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DENABLE_SHARED=OFF -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON
+make -j 1
+
+# rename the 8bit library, then combine all three into libx265.a
+mv libx265.a libx265_main.a
+
+uname=`uname`
+if [ "$uname" = "Linux" ]
+then
+
+# On Linux, we use GNU ar to combine the static libraries together
+ar -M <<EOF
+CREATE libx265.a
+ADDLIB libx265_main.a
+ADDLIB libx265_main10.a
+ADDLIB libx265_main12.a
+SAVE
+END
+EOF
+
+else
+
+# Mac/BSD libtool
+libtool -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a 2>/dev/null
+
+fi


hopefully it should enable assembly for 10/12 bit depth on x86_64, and disable it on my i686 - but UNTESTED for now
due to lack of sleep.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265_3.4_patch3.1.patch
Type: text/x-diff
Size: 1595 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20200802/a96ab81e/attachment-0001.bin>


More information about the Cin mailing list