[x265-commits] [x265] cmake: plumb in build support for Main12

Steve Borho steve at borho.org
Thu Jul 2 23:25:38 CEST 2015


details:   http://hg.videolan.org/x265/rev/178bbc24e5ce
branches:  
changeset: 10747:178bbc24e5ce
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 01 13:58:25 2015 -0500
description:
cmake: plumb in build support for Main12

Obviously a lot of work is necessary before Main12 will actually work, but this
lays the ground-work for the third bit-depth build option. To build Main12 you
specify -DHIGH_BIT_DEPTH=ON -DMAIN12=ON to cmake
Subject: [x265] multilib: static functions to avoid link conflict (closes #148)

details:   http://hg.videolan.org/x265/rev/a4d86a9cba97
branches:  
changeset: 10748:a4d86a9cba97
user:      Min Chen <chenm003 at 163.com>
date:      Mon Jun 29 16:17:01 2015 -0700
description:
multilib: static functions to avoid link conflict (closes #148)

MSVC's implementation of anonymous namespaces prevents linking two builds of the
same library together (they are not properly file-local, they are just given a
file-unique namespace which is the same unique namespace in both builds).

Because of this, we must use static declarators
Subject: [x265] level: plumb in support for Main12 and *-Intra profiles

details:   http://hg.videolan.org/x265/rev/86e4612d4c9c
branches:  
changeset: 10749:86e4612d4c9c
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 02 14:48:57 2015 -0500
description:
level: plumb in support for Main12 and *-Intra profiles

the encoder will now signal Main-Intra if MainStillPicture is requested but
multiple frames are intended to be encoded.
Subject: [x265] api: emit a frightening warning when Main12 is used

details:   http://hg.videolan.org/x265/rev/91f7dde17b47
branches:  
changeset: 10750:91f7dde17b47
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 02 14:43:23 2015 -0500
description:
api: emit a frightening warning when Main12 is used
Subject: [x265] cli: suggest actual help command for help

details:   http://hg.videolan.org/x265/rev/6bad3ec16e96
branches:  
changeset: 10751:6bad3ec16e96
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 02 16:03:48 2015 -0500
description:
cli: suggest actual help command for help
Subject: [x265] cli: nit

details:   http://hg.videolan.org/x265/rev/4f319e7a4de3
branches:  
changeset: 10752:4f319e7a4de3
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 02 16:03:51 2015 -0500
description:
cli: nit
Subject: [x265] docs: mention main12 and intra profile considerations

details:   http://hg.videolan.org/x265/rev/a81a57cfa495
branches:  
changeset: 10753:a81a57cfa495
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 02 16:11:46 2015 -0500
description:
docs: mention main12 and intra profile considerations

diffstat:

 build/linux/multilib.sh         |   17 ++-
 build/msys/multilib.sh          |   15 ++-
 build/vc10-x86_64/multilib.bat  |   31 +++++---
 build/vc11-x86_64/multilib.bat  |   31 +++++---
 build/vc12-x86_64/multilib.bat  |   31 +++++---
 build/vc9-x86_64/multilib.bat   |   31 +++++---
 doc/reST/api.rst                |    3 +-
 doc/reST/cli.rst                |   25 +++++-
 source/CMakeLists.txt           |   17 +++-
 source/common/common.h          |    4 +-
 source/common/cudata.cpp        |   34 ++++----
 source/common/dct.cpp           |   65 ++++++++---------
 source/common/intrapred.cpp     |    2 +-
 source/common/ipfilter.cpp      |    4 +-
 source/common/loopfilter.cpp    |   14 +-
 source/common/param.cpp         |   11 +--
 source/common/pixel.cpp         |   31 ++++----
 source/common/scalinglist.cpp   |    6 +-
 source/common/vec/dct-sse3.cpp  |   10 +-
 source/common/vec/dct-sse41.cpp |    4 +-
 source/common/vec/dct-ssse3.cpp |    6 +-
 source/common/version.cpp       |   13 ++-
 source/encoder/api.cpp          |   26 ++++++
 source/encoder/encoder.cpp      |   14 +++
 source/encoder/level.cpp        |  149 ++++++++++++++++++++++++---------------
 source/encoder/motion.cpp       |    2 +-
 source/x265.cpp                 |    4 +-
 source/x265.h                   |   28 ++++++-
 28 files changed, 390 insertions(+), 238 deletions(-)

diffs (truncated from 1527 to 300 lines):

diff -r 76a314f91799 -r a81a57cfa495 build/linux/multilib.sh
--- a/build/linux/multilib.sh	Wed Jul 01 17:05:52 2015 -0700
+++ b/build/linux/multilib.sh	Thu Jul 02 16:11:46 2015 -0500
@@ -1,12 +1,17 @@
 #!/bin/sh
 
-mkdir -p 8bit 10bit
+mkdir -p 8bit 10bit 12bit
 
-cd 10bit
+cd 12bit
+cmake ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+make ${MAKEFLAGS}
+
+cd ../10bit
 cmake ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
-make
-cp libx265.a ../8bit/libx265_main10.a
+make ${MAKEFLAGS}
 
 cd ../8bit
-cmake ../../../source -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB=x265_main10.a -DEXTRA_LINK_FLAGS=-L.
-make
+ln -sf ../10bit/libx265.a libx265_main10.a
+ln -sf ../12bit/libx265.a libx265_main12.a
+cmake ../../../source -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L.
+make ${MAKEFLAGS}
diff -r 76a314f91799 -r a81a57cfa495 build/msys/multilib.sh
--- a/build/msys/multilib.sh	Wed Jul 01 17:05:52 2015 -0700
+++ b/build/msys/multilib.sh	Thu Jul 02 16:11:46 2015 -0500
@@ -1,12 +1,17 @@
 #!/bin/sh
 
-mkdir -p 8bit 10bit
+mkdir -p 8bit 10bit 12bit
 
-cd 10bit
+cd 12bit
+cmake -G "MSYS Makefiles" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+make ${MAKEFLAGS}
+cp libx265.a ../8bit/libx265_main12.a
+
+cd ../10bit
 cmake -G "MSYS Makefiles" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
-make
+make ${MAKEFLAGS}
 cp libx265.a ../8bit/libx265_main10.a
 
 cd ../8bit
-cmake -G "MSYS Makefiles" ../../../source -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB=x265_main10.a -DEXTRA_LINK_FLAGS=-L.
-make
+cmake -G "MSYS Makefiles" ../../../source -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB="x265_main10.a x265_main12.a" -DEXTRA_LINK_FLAGS=-L.
+make ${MAKEFLAGS}
diff -r 76a314f91799 -r a81a57cfa495 build/vc10-x86_64/multilib.bat
--- a/build/vc10-x86_64/multilib.bat	Wed Jul 01 17:05:52 2015 -0700
+++ b/build/vc10-x86_64/multilib.bat	Thu Jul 02 16:11:46 2015 -0500
@@ -4,31 +4,38 @@ if "%VS100COMNTOOLS%" == "" (
   exit 1
 )
 
+call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
+
+ at mkdir 12bit
 @mkdir 10bit
 @mkdir 8bit
 
- at cd 10bit
-if not exist x265.sln (
-  cmake  -G "Visual Studio 10 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+ at cd 12bit
+cmake -G "Visual Studio 10 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  copy/y Release\x265-static.lib ..\8bit\x265-static-main12.lib
 )
+
+ at cd ..\10bit
+cmake -G "Visual Studio 10 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
 if exist x265.sln (
-  call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
   copy/y Release\x265-static.lib ..\8bit\x265-static-main10.lib
 )
- at cd ..
 
- at cd 8bit
+ at cd ..\8bit
 if not exist x265-static-main10.lib (
-  msg "%username%" "10bit build failured"
+  msg "%username%" "10bit build failed"
   exit 1
 )
-if not exist x265.sln (
-  cmake  -G "Visual Studio 10 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB=x265-static-main10.lib -DEXTRA_LINK_FLAGS="/FORCE:MULTIPLE"
+if not exist x265-static-main12.lib (
+  msg "%username%" "12bit build failed"
+  exit 1
 )
+cmake -G "Visual Studio 10 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB="x265-static-main10.lib;x265-static-main12.lib"
 if exist x265.sln (
-  call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
-  copy/y Release\x265.exe ..
 )
- at cd ..
+
+pause
diff -r 76a314f91799 -r a81a57cfa495 build/vc11-x86_64/multilib.bat
--- a/build/vc11-x86_64/multilib.bat	Wed Jul 01 17:05:52 2015 -0700
+++ b/build/vc11-x86_64/multilib.bat	Thu Jul 02 16:11:46 2015 -0500
@@ -4,31 +4,38 @@ if "%VS110COMNTOOLS%" == "" (
   exit 1
 )
 
+call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
+
+ at mkdir 12bit
 @mkdir 10bit
 @mkdir 8bit
 
- at cd 10bit
-if not exist x265.sln (
-  cmake  -G "Visual Studio 11 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+ at cd 12bit
+cmake -G "Visual Studio 11 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  copy/y Release\x265-static.lib ..\8bit\x265-static-main12.lib
 )
+
+ at cd ..\10bit
+cmake -G "Visual Studio 11 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
 if exist x265.sln (
-  call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
   copy/y Release\x265-static.lib ..\8bit\x265-static-main10.lib
 )
- at cd ..
 
- at cd 8bit
+ at cd ..\8bit
 if not exist x265-static-main10.lib (
-  msg "%username%" "10bit build failured"
+  msg "%username%" "10bit build failed"
   exit 1
 )
-if not exist x265.sln (
-  cmake  -G "Visual Studio 11 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB=x265-static-main10.lib -DEXTRA_LINK_FLAGS="/FORCE:MULTIPLE"
+if not exist x265-static-main12.lib (
+  msg "%username%" "12bit build failed"
+  exit 1
 )
+cmake -G "Visual Studio 11 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB="x265-static-main10.lib;x265-static-main12.lib"
 if exist x265.sln (
-  call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
-  copy/y Release\x265.exe ..
 )
- at cd ..
+
+pause
diff -r 76a314f91799 -r a81a57cfa495 build/vc12-x86_64/multilib.bat
--- a/build/vc12-x86_64/multilib.bat	Wed Jul 01 17:05:52 2015 -0700
+++ b/build/vc12-x86_64/multilib.bat	Thu Jul 02 16:11:46 2015 -0500
@@ -4,31 +4,38 @@ if "%VS120COMNTOOLS%" == "" (
   exit 1
 )
 
+call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
+
+ at mkdir 12bit
 @mkdir 10bit
 @mkdir 8bit
 
- at cd 10bit
-if not exist x265.sln (
-  cmake  -G "Visual Studio 12 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+ at cd 12bit
+cmake -G "Visual Studio 12 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  copy/y Release\x265-static.lib ..\8bit\x265-static-main12.lib
 )
+
+ at cd ..\10bit
+cmake -G "Visual Studio 12 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
 if exist x265.sln (
-  call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
   copy/y Release\x265-static.lib ..\8bit\x265-static-main10.lib
 )
- at cd ..
 
- at cd 8bit
+ at cd ..\8bit
 if not exist x265-static-main10.lib (
-  msg "%username%" "10bit build failured"
+  msg "%username%" "10bit build failed"
   exit 1
 )
-if not exist x265.sln (
-  cmake  -G "Visual Studio 12 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB=x265-static-main10.lib -DEXTRA_LINK_FLAGS="/FORCE:MULTIPLE"
+if not exist x265-static-main12.lib (
+  msg "%username%" "12bit build failed"
+  exit 1
 )
+cmake -G "Visual Studio 12 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB="x265-static-main10.lib;x265-static-main12.lib"
 if exist x265.sln (
-  call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
-  copy/y Release\x265.exe ..
 )
- at cd ..
+
+pause
diff -r 76a314f91799 -r a81a57cfa495 build/vc9-x86_64/multilib.bat
--- a/build/vc9-x86_64/multilib.bat	Wed Jul 01 17:05:52 2015 -0700
+++ b/build/vc9-x86_64/multilib.bat	Thu Jul 02 16:11:46 2015 -0500
@@ -4,31 +4,38 @@ if "%VS90COMNTOOLS%" == "" (
   exit 1
 )
 
+call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
+
+ at mkdir 12bit
 @mkdir 10bit
 @mkdir 8bit
 
- at cd 10bit
-if not exist x265.sln (
-  cmake  -G "Visual Studio 9 2008 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+ at cd 12bit
+cmake -G "Visual Studio 9 2008 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  copy/y Release\x265-static.lib ..\8bit\x265-static-main12.lib
 )
+
+ at cd ..\10bit
+cmake -G "Visual Studio 9 2008 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
 if exist x265.sln (
-  call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
   copy/y Release\x265-static.lib ..\8bit\x265-static-main10.lib
 )
- at cd ..
 
- at cd 8bit
+ at cd ..\8bit
 if not exist x265-static-main10.lib (
-  msg "%username%" "main10 build failured"
+  msg "%username%" "10bit build failed"
   exit 1
 )
-if not exist x265.sln (
-  cmake  -G "Visual Studio 9 2008 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB=x265-static-main10.lib -DEXTRA_LINK_FLAGS="/FORCE:MULTIPLE"
+if not exist x265-static-main12.lib (
+  msg "%username%" "12bit build failed"
+  exit 1
 )
+cmake -G "Visual Studio 9 2008 Win64" ../../../source -DHIGH_BIT_DEPTH=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=ON -DEXTRA_LIB="x265-static-main10.lib;x265-static-main12.lib"
 if exist x265.sln (
-  call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
   MSBuild /property:Configuration="Release" x265.sln
-  copy/y Release\x265.exe ..
 )
- at cd ..
+
+pause
diff -r 76a314f91799 -r a81a57cfa495 doc/reST/api.rst
--- a/doc/reST/api.rst	Wed Jul 01 17:05:52 2015 -0700
+++ b/doc/reST/api.rst	Thu Jul 02 16:11:46 2015 -0500
@@ -492,10 +492,11 @@ would prefer to use (8 or 10). If the re
 it matches the bit-depth of the linked library, the linked library will
 be used for encode.  If you request a different bit-depth, the linked
 libx265 will attempt to dynamically bind a shared library with a name
-appropriate for the requested bit-depth:
+appropriate for the requested bit-depth::
 
     8-bit:  libx265_main
     10-bit: libx265_main10
+    12-bit: libx265_main12
 
 Packaging and Distribution
 --------------------------
diff -r 76a314f91799 -r a81a57cfa495 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Wed Jul 01 17:05:52 2015 -0700
+++ b/doc/reST/cli.rst	Thu Jul 02 16:11:46 2015 -0500
@@ -424,12 +424,13 @@ frame counts) are only applicable to the
 
 	**CLI ONLY**
 
-.. option:: --output-depth, -D 8|10
+.. option:: --output-depth, -D 8|10|12
 
 	Bitdepth of output HEVC bitstream, which is also the internal bit
 	depth of the encoder. If the requested bit depth is not the bit
 	depth of the linked libx265, it will attempt to bind libx265_main
-	for an 8bit encoder, or libx265_main10 for a 10bit encoder, with the
+	for an 8bit encoder, libx265_main10 for a 10bit encoder, or


More information about the x265-commits mailing list