Commit Graph

202 Commits

Author SHA1 Message Date
Loongson Technology Corporation Limited d7d283f634 loongarch: Improve the performance of deblock series functions.
Performance has improved from 4.76fps to 4.92fps.
Tested with following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
deblock_luma[0]         79               39
deblock_luma[1]         91               18
deblock_luma_intra[0]   63               44
deblock_luma_intra[1]   71               18
deblock_strength        104              33

Signed-off-by: Hao Chen <chenhao@loongson.cn>
2023-10-10 09:04:49 +08:00
Loongson Technology Corporation Limited 1ecc51ee97 loongarch: Init LSX/LASX support
LSX/LASX is the LOONGARCH 128-bit/256-bit SIMD Architecture.

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Xiwei Gu <guxiwei-hf@loongson.cn>
2023-10-10 09:00:09 +08:00
Sergei Trofimovich e067ab0b53 Makefile: Add missing dependency of '.depend' on 'oclobj.h'
Without the change parallel build occasionally fails as:

    $ make --shuffle
    ...
    gcc ... -c common/opencl.c -o common/opencl-8.o ...
    common/opencl.c:116:10: fatal error: common/oclobj.h: No such file or directory
      116 | #include "common/oclobj.h"
          |          ^~~~~~~~~~~~~~~~~

Best reproducible with `make --shuffle` mode:
   https://savannah.gnu.org/bugs/index.php?62100

This happens because `common/oclobj.h` is an autogenerated file.
Normally `.depend` would contain this autogenerated dependency.
But nothing forces `common/oclobj.h` to be generated.

The change moves dependency of $(GENERATED) from final binaries
to `.depend` itself:

    .depend: $(GENERATED)
2022-09-19 22:31:01 +01:00
Claes Nästén d9a19f0dc7 Makefile: Do not create multiple directories in one go
/usr/ucb/bin/install on Solaris does not support creating multiple
directories in one go, issue multiple install commands instead.
2021-12-07 15:51:14 +01:00
Henrik Gramner 35417dcd65 Makefile: Drop the -T argument to install
It's not required, and BSD doesn't support it.
2021-01-26 02:21:16 +01:00
Henrik Gramner 7ab4c928ef Add support for long filenames on Windows 10 2020-09-27 23:32:10 +02:00
Anton Mitrofanov 375cc58822 configure: Add options for bash-completion install 2020-07-14 15:35:11 +02:00
Henrik Gramner a41d4e2944 cli: Install bash autocomplete during 'make install' 2020-07-02 19:20:21 +02:00
Anton Mitrofanov 0e227c47ce Fix compilation of fprofiled shared build 2019-11-01 20:49:52 +03:00
Anton Mitrofanov 76c5afc25b Fix MSVS build with ./configure --enable-shared --system-libx264 2019-07-17 20:19:23 +03:00
Anton Mitrofanov a615f027ed Mark explicitly DSO public API symbols and hide all other by -fvisibility=hidden
Removes need for -Bsymbolic during linking.
2019-07-17 20:19:23 +03:00
Henrik Gramner 74c051f2c4 cli: Bash autocomplete support
Allows for automatic command line completion for both options and values.

Options such as --input-csp and --input-fmt will dynamically retrieve
supported values from libavformat when compiled with lavf support.

Execute 'source tools/bash-autocomplete.sh' in bash to enable.
2019-03-06 22:45:52 +03:00
Diego Biurrun 814e61e88c Makefile improvements
* Coalesce some install recipe lines

 * Remove empty addition of GPLed filters

 * Install libdir in recipes that directly require it

 * Coalesce etags/TAGS rules

 * Simplify fprofiled rule
2018-08-06 23:24:12 +02:00
Vittorio Giovara 71ed44c731 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.
2017-12-24 23:47:24 +03:00
Vittorio Giovara a2d2621cc5 Recursively delete conftest files
On OS X, one of the conftest files might be a directory named `conftest.dSYM`.
2017-05-19 16:12:15 +02:00
Martin Storsjö 35d32d09e1 checkasm: arm: Check register clobbering
Cast the function pointer to a different type signature, to
be able to use uint64_t as return type (instead of intptr_t) for
those calls that require it.

Use two separate functions, depending on whether neon is available.
2015-10-11 18:44:54 +02:00
Martin Storsjö 59683a97b5 checkasm: aarch64: Check register clobbering
Disable this on iOS, since it has got a slightly different ABI
for vararg parameters.
2015-10-11 18:44:54 +02:00
Martin Storsjö ceee976bde arm: Add x264_nal_escape_neon
checkasm timing      Cortex-A7      A8      A9
nal_escape_c                852758  879566  655497
nal_escape_neon             376831  450678  371673
2015-10-11 18:44:54 +02:00
Rishikesh More 145f3a6275 mips: MSA quant optimizations
Signed-off-by: Rishikesh More <rishikesh.more@imgtec.com>
2015-07-25 22:52:55 +02:00
Rishikesh More 16395d2b6f mips: MSA predict optimizations
Signed-off-by: Rishikesh More <rishikesh.more@imgtec.com>
2015-07-25 22:52:55 +02:00
Rishikesh More 204e1a6023 mips: MSA pixel optimizations
Signed-off-by: Rishikesh More <rishikesh.more@imgtec.com>
2015-07-25 22:52:55 +02:00
Rishikesh More 3ce6430eb1 mips: MSA deblock optimizations
Signed-off-by: Rishikesh More <rishikesh.more@imgtec.com>
2015-07-25 22:52:55 +02:00
Rishikesh More 57618eead0 mips: MSA dct optimizations
Signed-off-by: Rishikesh More <rishikesh.more@imgtec.com>
2015-07-25 22:52:55 +02:00
Rishikesh More 4ebb23aaf4 mips: MSA mc optimizations
Signed-off-by: Rishikesh More <rishikesh.more@imgtec.com>
2015-07-25 22:52:55 +02:00
Anton Mitrofanov 8e71b432e5 Update configure for auto detection of system libx264 configuration 2015-02-23 20:09:33 +03:00
Anton Mitrofanov b77cc09b92 Fix ARCH variable name conflict with BSD ports (bsd.port.mk) read-only variable 2015-02-23 13:34:47 +03:00
Janne Grunau 59b9c252cf aarch64: cabac_encode_{decision,bypass,terminal}_asm
benchmarks on a Nexus 9 (nvidia denver):
101.3 cycles in x264_cabac_encode_decision_c,   67105369 runs, 3495 skips
 97.3 cycles in x264_cabac_encode_decision_asm, 67105493 runs, 3371 skips
132.8 cycles in x264_cabac_encode_terminal_c,    1046950 runs, 1626 skips
116.1 cycles in x264_cabac_encode_terminal_asm,  1048424 runs, 152 skips
 92.4 cycles in x264_cabac_encode_bypass_c,     16776192 runs, 1024 skips
 89.6 cycles in x264_cabac_encode_bypass_asm,   16776453 runs, 763 skips

Cycle counts are not as stable as one would like. The dynamic code
optimisation seems to produce different results for small chnages in a
binary. Repeated runs with the same binary produce stable results
though (ignoring the first run).
2014-12-16 20:40:12 +03:00
Janne Grunau fa7e9d3d08 aarch64: nal_escape_neon
3-4 times faster.
2014-12-16 20:40:10 +03:00
Anton Mitrofanov 9bec6fed6d libx264 API usage example 2014-10-17 14:25:28 -07:00
Janne Grunau 1343db872b aarch64: deblocking NEON asm
Deblock chroma/luma are based on libav's h264 aarch64 NEON deblocking
filter which was ported by me from the existing ARM NEON asm. No
additional persons to ask for a relicense.
2014-08-26 09:19:23 -07:00
Janne Grunau 3c1fa5d9b2 aarch64: intra predition NEON asm
Ported from the ARM NEON asm.
2014-08-26 09:19:23 -07:00
Janne Grunau 556b0e7928 aarch64: motion compensation NEON asm
Ported from the ARM NEON asm.
2014-08-26 09:19:22 -07:00
Janne Grunau 6cda439867 aarch64: transform and zigzag NEON asm
Ported from the ARM NEON asm.
2014-08-26 09:19:22 -07:00
Janne Grunau db5c504aa0 aarch64: quantization and level-run NEON asm
Ported from the ARM NEON asm.
2014-08-26 09:19:22 -07:00
Janne Grunau f4a82a5488 aarch64: pixel metrics NEON asm
Ported from the ARM NEON asm.
2014-08-26 09:19:21 -07:00
Janne Grunau 943128a527 aarch64: initial build support 2014-08-26 09:19:20 -07:00
Steven Walters 6fbbb5b0c0 MSVS 2013 Update 2 support
The first MSVS compiler C99 compliant enough to build x264.
Use `CC=cl ./configure` to compile with it.
2014-07-19 20:53:00 -07:00
Diego Biurrun cbd8d7b6db build: Replace cltostr.pl by a shell script
This avoids a dependency on Perl to build OpenCL support.
2014-07-19 20:53:00 -07:00
Diego Biurrun d8b6ce7f70 build: Simplify phony target declaration with wildcards
Also add etags to list of phony targets.
2014-07-19 20:52:59 -07:00
Diego Biurrun 31311f2549 build: Add dependencies on x86inc.asm/x86util.asm for all .asm files
This is a little bit overzealous, but errs on the side of caution.
Generating full dependency information is also possible, but slightly
slows down the build as YASM cannot do it as a sideeffect of compilation.
2014-07-19 20:52:59 -07:00
Diego Biurrun 016831ec7b Delete all SPARC optimizations
SPARC has been obsolete for a long time and makes little sense as a
H.264 encoding platform.

Also update authors file.
2014-07-19 20:52:58 -07:00
Diego Biurrun dd5b5d3959 build: Set all ASFLAGS from within configure
This is how all other toolchain flags are handled.
2014-07-19 20:52:58 -07:00
Anton Mitrofanov 95d196ef2e Remove --visualize option.
It probably wasn't used or maintained for last few years.
2013-10-30 13:02:28 -07:00
Anton Mitrofanov 09c7010e3d Add L-SMASH support as preferable alternative for MP4-muxing 2013-10-30 13:02:28 -07:00
Tim Mooney 5b272b22d8 Fix INSTALL in configure for Solaris systems 2013-09-03 15:55:19 -07:00
Anton Mitrofanov 3aa9a67b6d OpenCL support improvement/refactoring
Autoload the OpenCL library so that it's not required to run an openCL-enabled
build of x264.

Update X264_BUILD, which should have been changed with the first patch.
2013-05-20 12:25:24 -07:00
Steve Borho f49a1b2ef6 OpenCL lookahead
OpenCL support is compiled in by default, but must be enabled at runtime by an
--opencl command line flag. Compiling OpenCL support requires perl. To avoid
the perl requirement use: configure --disable-opencl.

When enabled, the lookahead thread is mostly off-loaded to an OpenCL capable GPU
device.  Lowres intra cost prediction, lowres motion search (including subpel)
and bidir cost predictions are all done on the GPU.  MB-tree and final slice
decisions are still done by the CPU.  Presets which do not use a threaded
lookahead will not use OpenCL at all (superfast, ultrafast).

Because of data dependencies, the GPU must use an iterative motion search which
performs more total work than the CPU would do, so this is not work efficient
or power efficient. But if there are spare GPU cycles to spare, it can often
speed up the encode. Output quality when OpenCL lookahead is enabled is often
very slightly worse in quality than the CPU quality (because of the same data
dependencies).

x264 must compile its OpenCL kernels for your device before running them, and in
order to avoid doing this every run it caches the compiled kernel binary in a
file named x264_lookahead.clbin (--opencl-clbin FNAME to override).  The cache
file will be ignored if the device, driver, or OpenCL source are changed.

x264 will use the first GPU device which supports the required cl_image
features required by its kernels. Most modern discrete GPUs and all AMD
integrated GPUs will work.  Intel integrated GPUs (up to IvyBridge) do not
support those necessary features. Use --opencl-device N to specify a number of
capable GPUs to skip during device detection.

Switchable graphics environments (e.g. AMD Enduro) are currently not supported,
as some have bugs in their OpenCL drivers that cause output to be silently
incorrect.

Developed by MulticoreWare with support from AMD and Telestream.
2013-04-23 14:36:20 -07:00
Alexander Prikhodko 62d7007d35 configure: correct use of RC variable and add --extra-rcflags 2012-04-23 13:28:39 -07:00
Steven Walters 38a26cdfc5 ICL: fix out of tree building and resource file usage on Windows 2012-03-06 08:51:07 -08:00
Ronald S. Bultje acabceb653 Change %ifdef directives to %if directives in *.asm files
This allows combining multiple conditionals in a single statement.
2012-02-04 07:18:19 -08:00