Commit Graph

114367 Commits

Author SHA1 Message Date
Marton Balint
ed6207274e avutil/channel_layout: add AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-16 19:49:39 +01:00
Marton Balint
44b2769619 avformat/pcm: decrease target audio frame per sec to 10
This makes the wav and pcm demuxer demux bigger packets, which is more
efficient.

As a side effect of the bigger packets, audio durations can become less exact
for command lines such as "ffmpeg -i $INPUT -c:a copy -t 1.0 $OUTPUT".

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-16 19:19:42 +01:00
Marton Balint
05936403f9 avformat/wavdec: use ff_pcm_default_packet_size for the default packet size
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-16 19:19:42 +01:00
Marton Balint
9c2c0c37f8 avformat/pcm: factorize and improve determining the default packet size
- Remove the 1024 cap on the number of samples, for high sample rate audio it
  was suboptimal, calculate the low neighbour power of two for the number of
  samples (audio blocks) instead.
- Make the function work correctly also for non-pcm codecs by using the stream
  bitrate to estimate the target packet size. A previous version of this patch
  used av_get_audio_frame_duration2() the estimate the desired packet size, but
  for some codecs that returns the duration of a single audio frame regardless
  of frame_bytes.
- Fallback to 4096/block_align*block_align if bitrate is not available.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-16 19:19:42 +01:00
Gyan Doshi
f5441e441f avformat/mpegtsenc: correct bitstream check
8559cce3c3 made the bitstream check generic using a LUT.
However, one of the comparisons which involves a bitwise AND
and equality check is faulty due to operator precedence.

First reported and analysed at
https://github.com/streamlink/streamlink/issues/5876

Fixes #10908
2024-03-16 14:30:05 +05:30
James Almer
aca7037e01 tools/target_dec_fuzzer: force experimental flag for decoders that need it
Otherwise they will not even open.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 22:38:13 -03:00
Timo Rothenpieler
b47abd5737 avfilter/vsrc_ddagrab: clear all flags of buffer texture
One some system, one some displays, for unknown reasons,
these contain rather bad flags that cause all kinds of weird
behaviour.
2024-03-16 00:44:58 +01:00
James Almer
cfa694d811 fate/wmavoice: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
59f5cf5c71 fate/vqf: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
e48b221144 fate/voice: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
9906bef5c4 fate/vorbis: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
85da6e5c44 fate/real: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
2262c9ab0c fate/pcm: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
540d1b14d8 fate/mpc: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
2df103528c fate/mp3: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
6d569aa80c fate/mov: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
b80b3947dd fate/monkeysaudio: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
be9d9b7aba fate/lossless-audio: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
8b96aca432 fate/libswresample: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
47362785ae fate/iamf: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
92c7e27373 fate/hlsenc: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
6887a0292f fate/gapless: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
f3f2932f75 fate/ffprobe: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:44:59 -03:00
James Almer
536dfe92e0 fate/ffmpeg: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:37:50 -03:00
James Almer
4c8b8bc52b fate/filter-audio: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:37:42 -03:00
James Almer
20581cea3e fate/fate-container: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:05:38 -03:00
James Almer
7416d216aa fate/demux: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:05:35 -03:00
James Almer
04ab5cc584 fate/audio: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:05:27 -03:00
James Almer
fc17af7f8d fate/atrac: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:05:22 -03:00
James Almer
8755e7eb74 fate/amrwb: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:05:18 -03:00
James Almer
7a10d6521f fate/amrnb: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:05:14 -03:00
James Almer
b3ab87d320 fate/alac: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:04:31 -03:00
James Almer
234268b4ed fate/adpcm: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:03:36 -03:00
James Almer
73095bc19e fate/ac3: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:03:36 -03:00
James Almer
136f1cdf0f fate/aac: add missing aresample filter dependency
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-15 12:03:36 -03:00
Marth64
4464b7eeb1 avformat/dvdvideodec: use int64_t for menu blocks_read and make format expressions portable
Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-15 15:50:35 +01:00
Andreas Rheinhardt
5f7eb4240a avcodec/tests/snowenc: Fix mixed declaration and code
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-15 15:31:58 +01:00
Andreas Rheinhardt
c00cd007e8 configure: Remove av_restrict
All versions of MSVC that support C11 (namely >= v19.27)
also support the restrict keyword, therefore av_restrict
is no longer necessary since 75697836b1.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-15 12:51:15 +01:00
Andreas Rheinhardt
53a51e70f2 avformat/internal: Remove declaration for ff_format_io_close_default()
Forgotten in d6799ee0e4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 22:53:50 +01:00
Andreas Rheinhardt
78e2be2377 fftools/ffmpeg_sched: Remove set-but-unused variable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 22:53:45 +01:00
Andreas Rheinhardt
09e6840cf7 avcodec/ppc/vp8dsp_altivec: Fix out-of-bounds access
h_subpel_filters_inner[i] and h_subpel_filters_outer[i / 2]
belong together and the former allows the range 0..6,
so the latter needs to support 0..3. But it has only three
elements. Add another one.
The value for the last element has been guesstimated
from subpel_filters in libavcodec/vp8dsp.c.

This is also intended to fix FATE-failures with UBSan here:
https://fate.ffmpeg.org/report.cgi?time=20240312011016&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Tested-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 22:20:00 +01:00
Andreas Rheinhardt
8e207bf463 avcodec/mpeg4videodec: Align idct-block appropriately
It is accessed via AV_RN64A in ff_simple_idct_put_int32_10bit().
Should fix the UBSan failures in the mpeg4-simple-studio-profile
test here:
https://fate.ffmpeg.org/report.cgi?time=20240312011016&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Tested-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 21:52:16 +01:00
Andreas Rheinhardt
cc2d2b665e avcodec/lossless_videoencdsp: Fix unaligned access
HAVE_FAST_UNALIGNED being true does not imply that
one can simply read from any pointer via *(long*).
It is undefined behaviour in case the pointer is not
sufficiently aligned; and even if it is, it is (likely)
a violation of the effective-type rules. Fix both
of these by using the appropriate AV_[RW]N macros.

Also, the current code used sizeof(long) as if this
were the CPU's native arithmetic size, but this is
not true on 64bit Windows. This has been fixed, too.

This affected huffyuv FATE-tests.

Tested-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 21:22:45 +01:00
Andreas Rheinhardt
7a089ed8e0 avformat/avidec: Fix integer overflow iff ULONG_MAX < INT64_MAX
Affects many FATE-tests, see
https://fate.ffmpeg.org/report.cgi?time=20240312011016&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 20:48:20 +01:00
James Almer
a327434df7 fate/ffmpeg: add missing idct decoder option to fate-ffmpeg-loopback-decoding
Should fix failures on x86_32 targets.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-14 16:44:12 -03:00
Andreas Rheinhardt
f9aa5457ff avcodec/ppc/h264dsp: Fix unaligned stores
Also fix an effective-type violation.
Exposed by https://fate.ffmpeg.org/report.cgi?time=20240312011016&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Tested-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 20:37:25 +01:00
Andreas Rheinhardt
f032f1326b avcodec/tiff_data: Remove incorrect GeoTIFF entries
They are incorrect according to [1]. They also share keys with valid
entries, so that it is unspecified which entry bsearch returns
in this case. Fix this by removing the incorrect values.

[1]: https://www.earthdata.nasa.gov/s3fs-public/imported/19-008r4.pdf

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 20:37:03 +01:00
Andreas Rheinhardt
282812d6dc avcodec/tiff_data: Avoid relocations for TiffGeoTagNameType
Instead store all the strings in one continugous string
(with internal \0) and use offsets to access the actual
substrings. This replaces the pointers to the strings
and therefore avoids relocations (and on x64, it actually
shrinks TiffGeoTagNameType by reusing padding to store
the offset field).

This saves 720B of .data.rel.ro and 1080B of .rela.dyn
(containing the relocation records) here while increasing
.rodata by 384B.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-14 20:37:03 +01:00
James Almer
ad6347fc37 fate/ffmpeg: add a -threads input option to the loopback decoder
Honor the requested value passed when calling make fate.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-14 10:48:09 -03:00
James Almer
d925b2e139 fate/ffmpeg: add a test for loopback decoding
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-14 10:00:03 -03:00