Commit Graph

328 Commits

Author SHA1 Message Date
Martin Storsjö db9bc75b0b configure: Check for support for AArch64 SVE and SVE2
We don't expect the user to build the whole x264 codebase with
SVE/SVE2 enabled, as we only enable this feature for the assembly
files that use it, in order to have binaries that are portable
and enable the SVE codepaths at runtime if supported.
2023-10-18 11:23:47 +03: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
Stephen Hutchinson bfc87b7a33 configure: Allow AviSynth+ on *BSD and Haiku 2022-02-22 18:03:57 +00:00
Anton Mitrofanov 35fe20d1ba Replace AvxSynth with AviSynth+ on POSIX systems 2022-02-21 21:57:05 +00:00
Jessica Clarke 19856cc41a configure: Always make shared imply PIC
Building a shared library without -fPIC does not make sense. On most
architectures, especially recent ones, doing so will give link-time
errors due to relocations in read-only sections like .text. On some
legacy architectures, including i386, it is allowed by default, but will
warn, and is highly discouraged due to the overheads it adds at library
load time. Most architectures were already listed here as having shared
imply PIC, but not all, such as i386 which ends up with unwanted text
relocations, as well as architectures not known to the build system
currently like RISC-V, which does not permit text relocations by
default. There is no good reason to want shared without PIC on any
architecture, so just remove the architecture list.
2021-12-30 20:10:51 +00:00
Anton Mitrofanov c347e7a0b4 CI: Add macos-arm64 target (cross-compile)
Rename the old macos target to macos-x86_64.
2021-04-13 20:46:00 +00:00
Anton Mitrofanov 979044a659 mp4: Add GPAC detection with pkg-config 2021-04-13 19:20:26 +00:00
Henrik Gramner 6bc7fe4f36 configure: Fix endianness test when LTO is enabled through CFLAGS 2021-01-07 14:25:43 +01:00
Damiano Galassi 1086f4504e configure: Add Apple Silicon support 2020-10-25 20:40:48 +03:00
Anton Mitrofanov 375cc58822 configure: Add options for bash-completion install 2020-07-14 15:35:11 +02:00
A. David 7c2004b58c mp4: Update GPAC support to v0.8.0 or later 2020-07-02 19:45:50 +02:00
Henrik Gramner a41d4e2944 cli: Install bash autocomplete during 'make install' 2020-07-02 19:20:21 +02:00
Henrik Gramner 2e3caed26d lavf: Update to the new API for iterating demuxers 2020-07-02 19:08:51 +02:00
JHammler d1fee1e052 configure: Fix building under the MSYS shell 2020-06-15 21:57:16 +02:00
Sergei Trofimovich 235ce61301 configure: allow 'strings' override via STRINGS variable
This allows building x264 on systems where 'strings' or
'${HOST}-strings' does not exist, but llvm-strings exists.
2020-06-10 23:10:38 +02:00
Anton Mitrofanov 1771b556ee Check support for force_align_arg_pointer attribute
Closes videolan/x264#9.
2019-11-27 02:50:00 +03:00
Anton Mitrofanov 7114174b23 aarch64: Fix compilation with disabled asm 2019-11-05 21:13:14 +03:00
Anton Mitrofanov b2e66daba6 Export symbols only when building shared library 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
Anton Mitrofanov 34c06d1c17 Strip git-hash from version in x264.pc
pkg-config doesn't like spaces in version string.
2019-07-17 20:15:34 +03:00
Henrik Gramner 82721eae6e x86inc: Add x86-32 PIC support macros 2019-03-06 22:45:53 +03:00
Henrik Gramner 275ef5332d x86: Always use PIC in x86-64 asm
Most x86-64 operating systems nowadays doesn't even allow .text relocations
in object files any more, and there is no measurable overall performance
difference from using RIP-relative addressing in x264 asm.

Enforcing PIC reduces complexity and simplifies testing.
2019-03-06 22:45:50 +03:00
Anton Mitrofanov d6af823959 configure: Fix log2f misdetection on some systems
Bug report by Dirk Fieldhouse.
2018-12-23 20:13:43 +01:00
Henrik Gramner d1a53926fb Prefer a monotonic clock source if available 2018-08-06 23:24:13 +02:00
Emanuele Ruffaldi 698c5a32e6 4:0:0 (monochrome) encoding support
Virtually zero increase in compression efficiency compared to 4:2:0 with empty
chroma planes. Performance is better though, especially with fast settings.
2018-08-06 23:24:12 +02:00
Anton Mitrofanov 9d33c8fefb configure: Fix required version checks for lavf and swscale 2018-08-06 23:24:12 +02:00
Anton Mitrofanov 57dd6274e2 configure: Fix ambiguous "$((" 2018-05-27 20:58:53 +02:00
Martin Storsjö 3d90057e15 configure: Only use gas-preprocessor with armasm for compiler=CL
This picks the right assembler automatically for arm and aarch64
llvm-mingw targets.

This doesn't get the right assembler for clang setups when clang
acts like MSVC and uses MSVC headers though (where it perhaps
should use armasm as before), but that's probably an even more
obscure setup.
2018-03-31 21:53:42 +02:00
Diego Biurrun 6fce82284a Minor configure improvements
* Drop empty addition of GPLed filters

 * Replace backticks with $()
2018-01-17 18:31:04 +01:00
Martin Storsjö f745815e59 configure: Add support for building with MSVC/armasm for ARM64 2017-12-24 23:47:26 +03:00
Anton Mitrofanov 694d031c1d configure: Improvements
Log result of pkg-config checks to config.log.
Fix lavf support detection for pkg-config fallback case.
Fix detection of linking dependencies errors for lavf/lsmash/gpac.
Cosmetics.
2017-12-24 23:47:25 +03: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
Anton Mitrofanov 4e2ed4087a configure: Check for strtok_r compiler support 2017-12-24 22:54:15 +03:00
Henrik Gramner 1e27313c12 configure: Increase x86 stack alignment on clang 2017-12-24 22:54:13 +03:00
Anton Mitrofanov f1ac712264 configure: Don't try to detect clang by $CC
Only check if option -Werror=unknown-warning-option is supported before adding it
2017-05-23 16:57:45 +02:00
Henrik Gramner 472ce3648a x86: AVX-512 support
AVX-512 consists of a plethora of different extensions, but in order to keep
things a bit more manageable we group together the following extensions
under a single baseline cpu flag which should cover SKL-X and future CPUs:
 * AVX-512 Foundation (F)
 * AVX-512 Conflict Detection Instructions (CD)
 * AVX-512 Byte and Word Instructions (BW)
 * AVX-512 Doubleword and Quadword Instructions (DQ)
 * AVX-512 Vector Length Extensions (VL)

On x86-64 AVX-512 provides 16 additional vector registers, prefer using
those over existing ones since it allows us to avoid using `vzeroupper`
unless more than 16 vector registers are required. They also happen to
be volatile on Windows which means that we don't need to save and restore
existing xmm register contents unless more than 22 vector registers are
required.

Also take the opportunity to drop X264_CPU_CMOV and X264_CPU_SLOW_CTZ while
we're breaking API by messing with the cpu flags since they weren't really
used for anything.

Big thanks to Intel for their support.
2017-05-21 22:42:15 +02:00
Henrik Gramner d2b5f4873e x86: Change assembler from yasm to nasm
This is required to support AVX-512.

Drop `-Worphan-labels` from ASFLAGS since it's enabled by default in nasm.

Also change alignmode from `k8` to `p6` since it's more similar to `amdnop`
in yasm, e.g. use long nops without excessive prefixes.
2017-05-21 22:41:07 +02:00
Anton Mitrofanov 8ae2b62462 msvs/icl: Improve target host detection 2017-05-21 22:41:07 +02:00
Martin Storsjö a52d41c4d1 configure: Support targeting ARM with MSVC tools
Set up the right gas-preprocessor as assembler frontend in these cases,
using armasm as actual assembler.

Don't try to add the -mcpu -mfpu options in this case.

Check whether the compiler actually supports inline assembly.

Check for the ARMv7 features in a different way for the MSVC compiler.
2017-05-21 22:41:07 +02:00
Martin Storsjö b22a5db3c4 configure: Check for -lshell32 before forcibly adding it into LDFLAGSCLI
When targeting the Windows Phone API subset, there is no shell32.lib.

When targeting Windows Phone/RT, the CLI itself won't be built, but
LDFLAGSCLI are included in all later cases of cc_check within configure.
Therefore only add -lshell32 there if it actually is usable.
2017-05-21 22:41:07 +02:00
Martin Storsjö d13705191c arm: Skip using gas-preprocessor for iOS on arm as well
The few constructs that differ can easily be handled within the
source itself - tested to be working since at least Xcode 6.
2017-05-21 22:41:06 +02:00
Martin Storsjö a84e6a486b aarch64: Skip invoking gas-preprocessor for iOS
Clang can handle all the constructs used there these days, working
since Xcode 6 at least.
2017-05-21 22:41:06 +02:00
Henrik Gramner bec87ba694 Windows: Add support for MSVC compilation with WSL
In Windows 10 version 1703 (Creators Update) WSL supports calling native
Windows binaries from the Bash shell, but it requires using full file
names including extension, e.g. `cl.exe` instead of `cl`.

We also don't have access to `cygpath`, so use a simple regex for
converting the dependencies to Unix paths that `make` can understand.
2017-05-21 22:41:06 +02: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
Kaustubh Raste 959e869c20 mips: Fix out-of-tree build
Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
2017-04-14 14:52:53 +02:00
Martin Storsjö 93340ca300 configure: Always enable PIC in aarch64 assembly for apple platforms
This is similar to what we do for 32-bit ARM assembly as well.

Fixes linker errors such as `ld: Absolute addressing not allowed in
arm64 code but used in '_x264_cabac_encode_terminal_asm' referencing
'_x264_cabac_range_lps' for architecture arm64`.
2017-03-23 22:52:09 +01:00
Luca Barbato 2b741f81e5 ppc: Add VSX support to configure 2016-12-01 16:10:37 +01:00
Henrik Gramner 3f5ed56d41 configure: Support specifying a custom pkg-config 2016-06-13 22:07:00 +02:00
Henrik Gramner 92515e8ff7 configure: Add link-time optimization support
Enabled by using the --enable-lto configuration option.

May give a slight performance improvement in some cases, but it can
also reduce performance in other cases (largely compiler-dependant)
so don't enable it by default. It also makes compilation (and linking
in particular) a fair bit slower.

Note that some older versions of GNU binutils will incorrectly warn
about "memset used with constant zero length parameter" when linking
using LTO. This is due to a bug in binutils and can safely be ignored.
2016-06-13 22:07:00 +02:00