aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/iamf_writer: fix layout checks when demixing_info is not presentJames Almer2025-06-241-1/+1
| | | | | | Fixes -Wtautological-overlap-compare warnings Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: use named constants in more placesJames Almer2025-06-241-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: reindent after previous commitJames Almer2025-06-241-8/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: add extra constrains for Parameter Sets in Audio ElementsJames Almer2025-06-241-7/+33
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: factor out getting loudspeaker_layout valuesJames Almer2025-06-241-26/+39
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf: fix setting channel layout for Scalable layersJames Almer2025-06-2411-73/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way streams are coded in an IAMF struct follows a scalable model where the channel layouts for each layer may not match the channel order our API can represent in a Native order layout. For example, an audio element may have six coded streams in the form of two stereo streams, followed by two mono streams, and then by another two stereo streams, for a total of 10 channels, and define for them four scalable layers with loudspeaker_layout values "Stereo", "5.1ch", "5.1.2ch", and "5.1.4ch". The first layer references the first stream, and each following layer will reference all previous streams plus extra ones. In this case, the "5.1ch" layer will reference four streams (the first two stereo and the two mono) to encompass six channels, which does not match out native layout 5.1(side) given that FC and LFE come after FL+FR but before SL+SR, and here, they are at the end. For this reason, we need to build Custom order layouts that properly represent what we're exporting. ---- Before: Stream group #0:0[0x12c]: IAMF Audio Element: Layer 0: stereo Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Layer 1: 5.1(side) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Layer 2: 5.1.2 Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Layer 3: 5.1.4 Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent) ---- AFter: Stream group #0:0[0x12c]: IAMF Audio Element: Layer 0: stereo Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Layer 1: 6 channels (FL+FR+SL+SR+FC+LFE) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Layer 2: 8 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Layer 3: 10 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR+TBL+TBR) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Signed-off-by: James Almer <jamrial@gmail.com>
* tests/iamf: rename BACK to SIDE filterchain labels in the 5.1.4 iamf testsJames Almer2025-06-243-3/+3
| | | | | | Cosmetic change to reflect the actual channels used in the layouts. Signed-off-by: James Almer <jamrial@gmail.com>
* tests/iamf: reorder muxed streamsJames Almer2025-06-243-45/+45
| | | | | | | Follows the proper order defined by the spec, even if mostly cosmetic, and is also preparation for a following change. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: try to retype the channel layout for ambisonics_mode == 0James Almer2025-06-241-5/+7
| | | | | | | In most cases, the channel ids will match the standard Ambisonic Order, saving us the need to use a custom order layout. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: ensure each layer's channel layout contains all ↵James Almer2025-06-241-2/+22
| | | | | | channels from the previous one Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: prevent overreads in update_extradataJames Almer2025-06-241-5/+12
| | | | | | | | | Fixes: libavcodec/put_bits.h:232:32: runtime error: shift exponent -19 is negative Fixes: Assertion n>=0 && n<=32 failed at ./libavcodec/get_bits.h:406 Fixes: 398527871/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6602025714647040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/f_ebur128: properly propagate true peakNiklas Haas2025-06-241-1/+3
| | | | | | | | After 3b26b782ee, `ebur128->true_peak` was only set to the maximum of the current "true peak per frame" values, when it should report the true peak for the entire stream. Fixes: 3b26b782eeded9b9ab7fac013cd1a83a30d68206
* hwcontext_vulkan: fix 85c0364b703Lynne2025-06-241-0/+3
| | | | | The issue is that by moving the mprops loading later, we inadvertently broke some earlier dependencies.
* avcodec/g728dec: Remove AVCodec.sample_fmtsAndreas Rheinhardt2025-06-231-2/+0
| | | | | | | | | | It is unnecessary for decoders (they just set AVCodecContext.sample_fmt). This also fixes a warning with Clang (because sample_fmts is set directly, not via CODEC_SAMPLEFMTS). Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* hwcontext_vulkan: add workaround for broken Nvidia driversLynne2025-06-241-0/+6
|
* hwcontext_vulkan: move ReBAR check into a new function and use it laterLynne2025-06-241-17/+26
| | | | | | | | The issue is that vulkan_device_create_internal() is only called for devices that lavu creates by itself. For external devices, this was never done. This also solves some mid-function declaration warnings.
* avformat/iff: Check nb_channels == 0 in CHNLMichael Niedermayer2025-06-231-1/+1
| | | | | | | | | | Fixes: division by 0 Fixes: 418396712/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6104388018176000 Fixes: 418478219/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4569544410857472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/target_dec_fuzzer: adjust threshold for VP8Michael Niedermayer2025-06-231-0/+1
| | | | | | | | Fixes: Timeout Fixes: 416589179/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP8_fuzzer-5432788428062720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Add FUNDING.jsonMichael Niedermayer2025-06-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have been contacted by Monet du Plessis of the etherium foundation and Natascha Buck (Grants at the Better Internet Foundation) "The Ethereum Foundation is thrilled to inform you that your contribution to open-source software development through your work on ffmpeg https://github.com/FFmpeg/FFmpeg has been recognized and rewarded by the Devcon team! Your project played a fundamental role in the success of Devcon <http://devcon.org/>, helping to create a more meaningful experience for the Ethereum community. In collaboration with Drips Network <https://www.drips.network/>, we are pleased to award you $2,240.00 in appreciation of your efforts and to support your continued efforts in open-source development." To be able to claim donations through the drips network we need to specify a wallet to do so in FUNDING.json This will also allow FFmpeg to receive future funding and donations through the drips network. The specified wallet is a safe wallet backed by a ledger hw wallet. We can later change who controls the safe wallet. (For example it could be passed on to the SPI treasurer) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/target_dec_fuzzer: Adjust RV60 thresholdMichael Niedermayer2025-06-231-0/+1
| | | | | | | | Fixes: Timeout Fixes: 410324670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5697706586865664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/osq: Request a coding mode 2 sampleMichael Niedermayer2025-06-231-0/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/osq: Switch back to av_ceil_log2()Michael Niedermayer2025-06-231-1/+2
| | | | | | | | | | | | | This returns to code closer to prior 56c334d732dbbce43b0c8fc0809ec545b7946832 The prior fixes should limit the sum and avoid the need for double argument log2() Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:406 Fixes: 410109093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6550900028276736 No testcases except fuzzers Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/osq: Add note about update_stats() countMichael Niedermayer2025-06-231-0/+2
| | | | | | It seems this is basically unused and unfinished code Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/osq: Fix signed integer overflow in update_stats()Michael Niedermayer2025-06-231-2/+2
| | | | | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 410109093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6550900028276736 Note, none of the available osq files uses update_stats(), this change may fix or break files using coding_mode == 2. The code prior looks wrong though Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/hcadec: fix header parsing after 'comp' sectionPavel Roslyy2025-06-231-0/+1
| | | | | | | Need to skip 2 more bytes because comp sections are 12 bytes long. Fixes decryption since ciph_type is now being set. Signed-off-by: Pavel Roslyy <roslypav@gmail.com>
* avfilter/codecview: Enable QP visualization for H.264Timothee2025-06-231-2/+3
| | | | | | | | | The codecviewfilter, when used with qp=1, did not display quantization parameter values for H.264 streams because the QP table extraction was restricted to MPEG-2 video. This patch enables H.264 support by updating ff_qp_table_extractto accept AV_VIDEO_ENC_PARAMS_H264. This allows for correct QP overlay on H.264 video Signed-off-by: Timothee <timothee.informatique@regaud-chapuy.fr> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtp: G.728 muxing and demuxingPeter Ross2025-06-232-1/+2
|
* avformat/aiff: G.728 muxing and demuxingPeter Ross2025-06-232-0/+4
|
* avformat/riff: G.728 muxing and demuxingPeter Ross2025-06-232-0/+3
|
* avformat/g728dec: raw G.728 demuxerPeter Ross2025-06-234-0/+61
|
* avcodec/g728dec: G.728 decoderPeter Ross2025-06-2311-2/+306
|
* avcodec/lpc_functions: compute_lpc_coefs: add starting lpc order and err ↵Peter Ross2025-06-235-9/+17
| | | | cache parameters
* avcodec/g728_template: make hist parameter constantPeter Ross2025-06-231-1/+1
|
* avcodec/g728_template: do_hybrid_window() templatePeter Ross2025-06-232-47/+68
| | | | intended for use by RealAudio 2.0 (28.8k) and G.728 decoders.
* avcodec/mss2dsp: use FF_PTR_ADD to add offsets to a pointerJames Almer2025-06-221-1/+1
| | | | | | | Fixes: libavcodec/mss2dsp.c:59:14: runtime error: applying zero offset to null pointer Tested-by: Kacper Michajlow <kasper93@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: add more sanity checks when reading clap boxesJames Almer2025-06-221-0/+5
| | | | | | | | | If the apperture window is bigger than the canvas, then the clap box is invalid and there's no point calculating cropping values. Fixes: libavformat/mov.c:1295:14: runtime error: -256 is outside the range of representable values of type 'unsigned long' Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/x86/f_ebur128: replace AVX2 instruction with AVX equivalentJames Almer2025-06-221-1/+1
| | | | | | | Using vpbroadcastq in an AVX function will result in SIGILL errors on pre Haswell/Zen processors. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/hwcontext_vulkan: disable host transfers if ReBAR is disabledNiklas Haas2025-06-221-4/+21
| | | | | | | | | | | | | | | | | | | This feature fundamentally relies on host-visible VRAM, which restricts the set of available memory types to (typically) host-visible device-local ones. When resizable BAR is disabled, this memory type is usually limited to e.g. 256 MiB in size, which is just plain insufficient for allocation of general purpose GPU images, causing OOM errors on even the simplest of commands. The easiest solution is to disable host transfers entirely on machines without host-addressable VRAM. In theory, we could try and recover the use of host transfers for images which are *not* restricted to device-local memory types, but this is rarely the case in practice, and the effort required would exceed the benefit, especially since ReBAR is a standard feature on all platforms recent enough to have Vulkan drivers, and only occasionally disabled in the UEFI for by default for some hare-brained notion of "backwards compatibiility" with ancient software.
* avcodec/mips: fix build failure when specific decoder/encoder enabledPeter Ross2025-06-221-0/+24
| | | | | | | | | | acelp_kelvin, g729, qcelp, sipr and wmavoice decoders all depend upon mips/{acelp_filters_mips,celp_filters_mips,acelp_vectors_mips}.o when arch is mips. g723_1 depends on mips/{celp_filters_mips,acelp_vectors_mips}.o. comfortnoise, evrc, ra144 and ra288 depend on mips/celp_filters_mips.o.
* configure: h264_vulkan_encoder depends on atsc_a53Peter Ross2025-06-221-1/+1
|
* configure: cbs_apv depends on cbsPeter Ross2025-06-221-0/+1
|
* avcodec/mpeg4videoenc: Fix data race when using AC predictionAndreas Rheinhardt2025-06-211-1/+1
| | | | | | | | | | | | | | | | | | | The check for whether we can use the fast path to process AC coefficients used the qscale value belonging to a different slice; this worked in practice, because the predicted AC values are zero in this case, so it does not matter whether we use the fast or the slow path. Fix this by checking for first_slice_line instead. This fixes all the races in the encoding part of the vsynth*-mpeg4-thread tests (and fixes them if no frame threading is in use for the decoding part). (The left prediction check may use data from a different slice, too, but said slice is always processed by the same thread, so that no race can happen. Given that out-of-slice AC values are zero, it does not matter whether we use the fast path or the slow path either.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Reduce stack usage when copying MpegEncContextAndreas Rheinhardt2025-06-211-16/+13
| | | | | | (GCC did not perform this on its own; Clang did.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263enc: Simplify encoding umotion vectorsAndreas Rheinhardt2025-06-211-28/+10
| | | | | | There is no need to use two loops. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video: Move ff_mpeg4_pred_dc() to decoderAndreas Rheinhardt2025-06-212-46/+45
| | | | | | | | Only used by the decoder now that the encoder solves out-of-slice predictions by setting the out-of-slice values appropriately. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/{ituh263,mpeg4video}enc: Simplify out-of-slice DC predictionAndreas Rheinhardt2025-06-214-7/+55
| | | | | | | | | Now that every slice (and therefore every thread) uses its own DC array, one can simply set the out-of-slice DC values to its expected values (this is not possible for the decoders due to error resilience). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Allocate dc_val for each encoder sliceAndreas Rheinhardt2025-06-212-3/+13
| | | | | | | | | | | | | | This fixes data races (which are UB) in the MPEG-4 and H.263+ encoder when predicting DC values; these encoders unconditionally read values from the line above the current line and only check lateron (via first_slice_line) whether said prediction can be used at all. It will also allow to remove said checks (by setting the entries to 1024 upon opening a new slice). The vsynth{1,2,3,_lena}-mpeg4-thread FATE tests were affected by this: https://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-tsan-slices&time=20250613002615 Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1: Only keep mb_type[0]Andreas Rheinhardt2025-06-216-68/+66
| | | | | | The chroma mb_type[1] and mb_type[2] pointers are unused. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Only keep MpegEncContext.dc_val[0]Andreas Rheinhardt2025-06-2111-39/+35
| | | | | | | The chroma dc_val pointers are mostly unused (accesses use dc_val[0] and block_index), so remove them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Zero-init mbintra_tableAndreas Rheinhardt2025-06-211-2/+1
| | | | | | | | | | Up until now, they are marked as dirty (filled with 1), meaning that the entries are in need of a reset via ff_clean_intra_table_entries(); but actually, the entries are initialized to the state that ff_clean_intra_table_entries() produces, so they can be marked as non-dirty (i.e. filled with 0). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>