[x264-devel] Unify 8-bit and 10-bit CLI and libraries

Vittorio Giovara git at videolan.org
Mon Dec 25 20:39:45 CET 2017


x264 | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Jan  6 15:23:38 2017 +0100| [71ed44c7312438fac7c5c5301e45522e57127db4] | committer: Anton Mitrofanov

Unify 8-bit and 10-bit CLI and libraries

Add 'i_bitdepth' to x264_param_t with the corresponding '--output-depth' CLI
option to set the bit depth at runtime.

Drop the 'x264_bit_depth' global variable. Rather than hardcoding it to an
incorrect value, it's preferable to induce a linking failure. If applications
relies on this symbol this will make it more obvious where the problem is.

Add Makefile rules that compiles modules with different bit depths. Assembly
on x86 is prefixed with the 'private_prefix' define, while all other archs
modify their function prefix internally.

Templatize the main C library, x86/x86_64 assembly, ARM assembly, AARCH64
assembly, PowerPC assembly, and MIPS assembly.

The depth and cache CLI filters heavily depend on bit depth size, so they
need to be duplicated for each value. This means having to rename these
filters, and adjust the callers to use the right version.

Unfortunately the threaded input CLI module inherits a common.h dependency
(input/frame -> common/threadpool -> common/frame -> common/common) which
is extremely complicated to address in a sensible way. Instead duplicate
the module and select the appropriate one at run time.

Each bitdepth needs different checkasm compilation rules, so split the main
checkasm target into two executables.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=71ed44c7312438fac7c5c5301e45522e57127db4
---

 Makefile                     |  260 +++--
 common/aarch64/asm.S         |   23 +-
 common/aarch64/bitstream.h   |   32 +
 common/aarch64/cabac-a.S     |    4 +-
 common/aarch64/dct.h         |   27 +
 common/aarch64/deblock.h     |   58 +
 common/aarch64/mc-c.c        |   60 +-
 common/aarch64/mc.h          |    1 +
 common/aarch64/pixel.h       |   55 +
 common/aarch64/predict-c.c   |   23 -
 common/aarch64/predict.h     |   61 +
 common/aarch64/quant-a.S     |    4 +-
 common/aarch64/quant.h       |   22 +
 common/arm/asm.S             |   23 +-
 common/arm/bitstream.h       |   32 +
 common/arm/dct.h             |   17 +
 common/arm/deblock.h         |   58 +
 common/arm/mc-c.c            |   60 +-
 common/arm/mc.h              |    1 +
 common/arm/pixel.h           |   79 ++
 common/arm/predict.h         |   35 +
 common/arm/quant-a.S         |    4 +-
 common/arm/quant.h           |   18 +
 common/base.c                | 1440 ++++++++++++++++++++++++
 common/base.h                |  317 ++++++
 common/bitstream.c           |   28 +-
 common/bitstream.h           |   15 +-
 common/cabac.c               | 1302 +---------------------
 common/cabac.h               |   14 +-
 common/common.c              | 1404 +----------------------
 common/common.h              |  278 +----
 common/cpu.c                 |    4 +-
 common/dct.c                 |   64 --
 common/dct.h                 |    7 +-
 common/deblock.c             |  116 +-
 common/frame.h               |   32 +
 common/macroblock.h          |   20 +
 common/mc.c                  |    3 -
 common/mc.h                  |    9 +-
 common/mips/dct-c.c          |    1 +
 common/mips/dct.h            |   15 +
 common/mips/deblock-c.c      |    1 +
 common/mips/deblock.h        |   52 +
 common/mips/mc.h             |    1 +
 common/mips/pixel.h          |   58 +
 common/mips/predict-c.c      |    1 +
 common/mips/predict.h        |   18 +
 common/mips/quant-c.c        |    1 +
 common/mips/quant.h          |    9 +
 common/opencl.h              |    5 +
 common/osdep.c               |    2 +-
 common/osdep.h               |    3 +
 common/pixel.h               |    5 +
 common/ppc/dct.c             |    1 +
 common/ppc/dct.h             |   16 +
 common/ppc/deblock.c         |    1 +
 common/ppc/deblock.h         |   34 +
 common/ppc/mc.c              |    4 +-
 common/ppc/mc.h              |    1 +
 common/ppc/pixel.c           |    1 +
 common/ppc/pixel.h           |    1 +
 common/ppc/predict.c         |    2 +-
 common/ppc/predict.h         |    2 +
 common/ppc/quant.h           |    7 +
 common/predict.h             |   24 +-
 common/quant.c               |   12 -
 common/quant.h               |    1 +
 common/rectangle.h           |    9 +-
 common/set.h                 |  169 +--
 common/tables.c              | 2536 ++++++++++++++++++++++++++++++++++++++++++
 common/tables.h              |   97 ++
 common/threadpool.h          |    4 +
 common/vlc.c                 |  775 +------------
 common/win32thread.c         |    2 +-
 common/x86/bitstream.h       |   64 ++
 common/x86/cabac-a.asm       |   20 +-
 common/x86/dct.h             |  105 ++
 common/x86/deblock.h         |  146 +++
 common/x86/mc-c.c            |  199 ++++
 common/x86/mc.h              |    1 +
 common/x86/pixel-32.asm      |    3 +
 common/x86/pixel-a.asm       |    2 +-
 common/x86/pixel.h           |  435 +++++++-
 common/x86/predict.h         |  112 ++
 common/x86/quant-a.asm       |    4 +-
 common/x86/quant.h           |  124 ++-
 common/x86/trellis-64.asm    |   18 +-
 common/x86/x86util.asm       |   18 +-
 configure                    |   43 +-
 encoder/analyse.c            |  118 --
 encoder/analyse.h            |   11 +
 encoder/api.c                |  194 ++++
 encoder/cabac.c              |   47 -
 encoder/encoder.c            |    6 +-
 encoder/macroblock.h         |   24 +-
 encoder/me.c                 |    1 +
 encoder/me.h                 |    7 +
 encoder/ratecontrol.h        |   22 +
 encoder/rdo.c                |    5 +
 encoder/set.c                |   25 -
 encoder/set.h                |   16 +
 encoder/slicetype-cl.c       |    2 +
 encoder/slicetype-cl.h       |   44 +
 encoder/slicetype.c          |    9 +-
 example.c                    |    1 +
 filters/filters.c            |    1 +
 filters/video/cache.c        |   10 +-
 filters/video/crop.c         |    1 +
 filters/video/depth.c        |   22 +-
 filters/video/internal.c     |    1 +
 filters/video/internal.h     |    1 +
 filters/video/resize.c       |    1 +
 filters/video/select_every.c |    5 +-
 filters/video/video.c        |   10 +-
 input/avs.c                  |    4 +-
 input/ffms.c                 |    3 +-
 input/input.h                |    3 +-
 input/lavf.c                 |    4 +-
 input/raw.c                  |    1 +
 input/thread.c               |    3 +
 input/timecode.c             |    1 +
 input/y4m.c                  |    1 +
 tools/checkasm-aarch64.S     |    2 +-
 tools/checkasm-arm.S         |    6 +-
 tools/checkasm.c             |    1 -
 x264.c                       |   54 +-
 x264.h                       |   16 +-
 x264cli.h                    |    2 +-
 x264dll.c                    |    2 +-
 129 files changed, 7296 insertions(+), 4566 deletions(-)

Diff:   http://git.videolan.org/gitweb.cgi/x264.git/?a=commitdiff;h=71ed44c7312438fac7c5c5301e45522e57127db4


More information about the x264-devel mailing list