@@ -1636,10 +1636,7 @@ build_dav1d() {
1636
1636
1637
1637
build_libx265 () {
1638
1638
# the only one that uses mercurial, so there's some extra initial junk in this method... XXX needs some cleanup :|
1639
- local checkout_dir=x265
1640
- if [[ $high_bitdepth == " y" ]]; then
1641
- checkout_dir=x265_high_bitdepth_10
1642
- fi
1639
+ local checkout_dir=x265_all_bitdepth
1643
1640
1644
1641
if [[ $prefer_stable = " n" ]]; then
1645
1642
local old_hg_version
@@ -1660,12 +1657,11 @@ build_libx265() {
1660
1657
cd $checkout_dir
1661
1658
old_hg_version=none-yet
1662
1659
fi
1663
- cd source
1664
1660
1665
1661
local new_hg_version=` hg --debug id -i`
1666
1662
if [[ " $old_hg_version " != " $new_hg_version " ]]; then
1667
1663
echo " got upstream hg changes, forcing rebuild...x265"
1668
- rm -f already*
1664
+ rm -f 8bit/already * 10bit/already * 12bit/ already*
1669
1665
else
1670
1666
echo " still at hg $new_hg_version x265"
1671
1667
fi
@@ -1689,30 +1685,53 @@ build_libx265() {
1689
1685
cd $checkout_dir
1690
1686
old_hg_version=none-yet
1691
1687
fi
1692
- cd source
1693
1688
1694
1689
local new_hg_version=` hg --debug id -i`
1695
1690
if [[ " $old_hg_version " != " $new_hg_version " ]]; then
1696
1691
echo " got upstream hg changes, forcing rebuild...x265"
1697
- rm -f already*
1692
+ rm -f 8bit/already * 10bit/already * 12bit/ already*
1698
1693
else
1699
1694
echo " still at hg $new_hg_version x265"
1700
1695
fi
1701
- fi # dont with prefer_stable = [y|n]
1696
+ fi # done with prefer_stable = [y|n]
1697
+
1702
1698
1703
- local cmake_params=" -DENABLE_SHARED=0 -DENABLE_CLI=1 " # build x265.exe
1699
+ local cmake_params=" -DENABLE_SHARED=0" # build x265.exe
1704
1700
if [ " $bits_target " = " 32" ]; then
1705
1701
cmake_params+=" -DWINXP_SUPPORT=1" # enable windows xp/vista compatibility in x86 build
1706
1702
cmake_params=" $cmake_params -DENABLE_ASSEMBLY=OFF" # apparently required or build fails
1707
1703
fi
1708
- if [[ $high_bitdepth == " y" ]]; then
1709
- cmake_params+=" -DHIGH_BIT_DEPTH=1" # Enable 10 bits (main10) per pixels profiles. XXX have an option for 12 here too??? gah...
1710
- fi
1711
1704
1712
- do_cmake " $cmake_params "
1705
+ mkdir -p 8bit 10bit 12bit
1706
+
1707
+ # Build 12bit (main12)
1708
+ cd 12bit
1709
+ local cmake_12bit_params=" $cmake_params -DENABLE_CLI=0 -DHIGH_BIT_DEPTH=1 -DMAIN12=1 -DEXPORT_C_API=0"
1710
+ do_cmake_from_build_dir ../source " $cmake_12bit_params "
1713
1711
do_make
1714
- echo force reinstall in case bit depth changed at all :|
1715
- rm already_ran_make_install*
1712
+ cp libx265.a ../8bit/libx265_main12.a
1713
+
1714
+ # Build 10bit (main10)
1715
+ cd ../10bit
1716
+ local cmake_10bit_params=" $cmake_params -DENABLE_CLI=0 -DHIGH_BIT_DEPTH=1 -DENABLE_HDR10_PLUS=1 -DEXPORT_C_API=0"
1717
+ do_cmake_from_build_dir ../source " $cmake_10bit_params "
1718
+ do_make
1719
+ cp libx265.a ../8bit/libx265_main10.a
1720
+
1721
+ # Build 8 bit (main) with linked 10 and 12 bit then install
1722
+ cd ../8bit
1723
+ cmake_params=" $cmake_params -DENABLE_CLI=1 -DEXTRA_LINK_FLAGS=-L -DLINKED_10BIT=1 -DLINKED_12BIT=1 -DEXTRA_LIB='$( pwd) /libx265_main10.a;$( pwd) /libx265_main12.a'"
1724
+ do_cmake_from_build_dir ../source " $cmake_params "
1725
+ do_make
1726
+ mv libx265.a libx265_main.a
1727
+ ${cross_prefix} ar -M << EOF
1728
+ CREATE libx265.a
1729
+ ADDLIB libx265_main.a
1730
+ ADDLIB libx265_main10.a
1731
+ ADDLIB libx265_main12.a
1732
+ SAVE
1733
+ END
1734
+ EOF
1716
1735
do_make_install
1717
1736
cd ../..
1718
1737
}
0 commit comments