aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/af_channelmap: fix error message if FL source channel was missingMarton Balint2024-03-241-2/+2
| | | | | | | | FL channel ID is 0, so for an unset value we must check for ID < 0. Regression since 1f96db959c1235bb7079d354e09914a0a2608f62. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: respect channel order when parsing and creating chan atomMarton Balint2024-03-241-253/+211
| | | | | | | | Previously we always assumed that the channels are in native order, even if they were not. The new channel layout API allows us to signal the proper channel order, so let's do so. Fixes ticket #98.
* configure: Explicitly check for static_assert, _Static_assertAndreas Rheinhardt2024-03-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C11 provides static assertions via _Static_assert and provides static_assert as a convenience define for this in assert.h. Our codebase uses the latter, as _Static_assert has actually already been deprecated in C23. Not all toolchains that declare support for C11 actually support it; e.g. MSVC 19.27 does not support _Static_assert, but somehow supports static_assert. MSVC 19.27 admits to be a "preview implementation of the ISO C11 standard", so this is not surprising (MSVC 19.28 does not come with this caveat). Furthermore some FATE boxes [1] use old GCC toolchains (with only experimental support for C11) where _Static_assert is supported, but assert.h does not provide the fallback define. They are broken since the first usage of static_assert. This commit therefore checks whether static_assert and _Static_assert work with assert.h included; if not, configure errors out. This intentionally drops support for MSVC 19.27. Users like the old FATE boxes above can still add -Dstatic_assert=_Static_assert to cflags as a workaround if desired. [1]: https://fate.ffmpeg.org/report.cgi?time=20240321123620&slot=sh4-debian-qemu-gcc-4.7 Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Combine "Packet corrupt" logmessagesAndreas Rheinhardt2024-03-241-4/+3
| | | | | | | Otherwise these statements might be torn apart by av_logs from other threads. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Restore pkt->stream_index assert checkAndreas Rheinhardt2024-03-241-44/+31
| | | | | | | | | | It has been moved after "st = s->streams[pkt->stream_index]" in b140b8332c617b0eef4f872f3ef90c469e99920f. Deduplicate ff_read_packet() and ff_buffer_packet() while fixing this. This also fixes shadowing in ff_read_packet(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/film_grain_params: remove do loop in CHECK macroLeo Izen2024-03-241-3/+1
| | | | | | | | The continue statement will break out of the do/while loop, not the outer loop as intended. This is one (compound) statement anyway, so we can remove the do/while entirely. Signed-off-by: Leo Izen <leo.izen@gmail.com>
* avutil/film_grain_params: remove unused variablesLeo Izen2024-03-241-3/+0
| | | | | | These variables are never read from, so they trigger -Wunused-variables Signed-off-by: Leo Izen <leo.izen@gmail.com>
* x86: Update x86inc.asmHenrik Gramner2024-03-2412-270/+519
| | | | | | Make things up-to-date with upstream. https://code.videolan.org/videolan/x86inc.asm
* x86: Avoid using 'd' as an argument nameHenrik Gramner2024-03-242-18/+18
| | | | | x86inc.asm adds defines for <argument_name>{b,w,d,q} which clashes with the nasm d{b,w,d,q} pseudo-instructions for writing initialized data.
* avcodec/hevcdec: apply AOM film grain synthesisNiklas Haas2024-03-232-8/+23
| | | | Following the usual logic for H.274 film grain.
* avcodec/h2645_sei: decode AFGS1 T.35 SEINiklas Haas2024-03-233-1/+29
| | | | I restricted this SEI to HEVC for now, until I see a H.264 sample.
* avcodec/aom_film_grain: implement AFGS1 parsingNiklas Haas2024-03-232-0/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the AOMedia Film Grain Synthesis 1 (AFGS1) spec: https://aomediacodec.github.io/afgs1-spec/ The parsing has been changed substantially relative to the AV1 film grain OBU. In particular: 1. There is the possibility of maintaining multiple independent film grain parameter sets, and decoders/players are recommended to pick the one most appropriate for the intended display resolution. This could also be used to e.g. switch between different grain profiles without having to re-signal the appropriate coefficients. 2. Supporting this, it's possible to *predict* the grain coefficients from previously signalled parameter sets, transmitting only the residual. 3. When not predicting, the parameter sets are now stored as a series of increments, rather than being directly transmitted. 4. There are several new AFGS1-exclusive fields. I placed this parser in its own file, rather than h2645_sei.c, since nothing in the generic AFGS1 film grain payload is specific to T.35, and to compartmentalize the code base.
* avcodec/aom_film_grain: add AOM film grain synthesisNiklas Haas2024-03-233-0/+925
| | | | | | | | | | | | | | | | | | | Implementation copied wholesale from dav1d, sans SIMD, under permissive license. This implementation was extensively verified to be bit-exact, so it serves as a much better starting point than trying to re-engineer this from scratch for no reason. (I also authored the original implementation in dav1d, so any "clean room" implementation would end up looking much the same, anyway) The notable changes I had to make while adapting this from the dav1d code-base to the FFmpeg codebase include: - reordering variable declarations to avoid triggering warnings - replacing several inline helpers by avutil equivalents - changing code that accesses frame metadata - replacing raw plane copying logic by av_image_copy_plane Apart from this, the implementation is basically unmodified.
* avutil/film_grain_params: add av_film_grain_params_select()Niklas Haas2024-03-234-1/+76
| | | | | | | | Common utility function that can be used by all codecs to select the right (any valid) film grain parameter set. In particular, this is useful for AFGS1, which has support for multiple parameters. However, it also performs parameter validation for H274.
* avutil/frame: clarify AV_FRAME_DATA_FILM_GRAIN_PARAMS usageNiklas Haas2024-03-231-0/+4
| | | | | To allow for AFGS1 usage, which can expose multiple parameter sets for a single frame.
* avcodec/libdavv1d: signal new AVFilmGrainParams membersNiklas Haas2024-03-231-0/+10
| | | | | | Not directly signalled by AV1, but we should still set this accordingly so that users will know what the original intended video characteristics and chroma resolution were.
* avcodec/av1dec: signal new AVFilmGrainParams membersNiklas Haas2024-03-231-0/+10
| | | | | | Not directly signalled by AV1, but we should still set this accordingly so that users will know what the original intended video characteristics and chroma resolution were.
* avcodec/h2645_sei: signal new AVFilmGrainParams membersNiklas Haas2024-03-231-18/+28
| | | | | | H.274 specifies that film grain parameters are signalled as intended for 4:4:4 frames, so we always signal this, regardless of the frame's actual subsampling.
* ffprobe: adapt to new AVFilmGrainParamsNiklas Haas2024-03-231-15/+26
| | | | | Follow the establish convention of printing the bit depth metadata per-component.
* avfilter/vf_showinfo: adapt to new AVFilmGrainParamsNiklas Haas2024-03-231-11/+15
|
* avutil/film_grain_params: initialize VCS to UNSPECIFIEDNiklas Haas2024-03-231-2/+9
|
* avutil/film_grain_params: add metadata to common structNiklas Haas2024-03-233-4/+62
| | | | | | | | | | | | This is needed for AV1 film grain as well, when using AFGS1 streams. Also add extra width/height and subsampling information, which AFGS1 cares about, as part of the same API bump. (And in principle, H274 should also expose this information, since it is needed downstream to correctly adjust the chroma grain frequency to the subsampling ratio) Deprecate the equivalent H274-exclusive fields. To avoid breaking ABI, add the new fields after the union; but with enough of a paper trail to hopefully re-order them on the next bump.
* lavc/vvc_parser: small cleanup for styleJun Zhao2024-03-231-4/+4
| | | | | | | small cleanup for style, redundant semicolons, goto labels, in FFmpeg, we put goto labels at brace level. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/cbs_h266_syntax_template: Check tile_yMichael Niedermayer2024-03-231-0/+2
| | | | | | | | Fixes: out of array access Fixes: 67021/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4883576579489792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tests/fate/ffmpeg: evaluate thread count in fate-run.sh rather than makeAnton Khirnov2024-03-231-1/+1
| | | | Fixes fate-ffmpeg-loopback-decoding with THREADS=random*
* avformat/jpegxl_anim_dec: set pos for generic indexLeo Izen2024-03-231-0/+2
| | | | | | | | avpkt->pos needs to be set for generic indexing or features such as the stream_loop option will not work. Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Leo Izen <leo.izen@gmail.com>
* Changelog: add dnn libtorch backend entryWenbin Chen2024-03-231-0/+1
| | | | Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* doc/muxers: add hdsStefano Sabatini2024-03-231-0/+39
|
* doc/muxers: add gxfStefano Sabatini2024-03-231-0/+12
|
* lavf/gxfenc: return proper error codes in case of failureStefano Sabatini2024-03-231-6/+6
|
* lavf/gxfenc: consistently use snake_case in function namesStefano Sabatini2024-03-231-10/+10
|
* avcodec/mediacodec_wrapper: remove unnecessary NULL checks before calling ↵Matthieu Bouron2024-03-231-142/+47
| | | | | | Delete{Global,Local}Ref() Delete{Global,Local}Ref already handle NULL.
* avcodec/mediacodec_wrapper: use an OFFSET() macro where relevantMatthieu Bouron2024-03-231-66/+72
| | | | Reduces a bit the horizontal spacing.
* avcodec/jni: remove unnecessary NULL checks before calling DeleteLocalRef()Matthieu Bouron2024-03-231-11/+3
| | | | Delete{Global,Local}Ref() already handle NULL.
* avcodec/jni: use size_t to store structure offsetsMatthieu Bouron2024-03-231-1/+2
|
* avformat: add Android content resolver protocol supportMatthieu Bouron2024-03-234-0/+164
| | | | Handles Android content URIs starting with content://.
* avcodec: add av_jni_{get,set}_android_app_ctx() helpersMatthieu Bouron2024-03-233-0/+67
| | | | | This will allow users to pass the Android ApplicationContext which is mandatory to retrieve the ContentResolver responsible to resolve/open Android content URIS.
* avformat: Make init function out of write_header functions if possibleAndreas Rheinhardt2024-03-225-10/+10
| | | | | | Also mark them as av_cold while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Enforce codec_id where appropriateAndreas Rheinhardt2024-03-2211-43/+88
| | | | | | | | | | E.g. chromaprint expects to be fed 16bit signed PCM in native endianness, yet there was no check for this. Similarly for other muxers. Use the new FF_OFMT_FLAG_ONLY_DEFAULT_CODECS to enfore this where appropriate, e.g. for pcm/raw muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ttmlenc: Avoid unnecessary blockAndreas Rheinhardt2024-03-221-29/+26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Add flag for "only default codecs allowed"Andreas Rheinhardt2024-03-2227-169/+72
| | | | | | | | AVOutputFormat has default codecs for audio, video and subtitle and often these are the only codecs of this type allowed. So add a flag to AVOutputFormat so that this can be checked generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Enforce one-stream limit where appropriateAndreas Rheinhardt2024-03-2219-4/+41
| | | | | | | | | | Several muxers (e.g. pcm muxers) did not check the number of streams even though the individual streams were not recoverable from the muxed files. This commit changes this by using the FF_OFMT_MAX_ONE_OF_EACH flag where appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Add flag for "not more than one stream of each type"Andreas Rheinhardt2024-03-2238-237/+239
| | | | | | | | | | | | | | | | More exactly: Not more than one stream of each type for which a default codec (i.e. AVOutputFormat.(audio|video|subtitle)_codec) is set; for those types for which no such codec is set (or for which no designated default codec in AVOutputFormat exists at all) no streams are permitted. Given that with this flag set the default codecs become more important, they are now set explicitly to AV_CODEC_ID_NONE for "unset"; the earlier code relied on AV_CODEC_ID_NONE being equal to zero, so that default static initialization set it accordingly; but this is not how one is supposed to use an enum. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fate/filter-audio: Don't use pcm output for channelsplit testAndreas Rheinhardt2024-03-222-4/+4
| | | | | | | | | | | This test muxes two streams into a single pcm file, although the two streams are of course not recoverable from the output (unless one has extra information). So use the streamhash muxer instead (which also provides coverage for it; it was surprisingly unused in FATE so far). This is in preparation for actually enforcing a limit of one stream for the PCM muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux_utils: Don't report that AV_CODEC_ID_NONE can be muxedAndreas Rheinhardt2024-03-221-3/+4
| | | | | | | | If AVOutputFormat.video_codec, audio_codec or subtitle_codec is AV_CODEC_ID_NONE, it means that there is no default codec for this format and not that it is supported to mux AV_CODEC_ID_NONE. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/amr: Move write_header closer to muxer definitionAndreas Rheinhardt2024-03-221-17/+15
| | | | | | Avoids one #if. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSHAndreas Rheinhardt2024-03-2211-28/+36
| | | | | | | It better reflects that this is a muxer-only flag. Also document the flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavformat/westwood_audenc: Use proper logcontextAndreas Rheinhardt2024-03-221-3/+3
| | | | | | (AVStream did not have an AVClass when this muxer was added.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mp3enc: Improve query_codecAndreas Rheinhardt2024-03-221-1/+5
| | | | | | | Signal that anything except MP3 and the ID3V2 attached pic types are forbidden. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: Use av_realloc_array(), improve overflow checkAndreas Rheinhardt2024-03-221-2/+3
| | | | | | | | Also use sizeof of the proper type, namely sizeof(**sd) and not sizeof(*sd). Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>