1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

118895 Commits

Author SHA1 Message Date
e8d4c55987 avcodec/aarch64/ac3dsp_neon.S: Optimize ac3_sum_square_butterfly_int32_neon
Instead of calculating a^2, b^2, (a+b)^2 and (a-b)^2, calculate only
a^2, b^2 and 2*a*b in each iteration and derive the latter parts from
these three at the end.

Before and after:

A78
ac3_sum_square_bufferfly_int32_neon:                   484.8 ( 2.00x)
ac3_sum_square_bufferfly_int32_neon:                   468.2 ( 2.08x)

A72
ac3_sum_square_bufferfly_int32_neon:                   793.6 ( 1.26x)
ac3_sum_square_bufferfly_int32_neon:                   527.3 ( 1.92x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-02 01:17:53 +02:00
38929b824b swscale/aarch64: Refactor hscale_16_to_15__fs_4
This patch removes the use of stack for temporary state and replaces
interleaved ld4 loads with ld1.

Before/after:

A78
hscale_16_to_15__fs_4_dstW_8_neon:                      86.8 ( 1.72x)
hscale_16_to_15__fs_4_dstW_24_neon:                    147.5 ( 2.73x)
hscale_16_to_15__fs_4_dstW_128_neon:                   614.0 ( 3.14x)
hscale_16_to_15__fs_4_dstW_144_neon:                   680.5 ( 3.18x)
hscale_16_to_15__fs_4_dstW_256_neon:                  1193.2 ( 3.19x)
hscale_16_to_15__fs_4_dstW_512_neon:                  2305.0 ( 3.27x)

hscale_16_to_15__fs_4_dstW_8_neon:                      86.0 ( 1.74x)
hscale_16_to_15__fs_4_dstW_24_neon:                    106.8 ( 3.78x)
hscale_16_to_15__fs_4_dstW_128_neon:                   404.0 ( 4.81x)
hscale_16_to_15__fs_4_dstW_144_neon:                   451.8 ( 4.80x)
hscale_16_to_15__fs_4_dstW_256_neon:                   760.5 ( 5.06x)
hscale_16_to_15__fs_4_dstW_512_neon:                  1520.0 ( 5.01x)

A72
hscale_16_to_15__fs_4_dstW_8_neon:                     156.8 ( 1.52x)
hscale_16_to_15__fs_4_dstW_24_neon:                    217.8 ( 2.52x)
hscale_16_to_15__fs_4_dstW_128_neon:                   906.8 ( 2.90x)
hscale_16_to_15__fs_4_dstW_144_neon:                  1014.5 ( 2.91x)
hscale_16_to_15__fs_4_dstW_256_neon:                  1751.5 ( 2.96x)
hscale_16_to_15__fs_4_dstW_512_neon:                  3469.3 ( 2.97x)

hscale_16_to_15__fs_4_dstW_8_neon:                     151.2 ( 1.54x)
hscale_16_to_15__fs_4_dstW_24_neon:                    173.4 ( 3.15x)
hscale_16_to_15__fs_4_dstW_128_neon:                   660.0 ( 3.98x)
hscale_16_to_15__fs_4_dstW_144_neon:                   735.7 ( 4.00x)
hscale_16_to_15__fs_4_dstW_256_neon:                  1273.5 ( 4.09x)
hscale_16_to_15__fs_4_dstW_512_neon:                  2488.2 ( 4.16x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-02 01:17:29 +02:00
76b1810017 libswscale/arm/swscale_unscaled: Fix function prototype
Constify dstStrice argument of rgbx_to_nv12_neon_16_wrapper to be
compatible with other functions as used in function assignment.

Signed-off-by: Adam Lackorzynski <adam@l4re.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-02 01:10:38 +02:00
0245e9382c lavu: bump minor and add APIChanges entry for new GRAY32 pixfmts 2025-03-01 20:16:00 +01:00
0ef678f5c5 APIChanges: add entry for new AMD AMF pixfmt 2025-03-01 20:16:00 +01:00
a73760da53 APIChanges: add entries for new planar GBR and float gray pixfmts
Was not done when the patches were pushed.
2025-03-01 20:15:59 +01:00
ded6772359 fate-sws-pixdesc-query: update ref for new pixfmts 2025-03-01 20:15:59 +01:00
e41b45509b fate-imgutils: update reference for new pixel formats 2025-03-01 20:15:55 +01:00
629e8a2425 vulkan: add support for AV_PIX_FMT_GRAY32 2025-03-01 13:11:13 +01:00
300b82c3ea pixfmt: add AV_PIX_FMT_GRAY32
This is a useful format for high-precision intermediates.
2025-03-01 13:11:12 +01:00
469b7a0ee4 doc/developer: Better {} style rule
This makes developer.texi consistent with tools/patcheck

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-01 02:47:33 +01:00
ace9f03a6c avformat/hls: Partially revert "reduce default max reload to 3"
(setting to 100 as a reasonable compromise)

The change has caused regressions for many users and consumers.
Playlist reloads only happen when a playlist doesn't indicate that it
has ended (via #EXT-X-ENDLIST), which means that the addition of future
segments is still expected.
It is well possible that an HLS server is temporarily unable to serve
further segments but resumes after some time, either indicating a
discontinuity or even by fully catching up.
With a segment length of 3s, a max_reload value of 1000 corresponds to
a duration of 50 minutes which appears to be a reasonable default.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-01 02:47:20 +01:00
b137347278 aarch64: Fix a few misindented lines
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-28 23:23:09 +02:00
b37ce9b016 libavutil/vulkan: Expose ff_vk_set_descriptor_image
Useful when creating a descriptor array of separate images
2025-02-28 13:44:49 +01:00
9993a64d7b avutil/aarch64/tx_float_neon.S: clean up FFT4_X2 2025-02-28 13:42:54 +01:00
bb87d19cd9 ffv1enc_vulkan: disable autodetection of async_depth
The issue is that this could consume gigabytes of VRAM at higher
resolutions for not that much of a speedup.
Automatic detection was not a good idea as we can't know how much
VRAM is actually free.
Just remove it.
2025-02-27 19:08:42 +01:00
85d81dcfd6 hwcontext_vulkan: enable read/write without storage
BGR formats in Vulkan cannot be used in storage images, as the
pixel labels on storage images are always ordered as RGB, and
swizzling is not an option due to old hardware limitations.
This means that you must always use an RGB format and manually
swizzle when reading or writing to BGR images, or simply not use
a format in the shader itself.
This adds support for the latter.
2025-02-27 19:06:41 +01:00
651bfd0dad avfilter/vf_libplacebo: set correct alpha mode before blending
&pl_alpha_overlay expects straight alpha, but the alpha output may be
premultiplied as a result of the target alpha mode (or in the absence of an
alpha channel). Fix it by requesting independent alpha explicitly when
blending.
2025-02-27 18:58:19 +01:00
c85879c601 avfilter/vf_libplacebo: set colorspace properties on all inputs
There is no reason to only do this on the first input. It doesn't actually
matter for now given that we don't constrain the color space list, but it
may matter when that changes.

Signed-off-by: Niklas Haas <git@haasn.dev>
2025-02-27 18:56:49 +01:00
d48745ba1c avfilter/vf_libplacebo: allow differing formats per input
Each input is entirely independent and can have varying pixel formats,
color spaces, etc. To accomplish this, we need to make a full copy of the
format list for each subsequent input, rather than sharing the same ref.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-02-27 18:56:49 +01:00
6602b88df6 avfilter/vf_libplacebo: switch to new background API
Fixes a deprecation warning, and also fixes a bug where the depredated
skip_target_clearing option was not correctly mapped to the new API inside
libplacebo upstream.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-02-27 18:56:49 +01:00
05302767ac avfilter/vf_liplacebo: properly initialize variable
Signed-off-by: Niklas Haas <git@haasn.dev>
2025-02-27 18:56:24 +01:00
5944c4b20a avfilter/vf_libplacebo: remove deprecated options
These were removed upstream and no longer have had any effect for
a while now.

Signed-off-by: Niklas Haas <git@haasn.dev>
2025-02-27 18:56:19 +01:00
27814dc3b6 avfilter/libplacebo: add option for outputting separate fields
cf. the other deinterlacing-aware filters.
2025-02-27 18:55:33 +01:00
83c1b34964 avfilter/libplacebo: strip interlaced flag when deinterlacing 2025-02-27 18:55:33 +01:00
123cccb621 avfilter/libplacebo: only mark frame fields when deinterlacing
Avoids an unnecessary copy of the frame in the frame queue when not
deinterlacing anyways.
2025-02-27 18:55:33 +01:00
794cba812e avfilter/libplacebo: add deinterlacing options
These were introduced in libplacebo API version 220. We actually already
map the field by default, but deinterlacing was never enabled unless the user
explicitly forced it using extra_ops.
2025-02-27 18:55:33 +01:00
58875417af configure: align libplacebo version check with reality
This filter already failed to compile on older versions, because of an
unconditional use of an API introduced in API version 220. Nobody noticed
this, so I conclude that it's safe to bump the required version by now.
2025-02-27 18:55:33 +01:00
e23c79ebfc avfilter/vf_libplacebo: switch to AV_OPT_TYPE_COLOR 2025-02-27 18:51:41 +01:00
e71b3ebaa5 avcodec/lcevcdec: Use proper include
External libraries are not components and so their CONFIG_ define
is in config.h.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:39:15 +01:00
deee2fb52d avcodec/proresdec: Reuse permutation
The ProresDSPContext already contains the idct_permutation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
e7ca57d857 avcodec/simple_idct: Move ProRes-only code to proresdsp.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
37cf9c5325 avcodec/simple_idct_template: Move function to its declaration
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
f1a4787f76 avcodec/proresdsp: Make put_pixels truely ptrdiff_t compatible
It currently uses an intermediate int which wouldn't work
if linesize exceeded the range of int and inhibits compiler
optimizations. Also switch to pointer arithmetic and use
smaller scope.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
802e4f4a53 avcodec/proresdec: Disable HWAccel at compile-time when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
57d892bd7b avcodec/prores{dec,dsp}: Remove always-false checks
avctx->bits_per_raw_sample is always 10 or 12 here;
the checks have been added in preparation for making
bits_per_raw_sample user-settable via an AVOption,
but this never happened.

While just at it, also set unpack_alpha earlier
(where bits_per_raw_sample is set).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
90ed5ddf66 avcodec/proresdec: Deduplicate debug message
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
fa39f07a29 avcodec/get_bits: Remove LONG_BITSTREAM_READER
No longer used anywhere.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
8ad2daec58 avcodec/proresdec: Don't use LONG_BITSTREAM_READER
Using LONG_BITSTREAM_READER means that every get_bits() call
uses an AV_RB64() to ensure that cache always contains 32 valid bits
(as opposed to the ordinary 25 guaranteed by reading 32 bits);
yet this is unnecessary when unpacking alpha. So only use these
64bit reads where necessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
ee1408cd66 avcodec/flacdsp: Remove leftover encoding function pointers
Forgotten in 6c4595190e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
90d9e2a26c avcodec/intrax8dsp: Copy several bytes at once
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
6f31b05389 avcodec/intrax8dsp: Constify DSP functions
Also add restrict where possible.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
99e2af4e78 avcodec/cuviddec: correctly handle buffer size and status when deinterlacing 2025-02-26 20:56:10 +01:00
330c8f8b93 avformat: add AV1 RTP depacketizer and packetizer
Add RTP packetizer and depacketizer according to (most)
of the official AV1 RTP specification. This enables
streaming via RTSP between ffmpeg and ffmpeg and has
also been tested to work with AV1 RTSP streams via
GStreamer.

It also adds the required SDP attributes for AV1.

AV1 RTP encoding is marked as experimental due to
draft specification status, debug amount reduced
and other changes suggested by Tristan.

Added optional code for searching the sequence
header to determine the first packet for broken
AV1 encoders / parsers.

Stops depacketizing on corruption until next keyframe,
no longer prematurely issues packet on decoding if
temporal unit was not complete yet.

Change-Id: I90f5c5b9d577908a0d713606706b5654fde5f910
Signed-off-by: Chris Hodges <chrishod@axis.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2025-02-26 12:32:22 -05:00
b3d73df80d aacenc: remove ANMR coder
If there's ever a rework of the AAC encoder, it won't start from here.
The codec, with all its oddities and tweaks needed to acheive good quality
has strayed far from the academic work upon which this coder was based on.
Its been 20 years since this paper was released, and no known existing
implementations, open-source or proprietary that we know of, are based on it.
2025-02-26 17:12:08 +01:00
9383533770 aacenc: remove support for AAC LTP profile
The LTP profile of AAC is... terrible.
It was an early 90's attempt at bridging the gap between speech
codecs and general purpose codecs. It did so by trying to exploit the fact
that most speech patterns are regular.

Unfortunately, it went about it the same way as AAC Main, by taking
the previous frame's samples, modifying them through an LPC filter,
transforming them back using a forward MDCT, putting the output
coefficients back into the current frame, and using delta coding.
But once again, they ignored basic mathematics and MDCT leakage.
Thankfully, because AAC LTP is meant to operate at very low bitrates,
the extreme quantization results in most leakage being irrelevant.

Unfortunately, the result is that the output sounds pretty much
terrible regardless of whether LTP is enabled or not.

This was the first attempt at trying to couple speech coding into AAC.
No, the second attempt did not succeed either.
Nnnneither did the third. Or fourth.

For the fifth one, they literally just jammed a speech codec into AAC
with USAC once they saw Opus do it.

Just drop support for encoding AAC LTP. It was always experimental
to begin with.
2025-02-26 17:12:08 +01:00
9b11fefb88 aacenc: remove support for AAC Main profile
The Main profile of AAC is... terrible.
It enables the use of delta coding across coefficients of two frames
to try to increase compression, and it enabled one more pole for TNS
filters.

What the AAC authors failed to take into account were basic
mathematics, as MDCT leakage (e.g. the spread of each frequency when
represented in a discrete spectrum) is significant in most audio codecs.
This leads to huge variations between each frame, basically rendering
prediction completely pointless.

In fact, enabling AAC-Main prediction does not, in general, even recoup
the metadata losses from signalling the profile and prediction properties
in the first place. So you lose efficiency by using AAC Main.

The rumor is that it was put in the AAC spec for patent reasons, though
patent-wise, it has about as much use as a patent for a bicycle designed
for use by snakes.

The only other thing AAC Main changes is it permits 3-pole TNS filters.
When AAC's bands are absolutely tiny, except for very high frequency bands,
where you're likely to use PNS instead.

Just get rid of it.
2025-02-26 17:12:04 +01:00
e24920375c Make mime-type award a bonus probe score
This changes the default behaviour of ffmpeg where content-type headers
on an input gives an absolut probe score (of 75) to instead give a bonus
score (of 30). This gives the probe a better chance to arrive at the
correct format by (hopefully) giving a large enough bonus to push edge
cases in the right direction (MPEG-PS vs MP3, I am looking at you) while
also not adversly punishing clearer cases (raw ADTS marked as
"audio/mpeg" for example).

This patch was regression tested against 20 million recent podcast
submissions (after content-type propagation was added to
original-storage), and 50k Juno vodcasts submissions (dito). No adverse
effects observed (but the bonus may still need tweaking if other edge
cases are detected in production).
2025-02-26 14:52:34 +01:00
5a526fdad0 avformat/mp3dec: Subtract known padding from duration
When an Info-tag is present, marking initial and trailing samples as
padding, those samples should not be included in the calculation of track
duration.

This solves a surprising user experience where converting a WAV->MP3->WAV,
ffprobe will show the duration of the mp3 as slightly longer than both the
input and the output.

As a result, the estimated duration and imprecise seek-results of some
FATE-tests have been updated.
2025-02-26 14:52:34 +01:00
da5353cf05 GOL-1361: Remove invalid CTTS sample_offset check
We checked in this places:
* In 8.6.1.3 of ISO/IEC 14496-12 about the CTTS box
* In Apples MOV spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-SW19
2025-02-26 14:52:34 +01:00