126 Commits

Author SHA1 Message Date
Martin Storsjö 32c3b80119 lavf: Update the code to work with the latest libavutil API 2025-04-04 17:50:00 +03:00
Anton Mitrofanov 373697b467 Bump dates to 2025 2025-01-03 16:48:30 +03:00
Anton Mitrofanov 4815ccadb1 Bump dates to 2024 2024-01-13 14:45:39 +03:00
Anton Mitrofanov 17df75b32e Bump dates to 2023 2023-01-28 16:37:02 +03:00
Anton Mitrofanov b093bbe7d9 ffms: Fix crash if stream properties changes 2022-10-06 00:12:42 +03:00
Anton Mitrofanov 35fe20d1ba Replace AvxSynth with AviSynth+ on POSIX systems 2022-02-21 21:57:05 +00: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
Anton Mitrofanov a66ca247d7 lavf: Remove use of deprecated av_init_packet 2021-12-07 13:04:52 +00:00
Anton Mitrofanov 88fab19100 Fix --tcfile-in support
Accept files created by MKVToolNix version 17.0.0 or newer.
2021-06-13 20:25:24 +00:00
Anton Mitrofanov 5db6aa6cab lavf: Fix compilation with new versions of ffmpeg
Add the missing header as avcodec.h is no longer included in avformat.h.
2021-06-13 15:43:57 +03:00
Anton Mitrofanov 5180c07ccf y4m: Support ffmpeg's color range extension 2021-05-03 13:54:26 +03:00
Anton Mitrofanov 5bc04b8d1e y4m: Support files with longer sequence header
ffmpeg can now generate y4m files with sequence header length > 80.
2021-05-03 12:29:06 +03:00
Anton Mitrofanov 8e5e8340f0 Bump dates to 2021 2021-01-24 16:38:34 +03:00
Henrik Gramner 7ab4c928ef Add support for long filenames on Windows 10 2020-09-27 23:32:10 +02:00
Henrik Gramner d198931a63 mp4: Remove GPAC Windows Unicode compatibility shim
GPAC has native UTF-8 support nowadays.

Also move the compatibility code to input/avs.c since that's the only
remaining code that uses it now.
2020-09-12 19:23:57 +02:00
Henrik Gramner 2e3caed26d lavf: Update to the new API for iterating demuxers 2020-07-02 19:08:51 +02:00
Anton Mitrofanov 33f9e14746 Fix warning: comparison of integers of different signs [-Wsign-compare] 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 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 ec1d32302d Bump dates to 2019 2019-03-06 22:45:52 +03: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
Henrik Gramner ca5408b13c Bump dates to 2018 2018-01-17 18:31:04 +01:00
Henrik Gramner 61e8b5cc48 input: Add a workaround for swscale overread bugs
swscale can read past the end of the input buffer, which may result in
crashes if such a read crosses a page boundary into an invalid page.

Work around this by adding some padding space at the end of the buffer when
using memory-mapped input frames. This may sometimes require copying the
last frame into a new buffer on Windows since the Microsoft memory-mapping
implementation has very limited capabilities compared to POSIX systems.
2017-12-24 23:47:27 +03:00
Henrik Gramner 0fe75403d7 lavf: Upgrade to the new core decoding API 2017-12-24 23:47:26 +03:00
Vittorio Giovara dae7f18d2c lavf: Upgrade to some newer API:s
* Use the codec parameters API instead of the AVStream codec field.
 * Use av_packet_unref() instead of av_free_packet().
 * Use the AVFrame pts field instead of pkt_pts.
2017-12-24 23:47:26 +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 dcf406978b Support YUYV and UYVY packed 4:2:2 raw input
Packed YUV is arguably more common than planar YUV when dealing with raw
4:2:2 content.

We can utilize the existing plane_copy_deinterleave() functions with some
additional minor constraints (we cannot assume any particular alignment
or overread the input buffer).

Enables assembly optimizations on x86.
2017-05-21 22:41:07 +02:00
Henrik Gramner d32d7bf1c6 cli: Verify that yuv/y4m input has at least one frame of data
Prevents a SIGBUS crash caused by attempting to access a memory-mapped
region beyond the end of the input file.
2017-05-19 16:12:14 +02:00
Henrik Gramner c7a2e327be Bump dates to 2017 2017-01-21 14:10:37 +01:00
Anton Mitrofanov 0cc8afd312 avs: support for AviSynth+ high bit-depth pixel formats 2016-09-20 21:01:57 +03:00
Anton Mitrofanov eaf2fc20c8 Various cosmetics of semicolon use 2016-09-20 21:01:56 +03:00
Henrik Gramner aae177c551 cli: Prefetch yuv/y4m input frames on Windows 8 and newer
Use PrefetchVirtualMemory() (if available) on memory-mapped input frames.

Significantly improves performance when the source file is not already
present in the OS page cache by asking the OS to bring in those pages from
disk using large, concurrent I/O requests.

Most beneficial on fast encoding settings. Up to 40% faster overall with
--preset ultrafast, and up to 20% faster overall with --preset veryfast.

This API was introduced in Windows 8, so call it conditionally. On older
Windows systems the previous behavior remains unchanged.
2016-09-20 21:01:55 +03:00
Henrik Gramner dfe394cadc ffms: Various improvements
* Drop the MinGW Unicode workarounds. Those were required at the time
   Windows Unicode support was added to x264 but the underlying problem
   has since been fixed in FFMS.

 * Use FFMS_IndexBelongsToFile() as an additional sanity check when reading
   an index file to ensure that it belongs to the current source video.

 * Upgrade to the new API to prevent deprecation warnings when compiling.

 * Fix a resource leak that would occur if FFMS_GetFirstTrackOfType() or
   FFMS_CreateVideoSource() failed.

 * Minor string handling adjustments related to progress reporting.

This increases the FFMS version requirement from 2.16.2 to 2.21.0.
2016-04-11 16:59:51 +02:00
Henrik Gramner d23d186552 Bump dates to 2016 2016-01-17 00:30:13 +01:00
Henrik Gramner 3d972062c8 cli: Use memory-mapped input frames for yuv and y4m
Improves performance by avoiding extraneous memory copying.
Most beneficial on fast settings.

On average around 5-10% faster overall on ultrafast but the
performance improvement can be even larger in some cases.
2016-01-17 00:30:13 +01:00
Henrik Gramner 38a5268dbe y4m: Support extended frame headers when seeking
Use the actual length of the frame header of the first frame instead of
assuming a header without extensions when calculating the frame size.

Also makes the frame counter more accurate with extended frame headers.
2016-01-17 00:30:13 +01:00
Henrik Gramner 8b2d2a6d51 y4m: Avoid some redundant strlen() calls 2016-01-17 00:30:13 +01:00
Henrik Gramner f04062e638 Silence various static analyzer warnings
Those are false positives, but it doesn't hurt to get rid of them.
2015-08-19 01:00:18 +03:00
Yu Xiaolei 627f891c57 NV21 input support
Eliminates an extra copy when encoding Android camera preview images.

Checkasm test by Janne Grunau.
ARM assembly with improvements from Janne Grunau.
2015-07-25 22:52:54 +02:00
Henrik Gramner 3533520655 avs: Fix file handle leak 2015-07-25 00:39:36 +03:00
Anton Mitrofanov d7ccd89f1b Bump dates to 2015 2015-02-23 13:34:44 +03:00
Henrik Gramner 6a301b6ee0 AvxSynth: Remove a bunch of unused cruft 2014-12-13 00:41:39 +01:00
Anton Mitrofanov dd79a61e0e Update to the current lavf API and fix memory leak when using --seek 2014-08-26 09:19:25 -07:00
Anton Mitrofanov 95beb822e6 Fix memory leak when using select_every filter 2014-08-26 09:19:17 -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
James Weaver 41227fa253 v210 input support
Assembly based on code by Henrik Gramner and Loren Merritt.
2014-01-21 13:40:13 -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
Henrik Gramner 6bc63417e1 CLI: Avoid redundant 16-bit upconversions in piped raw input
It's not possible to seek in pipes, so if we want to skip frames we have to read and
discard unused ones. It's pointless to do bit-depth upconversions in those frames.
2014-01-08 11:15:44 -08:00