Created
December 22, 2022 06:34
-
-
Save meisa233/ea869dd80a5c4258404504920d73bb77 to your computer and use it in GitHub Desktop.
For compiling libx265 with multi depth(bit)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p 8bit 10bit 12bit | |
cd 12bit | |
cmake ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" | |
make -j16 | |
cd ../10bit | |
cmake ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" | |
make -j16 | |
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;-ldl" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off | |
make -j16 | |
# rename the 8bit library, then combine all three into libx265.a | |
mv libx265.a libx265_main.a | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment