Commit Graph

208 Commits

Author SHA1 Message Date
Loongson Technology Corporation Limited 5f84d403fc loongarch: Improve the performance of pixel series functions
Performance has improved from 11.27fps to 20.50fps by using the
following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
hadamard_ac_8x8          117             21
hadamard_ac_8x16         236             42
hadamard_ac_16x8         235             31
hadamard_ac_16x16        473             60
intra_sad_x3_4x4         50              21
intra_sad_x3_8x8         183             34
intra_sad_x3_8x8c        181             36
intra_sad_x3_16x16       643             68
intra_satd_x3_4x4        83              61
intra_satd_x3_8x8c       344             81
intra_satd_x3_16x16      1389            136
sa8d_8x8                 97              19
sa8d_16x16               394             68
satd_4x4                 24              8
satd_4x8                 51              11
satd_4x16                103             24
satd_8x4                 52              9
satd_8x8                 108             12
satd_8x16                218             24
satd_16x8                218             19
satd_16x16               437             38
ssd_4x4                  10              5
ssd_4x8                  24              8
ssd_4x16                 42              15
ssd_8x4                  23              5
ssd_8x8                  37              9
ssd_8x16                 74              17
ssd_16x8                 72              11
ssd_16x16                140             23
var2_8x8                 91              37
var2_8x16                176             66
var_8x8                  50              15
var_8x16                 65              29
var_16x16                132             56

Signed-off-by: Hecai Yuan <yuanhecai@loongson.cn>
2023-10-12 17:28:23 +08:00
Loongson Technology Corporation Limited fa7f1fce7f loongarch: Improve the performance of dct series functions
Performance has improved from 10.53fps to 11.27fps.
Tested with following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
add4x4_idct              34              9
add8x8_idct              139             31
add8x8_idct8             269             39
add8x8_idct_dc           67              7
add16x16_idct            564             123
add16x16_idct_dc         260             22
dct4x4dc                 18              10
idct4x4dc                16              9
sub4x4_dct               25              7
sub8x8_dct               101             12
sub8x8_dct8              160             25
sub16x16_dct             403             52
sub16x16_dct8            646             68
zigzag_scan_4x4_frame    4               1

Signed-off-by: zhoupeng <zhoupeng@loongson.cn>
2023-10-12 17:28:15 +08:00
Loongson Technology Corporation Limited 981c8f25a2 loongarch: Improve the performance of mc series functions
Performance has improved from 6.78fps to 10.53fps.
Tested with following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
avg_4x2                  16              5
avg_4x4                  30              6
avg_4x8                  63              10
avg_4x16                 124             19
avg_8x4                  60              6
avg_8x8                  119             10
avg_8x16                 233             19
avg_16x8                 229             21
avg_16x16                451             41
get_ref_4x4              30              9
get_ref_4x8              52              11
get_ref_8x4              45              9
get_ref_8x8              80              11
get_ref_8x16             156             16
get_ref_12x10            137             13
get_ref_16x8             147             11
get_ref_16x16            282             16
get_ref_20x18            278             22
hpel_filter              5163            686
lowres_init              5440            286
mc_chroma_2x2            24              7
mc_chroma_2x4            42              10
mc_chroma_4x2            41              7
mc_chroma_4x4            75              10
mc_chroma_4x8            144             19
mc_chroma_8x4            137             15
mc_chroma_8x8            269             28
mc_luma_4x4              30              10
mc_luma_4x8              52              12
mc_luma_8x4              44              10
mc_luma_8x8              80              13
mc_luma_8x16             156             19
mc_luma_16x8             147             13
mc_luma_16x16            281             19
memcpy_aligned           14              9
memzero_aligned          24              4
offsetadd_w4             79              18
offsetadd_w8             142             18
offsetadd_w16            277             25
offsetadd_w20            1118            38
offsetsub_w4             75              18
offsetsub_w8             140             18
offsetsub_w16            265             25
offsetsub_w20            989             39
weight_w4                111             19
weight_w8                205             19
weight_w16               396             29
weight_w20               1143            45
deinterleave_chroma_fdec 76              9
deinterleave_chroma_fenc 86              9
plane_copy_deinterleave  733             90
plane_copy_interleave    791             245
store_interleave_chroma  82              12

Signed-off-by: Xiwei Gu <guxiwei-hf@loongson.cn>
2023-10-12 17:27:40 +08:00
Loongson Technology Corporation Limited 65e7bac50d loongarch: Improve the performance of quant series functions
Performance has improved from 6.34fps to 6.78fps.
Tested with following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
coeff_last15             3               2
coeff_last16             3               1
coeff_last64             42              6
decimate_score15         8               12
decimate_score16         8               11
decimate_score64         61              43
dequant_4x4_cqm          16              5
dequant_4x4_dc_cqm       13              5
dequant_4x4_dc_flat      13              5
dequant_4x4_flat         16              5
dequant_8x8_cqm          71              9
dequant_8x8_flat         71              9

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
2023-10-10 09:15:32 +08:00
Loongson Technology Corporation Limited d8ed272a19 loongarch: Improve the performance of predict series functions
Performance has improved from 6.32fps to 6.34fps.
Tested with following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
intra_predict_4x4_dc     3               2
intra_predict_4x4_dc8    1               1
intra_predict_4x4_dcl    2               1
intra_predict_4x4_dct    2               1
intra_predict_4x4_ddl    7               2
intra_predict_4x4_h      2               1
intra_predict_4x4_v      1               1
intra_predict_8x8_dc     8               2
intra_predict_8x8_dc8    1               1
intra_predict_8x8_dcl    5               2
intra_predict_8x8_dct    5               2
intra_predict_8x8_ddl    27              3
intra_predict_8x8_ddr    26              3
intra_predict_8x8_h      4               2
intra_predict_8x8_v      3               1
intra_predict_8x8_vl     29              3
intra_predict_8x8_vr     31              4
intra_predict_8x8c_dc    8               5
intra_predict_8x8c_dc8   1               1
intra_predict_8x8c_dcl   5               3
intra_predict_8x8c_dct   5               3
intra_predict_8x8c_h     4               2
intra_predict_8x8c_p     58              30
intra_predict_8x8c_v     4               1
intra_predict_16x16_dc   32              8
intra_predict_16x16_dc8  9               4
intra_predict_16x16_dcl  26              6
intra_predict_16x16_dct  26              6
intra_predict_16x16_h    23              7
intra_predict_16x16_p    182             44
intra_predict_16x16_v    22              4

Signed-off-by: Xiwei Gu <guxiwei-hf@loongson.cn>
2023-10-10 09:13:58 +08:00
Loongson Technology Corporation Limited 00b8e3b9cd loongarch: Improve the performance of sad/sad_x3/sad_x4 series functions
Performance has improved from 4.92fps to 6.32fps.
Tested with following command:
./configure && make -j5
./x264 --threads 4 -o out.mkv yuv_1920x1080.yuv

functions           performance     performance
                        (c)            (asm)
sad_4x4                 13               3
sad_4x8                 26               7
sad_4x16                57               13
sad_8x4                 24               3
sad_8x8                 54               8
sad_8x16                108              13
sad_16x8                95               8
sad_16x16               189              13
sad_x3_4x4              37               6
sad_x3_4x8              71               13
sad_x3_8x4              70               8
sad_x3_8x8              162              14
sad_x3_8x16             323              25
sad_x3_16x8             279              15
sad_x3_16x16            555              27
sad_x4_4x4              49               8
sad_x4_4x8              95               17
sad_x4_8x4              94               8
sad_x4_8x8              214              16
sad_x4_8x16             429              33
sad_x4_16x8             372              18
sad_x4_16x16            740              34

Signed-off-by: wanglu <wanglu@loongson.cn>
2023-10-10 09:09:52 +08:00
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