Commit Graph

1380 Commits

Author SHA1 Message Date
Anton Mitrofanov 4815ccadb1 Bump dates to 2024 2024-01-13 14:45:39 +03:00
Anton Mitrofanov d46938dec1 Fix VBV with sliced threads 2023-10-24 22:07:14 +03:00
Anton Mitrofanov cd31a90ba5 Fix compilation of only 8 or 10 bit by a non-optimizing compiler 2023-01-28 21:45:30 +03:00
Anton Mitrofanov 17df75b32e Bump dates to 2023 2023-01-28 16:37:02 +03:00
Anton Mitrofanov ab393c85eb Bump dates to 2022 2022-01-24 19:46:08 +03:00
Henrik Gramner 8a43cc145a Remove thread priority tweaking
Back in 2009 when this was added it improved scheduling of lookahead
threads on prevalent operating systems at the time.

According to more recent testing by Intel however, lowering thread
priorities does not improve performance on modern operating systems.
And more importantly, doing so on systems with heterogeneous CPU
topologies may actually result in a severe performance reduction.

Removing this code altogether eliminates the issue with performance
degradation on such systems, while having no noticeable impact on
regular systems with homogeneous CPU topologies.
2021-12-12 23:24:11 +01:00
Jean-Baptiste Kempf 66a5bc1bd1 lookahead: Keep b_exit_thread under ifbuf.mutex
The lookahead_thread main loop checks b_exit_thread and exits if it is set.
That flag is set by x264_lookahead_delete, which uses ifbuf.mutex to guard accessing it.
However, the read in the while-loop condition of lookahead_thread is not guarded,
and so TSAN sometimes reports a data race.
2021-09-29 21:34:37 +00:00
Anton Mitrofanov 7852034004 Fix integer overflow in cavlc trellis 2021-09-29 21:25:26 +00:00
Anton Mitrofanov 3a08e36e2e Fix integer overflow in cabac psy-trellis 2021-09-29 21:25:26 +00:00
Vitaly Lysenkov 6c142bba65 Fix integer overflow in psy-rd 2021-09-29 21:21:02 +00:00
Anton Mitrofanov 93fe0a1f23 Fix gcc warnings 2021-09-29 21:15:38 +00:00
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
Phillip Blucas ae03d92b52 Add support for Sony XAVC Class 300 and 480
This allows for 2160p UHD at up to 960 Mbit/s.
2021-06-13 20:32:44 +00:00
Ziemowit Zabawa e0fee7b2ff Cosmetics: Add missing backslashes inside #defines 2021-06-13 20:29:21 +00:00
Anton Mitrofanov df075e152d Fix undefined behavior: left shift of negative value
Compilers are good at optimizing multiplication by shift.
2021-06-13 20:20:52 +00:00
Phillip Blucas fa770fd537 Support writing the content light level information SEI message
Use --cll to specify the maximum content light level (MaxCLL)
and the maximum frame average light level (MaxFALL) as described
by the CTA 861.3 specification.
2021-05-05 07:11:57 +00:00
Phillip Blucas 8719ef8a73 Support writing the mastering display color volume SEI message
Use --mastering-display to specify the properties of the reference display.
A formatted string with all 10 values is required: G,B,R primaries and
white point coordinates, plus max/min brightness. Coordinates are in
0.00002 increments. Brightness units are 0.0001 cd/m^2.

For example, a 1000 nit BT.2020 display with a 0.0001 nit black level:
--mastering-display G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)
2021-05-05 07:11:57 +00:00
Henrik Gramner 38a76c7a00 Silence false positive -Wformat-truncation warning 2021-02-11 14:24:57 +01:00
Anton Mitrofanov fa264466e7 Fix MB stats
Bug report by Zhengzhi Duan.
2021-02-10 21:58:32 +01:00
Anton Mitrofanov a7e2c6ab8f Fix VBV overflow check for B-frames 2021-02-01 22:32:37 +03: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 e32bff1657 Fix alignment of chroma buffer for weightp
In 10-bit mode pixel_asd8 expects 16-byte alignment for pix1 and pix2.
2021-01-26 21:49:17 +03:00
Anton Mitrofanov 544c61f082 Fix use of nalu_process callback
Broke after unifying of 8-bit and 10-bit libraries.
2021-01-24 15:04:39 +01:00
Anton Mitrofanov e786649568 Fix CAVLC encoding
This bug mainly occurred when encoding with high bitrate (low QP).
It did not occur when encoding in baseline or main profile.
2021-01-24 14:57:17 +01:00
Anton Mitrofanov 8e5e8340f0 Bump dates to 2021 2021-01-24 16:38:34 +03:00
Anton Mitrofanov be3c1492db x86: Remove workaround for nasm on macho64 2020-10-25 18:22:37 +01:00
Anton Mitrofanov db0d417728 Rename function x264_strdup to x264_param_strdup 2020-07-14 15:45:40 +02:00
Anton Mitrofanov 4c2aafd864 Add new API function: x264_param_cleanup
Should be called to free struct members allocated internally by libx264,
e.g. by x264_param_parse.
Partially based on videolan/x264!18 by Derek Buitenhuis.
2020-07-02 22:23:50 +02:00
Anton Mitrofanov 4c9b076be6 Remove code for non-positive f_ip_factor/f_pb_factor
Currently they are guaranteed to be positive.
2020-06-15 22:01:02 +02: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 538f09b5b9 Fix undefined behavior: index out of bounds (one more)
last_non_b_pict_type is initialized to -1.
Bug report by Vitaly Buka.
2020-06-10 18:07:03 +03:00
Anton Mitrofanov 829f625cb9 Fix file encoding from Windows-1252 to UTF-8 2020-04-26 00:20:07 +03:00
Anton Mitrofanov 33f9e14746 Fix warning: comparison of integers of different signs [-Wsign-compare] 2020-04-09 15:36:22 +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 dfac34deef Fix undefined behavior: index out of bounds 2020-04-09 15:36:22 +03:00
Anton Mitrofanov d2833a49f4 Fix undefined behavior: division by zero 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 7666918082 Fix float division by zero when encoding CRF+VBV
Bug report by Sam Panzer.
2019-11-27 02:50:00 +03:00
Anton Mitrofanov 7923c5818b Limit maximum supported resolution
And other resolution dependent buffers checks.
Closes videolan/x264#10.
2019-11-27 02:49:27 +03:00
Henrik Gramner b5bc5d69c5 x86: Perform stack realignment in C instead of assembly
Simplifies a lot of code and avoids having to export public asm functions.

Note that the force_align_arg_pointer function attribute is broken in clang
versions prior to 6.0.1 which may result in crashes, so make sure to either
use a newer clang version or a different compiler.
2019-07-17 20:15:35 +03:00
Anton Mitrofanov f9af2a0f71 Revert r2959: Signal Progressive and Constrained profiles
Some hardware decoders reject to decode streams with non-zero
constraint_set4_flag/constraint_set5_flag.
2019-07-17 20:15:34 +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 f06062f51b Fix integer overflow detected by UBSan in --weightp analysis
Bug report by Xuezhi Yan.
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
Anton Mitrofanov d4099dd4c7 Remove compatibility workarounds
This will break decoding with older versions of FFmpeg/Libav.
2019-03-06 22:45:53 +03:00
Anton Mitrofanov 120ed3afe4 Remove h->rc dereferencing where possible 2019-03-06 22:45:53 +03:00
Henrik Gramner ec1d32302d Bump dates to 2019 2019-03-06 22:45:52 +03:00
Yusuke Nakamura 92d36908cb Signal Progressive and Constrained profiles
Progressive High, Constrained High, and Progressive High 10.

Even in Main profile, constraint_set4_flag is now set to 1 if progressive,
and constraint_set5_flag is set to 1 if no B-slices are present.
2019-03-06 22:45:51 +03:00
Anton Mitrofanov 88943afa4e Check that mbtree settings are consistent between passes
Also check that CQP mode is not used with 2-pass.
2019-03-03 23:52:42 +01:00