Commit Graph

331 Commits

Author SHA1 Message Date
Ziemowit Zabawa d8debbc6dd Fix typos with codespell tool
This includes fixing convert_method_to_flag so it recognizes "gauss"
parameter properly instead of silently defaulting to bicubic.
2021-09-29 21:11:16 +00:00
Anton Mitrofanov fa264466e7 Fix MB stats
Bug report by Zhengzhi Duan.
2021-02-10 21:58:32 +01:00
Anton Mitrofanov b3aadb7632 Fix PADH alignment
Make pointers to padded buffers aligned both before and after padding.
2021-01-26 21:49:17 +03:00
Anton Mitrofanov 8e5e8340f0 Bump dates to 2021 2021-01-24 16:38:34 +03:00
Anton Mitrofanov 6b28e58504 Fix data race
Closes videolan/x264#16.
Bug report by Zu-Ming Jiang.
2020-06-10 18:07:03 +03:00
Anton Mitrofanov af2755cd18 Fix undefined behavior: access within misaligned address 2020-04-09 15:36:22 +03:00
Anton Mitrofanov 7186cc92be Fix undefined behavior: applying [non-]zero offset to null pointer 2020-04-09 15:36:22 +03:00
Anton Mitrofanov 04e6c65e6b Bump dates to 2020 2020-02-29 22:02:01 +03:00
Anton Mitrofanov 6b1170cbbd Shut up UBSan about uninitialized data read
Result was never used in that case.
2019-07-17 20:15:34 +03:00
Anton Mitrofanov 6381798d2d Fix heap-buffer-overflow read detected by ASan with interlaced encoding
Bug report by Hongxu Chen.
2019-07-17 20:15:34 +03:00
Henrik Gramner ec1d32302d Bump dates to 2019 2019-03-06 22:45:52 +03:00
Anton Mitrofanov 6dd1d3b5d9 Cosmetics: Use consistent "inline" attribute position
Place it immediately after "static".
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 6afb67c6d7 Fix theoretically incorrect cost_mv_fpel free 2018-05-27 20:58:54 +02:00
Henrik Gramner ca5408b13c Bump dates to 2018 2018-01-17 18:31:04 +01:00
Henrik Gramner b019515ef4 Merge zero buffers
Improves cache efficiency.
2018-01-17 18:31:03 +01:00
Henrik Gramner 9384a7389b Correctly align buffers for AVX and AVX-512
Fixes segfaults on Windows where the stack is only 16-byte aligned.
2018-01-17 18:30:49 +01:00
Anton Mitrofanov e3fae10bf7 Don't force fast-intra for subme < 3
It have caused significant quality hit without any meaningful (if any) speed up.
2017-12-24 23:47:25 +03:00
Anton Mitrofanov bdf27e783a Make ref and i4x4_mode costs global instead of static
Fixes some thread safety doubts and makes code cleaner.
Downside: slightly higher memory usage when calling multiple encoders from the same application.
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
Vittorio Giovara 8f2437d333 Drop the x264 prefix from static functions and variables 2017-12-24 23:11:30 +03:00
Henrik Gramner c9d2c1c80b analyse: Reduce the size the cost_mv arrays
Use a dynamic size depending on the MV range. Reduces memory consumption by
up to a few megabytes.

Drop a related old miscompilation check since it may otherwise cause an
out-of-bounds memory access.

Also remove an unused extern variable declaration.
2017-06-14 23:22:57 +03:00
Henrik Gramner 95dc64c4ef x86: AVX-512 memzero_aligned
Reorder some elements in the x264_t.mb.pic struct to reduce the amount
of padding required.

Also drop the MMX implementation in favor of SSE.
2017-05-21 23:14:24 +02:00
Henrik Gramner c0cd7650cb x86: AVX and AVX-512 memcpy_aligned
Reorder some elements in the x264_mb_analysis_list_t struct to reduce the
amount of padding required.

Also drop the MMX implementation in favor of SSE.
2017-05-21 23:14:24 +02:00
Henrik Gramner 93bc2cbc66 x86: Faster SSE2 pixel_sad_16x16 and 16x8
Also make the order of fenc/fdec arguments a bit more consistent.
2017-05-21 22:41:07 +02:00
Henrik Gramner d0b905b901 analyse: Faster min/max MV clipping
Values only needs to be clipped in one direction.
2017-05-21 22:41:07 +02:00
Henrik Gramner d13b4c3a95 osdep: Rework alignment macros
Drop ALIGNED_N and ALIGNED_ARRAY_N in favor of using explicit alignment.

This will allow us to increase the native alignment without unnecessarily
increasing the alignment of everything that's currently 32-byte aligned.
2017-05-19 16:12:15 +02:00
Henrik Gramner cce5008212 x86: AVX2 load_deinterleave_chroma_fenc
20% faster than SSSE3.
2017-01-21 14:10:37 +01:00
Henrik Gramner c7a2e327be Bump dates to 2017 2017-01-21 14:10:37 +01:00
Anton Mitrofanov b97ae0644f analyse: Fix lambda table values 2016-12-01 18:00:36 +01:00
Anton Mitrofanov a5e06b9a43 Fix p4x4 analyse for 4:4:4 encoding with chroma ME 2016-06-13 22:06:51 +02:00
Henrik Gramner 24f25b6afd analyse: i_sub_partition write combining 2016-04-12 17:10:39 +02:00
Henrik Gramner 5be32efc24 configure: Define feature test macros for --std=gnu99
Makes the printf() family functions on MinGW use the correct C99 POSIX
versions instead of the broken pre-VS2015 Microsoft ones.

Also allows us to get rid of some _GNU_SOURCE and _ISOC99_SOURCE defines.
2016-04-11 16:58:23 +02:00
Henrik Gramner d23d186552 Bump dates to 2016 2016-01-17 00:30:13 +01:00
Henrik Gramner 5c6570495f encoder_open: Fix memory leak
Furthermore, the x264_analyse_prepare_costs() and x264_analyse_init_costs()
functions were only used in x264_encoder_open(), so move that entire section
of code to analyse.c as well to simplify things.
2016-01-03 17:15:47 +01:00
Anton Mitrofanov d7ccd89f1b Bump dates to 2015 2015-02-23 13:34:44 +03:00
Kieran Kunhya dd6a303498 Add support for AVC-Intra Class 200 2014-01-21 13:40:14 -08:00
Henrik Gramner 807aeaaae7 Bump dates to 2014
Also update AUTHORS file and my e-mail address in the headers of various files.
2014-01-08 11:15:45 -08:00
Fiona Glaser 77cc44feea chroma-me: take shortcut in BI analysis
~100 cycles faster with subme>=9
2013-10-25 10:35:38 -07:00
Kieran Kunhya 9b94896b37 AVC-Intra support
This format has been reverse engineered and x264's output has almost exactly
the same bitstream as Panasonic cameras and encoders produce. It therefore does
not comply with SMPTE RP2027 since Panasonic themselves do not comply with
their own specification. It has been tested in Avid, Premiere, Edius and
Quantel.

Parts of this patch were written by Fiona Glaser and some reverse
engineering was done by Joseph Artsimovich.
2013-08-23 14:04:13 -07:00
Anton Mitrofanov 1430b04988 Fix cases in which intra refresh allowed prediction from disallowed pixels 2013-08-23 14:04:10 -07:00
Henrik Gramner f114746df6 x86: AVX2 high bit-depth intra_sad_x3_8x8
43->24 cycles
2013-05-20 12:25:20 -07:00
Henrik Gramner 594dd84cb8 x86: Faster high bit-depth intra_sad_x3_4x4
20->16 cycles on Ivy Bridge
2013-05-20 12:25:19 -07:00
Henrik Gramner 295f83af2a x86: AVX2 high_bit_depth pixel_avg2, get_ref, mc_copy_w16, mc_luma
Also reduce the number of xmm registers used by mc_copy_* to avoid
saving and restoring xmm6 and xmm7 on 64-bit Windows.
2013-04-23 14:36:34 -07:00
Fiona Glaser 7b1301e946 Eliminate some branchiness in ME/analysis
Faster, fewer branch mispredictions.
2013-02-25 23:22:55 -08:00
Oskar Arvidsson 75d927053e x86: combined SA8D/SATD dsp function
Speedup is most apparent for 8-bit (~30%), but gives some improvements
for 10-bit too (~12%).
64-bit only for now.
2013-02-25 16:27:43 -08:00
Fiona Glaser 6371c3a527 x86: optimize and clean up predictor checking
Branchlessly handle elimination of candidates in MMX roundclip asm.
Add a new asm function, similar to roundclip, except without the round part.
Optimize and organize the C code, and make both subme>=3 and subme<3 consistent.
Add lots of explanatory comments and try to make things a little more understandable.
~5-10% faster with subme>=3, ~15-20% faster with subme<3.
2013-02-25 12:14:35 -08:00
Loren Merritt 732b072ae2 Bump dates to 2013 2013-01-08 16:01:32 -08:00
Anton Mitrofanov bfed708c53 Fix possible issues with out-of-spec QP values
Fixes a possible regression in r2228.
2012-11-08 14:42:01 -08:00
Fiona Glaser 8980dd8afb Enhance mb_info: add mb_info_update
This feature lets the callee know which decoded macroblocks have changed.
2012-09-05 11:59:47 -07:00