aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/vc2enc: Use LUT to avoid repeated av_log2()Andreas Rheinhardt2025-05-271-2/+6
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ffv1enc: Fix explicitly set -slicecrc 2Andreas Rheinhardt2025-05-271-2/+3
| | | | | | | | | crcref needs to be set properly iff ec is two, regardless of whether it has been explicitly set by the user or set by default based on level/version. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* vulkan_ffv1: fix golomb coding for non-RGB streamsLynne2025-05-271-1/+2
| | | | | The run_index is reset on each plane, unlike with RGB, where its reset once per slice.
* vulkan_ffv1: small cleanup for golombLynne2025-05-271-1/+2
| | | | | Split up computation of the offset in the same way that the range coder version does it.
* Makefile: Split ALLFFLIBSMichael Niedermayer2025-05-261-1/+8
| | | | | | This matches other lists and reduces conflicts between patches Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: disallow buggy flags combinationGyan Doshi2025-05-261-0/+6
| | | | | Use of hybrid_fragmented and faststart together can result in files with loss of sync and bitstream parsing errors upon playback.
* avcodec/x86/vp9: Add AVX-512ICL for 16x16 and 32x32 10bpc inverse transformsHenrik Gramner2025-05-264-2/+1176
|
* configure: Use MSYSTEM_CARCH for default arch on msys2Coia Prant2025-05-261-0/+2
| | | | | | | | | | | | | | | | | | | On msys2, `uname -m` returns the architecture of the base msys2 layer. On Windows on arm64, the base msys2 layer itself is still x86_64 only, even if running with e.g. the clangarm64 where the windows native applications are built as aarch64. If MSYSTEM_CARCH is set, use this instead of `uname -m` for the default architecture. This gives the correct behaviour for the clangarm64 environments. It also gives the correct default for the 32 bit x86 environments such as `mingw32`. (On `mingw32`, the fact that `uname -m` returned `x86_64` hasn't been an issue, as both that and `i686` gets normalized into `x86` internally in ffmpeg's configure.) Signed-off-by: Coia Prant <coiaprant@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/mpeg4videodec: Use union to save spaceAndreas Rheinhardt2025-05-261-2/+4
| | | | | | At most one of block32 and dpcm_macroblock is used at any given time. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Remove h263_plusAndreas Rheinhardt2025-05-265-11/+10
| | | | | | | | It is only used to indicate to ff_h263_show_pict_info() that we are decoding H.263+; pass this information via a function parameter instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263enc: Don't use h263_plus fieldAndreas Rheinhardt2025-05-262-3/+2
| | | | | | It is equal to codec_id == AV_CODEC_ID_H263P, check for that instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Check h263_aic, not h263_plus for allocating dc_valAndreas Rheinhardt2025-05-262-2/+5
| | | | | | | | | This means that these buffers won't be allocated any more for H.263+ with AIC disabled. Also remove setting h263_plus for the RV20 encoder, as it has only been done to force allocating dc_val. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move mpeg_quant to {Mpeg4Dec,MPVEnc}ContextAndreas Rheinhardt2025-05-2611-25/+28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Simplify check for unquantizing inter blocksAndreas Rheinhardt2025-05-265-8/+14
| | | | | | | Just ensure that dct_unquantize_inter is set iff it is used and check for the function pointer instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Document which codecs take which codepathAndreas Rheinhardt2025-05-261-0/+6
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/idctdsp: Only try to initialize xvid idct if it is usedAndreas Rheinhardt2025-05-263-12/+6
| | | | | | | This allows to remove checks from ff_xvid_idct_init() (and also the AVCodecContext* parameter). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/xvididct: Remove always-true checksAndreas Rheinhardt2025-05-261-11/+5
| | | | | | | | | ff_xvid_idct_init() is now only called from ff_idctdsp_init() and only if idct_algo is FF_IDCT_XVID. This also implies that it is unnecessary to initalize the permutation on our own. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: Remove unnecessary ff_xvid_idct_init()Andreas Rheinhardt2025-05-261-4/+0
| | | | | | | | | | | | | | | It is unnecessary: If the dst context is not already initialized, then it will be initialized by memcpy(dst, src, sizeof(*dst), which already initializes the IDCT to the desired one, potentially followed by ff_mpv_common_init(), which does not touch the IDCT. (This call has been added in f89d76c10355242c39b08f253c1d1524f45ef778; the aforementioned copying took place back then, too, but ff_mpv_common_init() reinitialized the IDCT to a non-xvid one, therefore the initialization here has been added to fix multithreaded decoding.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videoenc: Use smaller scope for variableAndreas Rheinhardt2025-05-261-2/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videoenc: Split writing blocks into intra and interAndreas Rheinhardt2025-05-261-47/+43
| | | | | | | | | | | These are sufficiently different to warrant their own functions; in particular, the earlier code had two callsites for the actual "write block" function, one for intra and one for inter, yet the "write block" function nevertheless performed a check (that the compiler can't optimize away) for whether the current MB is intra or not. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videoenc: Remove no-output codeAndreas Rheinhardt2025-05-261-76/+0
| | | | | | | | | | | | | | | While it offers modest speedups compared to the ordinary code, removing it completely offers even bigger speedups; and given that these speedups also exist in the ordinary mode, they are even more important. The no-output code has a 7.8% performance improvement (based on benchmarking mpeg4_encode_mb()), yet removing the no-output code resulted in a 9.4% improvement. Furthermore, the no-output code was broken for the majority of its existence (until 9207dc3b0db368bb9cf5eb295cbc1129c2975e31) and no one complained, so it is likely not used at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video: Nuke ff_mpeg4_init_rl_intra()Andreas Rheinhardt2025-05-263-16/+3
| | | | | | | | The MPEG-4 decoder can now initialize ff_mpeg4_rl_intra directly given that the MPEG-4 encoder no longer wants it performed, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videoenc: Simplify creating LUTAndreas Rheinhardt2025-05-261-90/+71
| | | | | | | | | | | | | | | | | | | | There four cases for the LUT entry: An ordinary entry or one of three escaping methods. Three of these methods are only rarely possible --they correspond to the 102 codes of the underlying VLC and so only 102 of 16384 entries are possible. The earlier code would nevertheless try them all for every LUT entry and use the best one; the new code meanwhile only uses one method (the fallback one (i.e. the worst)) for them all and only processes the 102 valid entries afterwards. The implementation used also means that index_run, max_level and max_run of the RLTable are no longer needed; the earlier code would initialize said static tables although they are only used for a short time to initialize something else. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Reduce stack usageAndreas Rheinhardt2025-05-262-4/+17
| | | | | | | | | | | | | | Multiple PutBitContexts are used when encoding partitioned frames. When there are multiple candidates for macroblock types, multiple states (namely the state before encoding the current MB, the best state among the ones already tried and the current one) need to be kept; duplicates of the PutBitContexts are among this state. The temporary buffers for them are kept on the stack in encode_thread() and their size is quite generous (MAX_MB_SIZE - 3000 bytes). This commit uses tighter bounds, bringing the size of the pb2 buffer down to 15 bytes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: Don't initialize unused parts of RLTablesAndreas Rheinhardt2025-05-261-3/+0
| | | | | | | | The reversible VLC tables use a simpler escaping method than the ordinary VLCs: It does not use max_run, max_level etc. and therefore one does not need to initialize these at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Move calculating gob_index to {intel,itu}h263dec.cAndreas Rheinhardt2025-05-263-5/+5
| | | | | | This avoids checks for whether it should be calculated at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Set gob_index once during initAndreas Rheinhardt2025-05-262-13/+8
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pcm: Use av_unreachable() for unreachable codeAndreas Rheinhardt2025-05-261-0/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Use av_unreachable() for unreachable codeAndreas Rheinhardt2025-05-261-3/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/msmpeg4dec: Use av_unreachable() for unreachable codeAndreas Rheinhardt2025-05-261-0/+6
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Use av_unreachable() for unreachable codeAndreas Rheinhardt2025-05-261-3/+7
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/asvenc: Simplify writing extradataAndreas Rheinhardt2025-05-261-2/+2
| | | | | | | | | | | | | It is confusing, because the AV_RL32("ASUS") already returns an endian-independent value, so converting it via av_le2ne32() makes no real sense: one would need to transform the native value to le and write it as a natie endian uint32_t for it to make sense (the current code only works because le2ne32 and ne2le32 are the same for both endianness that we care about). Or one can just use AV_RL32 and create the number via MKTAG(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/asvenc: Combine writing bitsAndreas Rheinhardt2025-05-261-17/+22
| | | | | | | | Removes implicit checks for "do I need to output the buffer now?". Codesize with Clang 19 with -O3 decreased from 7136B to 6108B (although asv2_put_level() is now inlined). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/asvenc: Don't waste bits encoding non-visible partAndreas Rheinhardt2025-05-263-55/+84
| | | | | | | | | | | | | | | | | | | | Up until now, the encoder replicated all the border pixels for incomplete 16x16 macroblocks. In case the available width or height is <= 8, some of the luma blocks of the MB do not correspond to actual input, so that we should encode them using the least amount of bits. Zeroing the block coefficients (as this commit does) achieves this, replicating the pixels and performing an FDCT does not. This commit also removes the frame copying code for insufficiently aligned dimensions. The vsynth3-asv[12] FATE tests use a 34x34 input file and are therefore affected by this. As the ref updates show, the size and checksum of the encoded changes, yet the decoded output stays the same. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/h2645_parse: More descriptive NALU header errorFrank Plowman2025-05-251-2/+4
| | | | Signed-off-by: Frank Plowman <post@frankplowman.com>
* lavc/vvc: Fix divide-by-zero in LMCS param derivationFrank Plowman2025-05-251-3/+14
| | | | | | | Add three missing requirements on bitstream conformance from 7.4.3.19 of H.266 (V3). Issue found using fuzzing. Signed-off-by: Frank Plowman <post@frankplowman.com>
* lavc/vvc: Avoid UB in DB strength derivation for PLT CUsFrank Plowman2025-05-241-0/+3
| | | | | | | | | | When called for palette-predicted CUs, boundary_strength could cause undefined behaviour due to accessing uninitialised motion information. The spec doesn't include this, but in the reference software it seems the deblock strength is always set to 0 for palette CUs due to some implementation details: perhaps this is a spec issue? Signed-off-by: Frank Plowman <post@frankplowman.com>
* lavc/vvc: Detect subpic overlaps at CTU levelFrank Plowman2025-05-241-47/+57
| | | | | | | | | | | | | In d5dbcc00d889fb17948b025a468b00ddbea9e058, it was hoped that detection of subpicture overlaps could be performed at the tile level, so as to avoid introducing per-CTU checks. Unfortunately since that patch, fuzzing has indicated there are some structures involving pps_subpic_one_or_more_tiles_slice where tile-level checking is not sufficient. Performing the check at the CTU level should (touch wood) be the be-all and and-all of this, as CTUs are the lowest common denominator of the picture partitioning. Signed-off-by: Frank Plowman <post@frankplowman.com>
* lavc/vvc/plt: validate run and signalled_entriesNuo Mi2025-05-241-5/+23
| | | | | | | | Fixes a crash triggered by a fuzzed clip: https://github.com/ffvvc/tests/tree/main/fuzz/passed/000256.bit Reproduce with: ffmpeg -i 000256.bit -f null -
* ffv1enc_vulkan: fix array overflowMaxime Gervais2025-05-241-0/+2
|
* aacdec_ac: fix signed overflow in ff_aac_ac_update_context()Lynne2025-05-241-4/+1
| | | | | | | | | The issue is that state->cur[] is 8-bits, but a+b+1 can overflow before being clipped to 0xF in the following line, causing an incorrect state to be saved for the next symbol. This solves numerous bitstream desyncs, particularly when coefficients with magnitude greater than 127 are sent.
* tests/fate/ac3: Make ac3-fixed-encode-2 bitexact across archesAndreas Rheinhardt2025-05-232-4/+19
| | | | | | | | | | | | | | | | Don't use a 7.1 EAC3 input file for which our decoder is not bitexact; instead just use the asynth-44100-8.wav file which (as a 7.1 file) exhibits the same issue fixed by 1b3f4842c18409dba5a345ef9e7b3de7a4fa3657. (Either the encoder or the resampler are still not completely bitexact, so we limit the number of frames output.) Also switch to a framecrc test so that the output channel layout is directly contained in the ref file. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_libplacebo: add shader_cache optionNiklas Haas2025-05-232-0/+41
| | | | | | | Useful to speed up shader compilation. May significantly lower startup times, in particular with large or complex shaders. Sponsored-by: nxtedition
* avfilter/vf_libplacebo: implement rotation optionNiklas Haas2025-05-233-1/+35
| | | | | | Flipping can already be accomplished by setting the crop_w/h expressions to their negative values, so together these options can implement any of the common frame orientations.
* avformat/matroskadec: Accept WebVTT subtitles with empty cuesMarcos Del Sol Vives via ffmpeg-devel2025-05-231-3/+0
| | | | | Fixes: #11493 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/imfdec: inherit opaque from parent AVFormatContextKacper Michajłow2025-05-231-0/+1
| | | | | | | | | | | | io_open and io_close2 callbacks may use opaque pointer stored in the context. They are already inherited, so opaque should also be passed through. Fixes IMF playback in mpv. Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tests/fate/ac3: add a second ac3_fixed encoder testJames Almer2025-05-221-0/+5
| | | | | | Exercising the lavfi filtergraph codepath to choose the best output layout. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/avfiltergraph: fix regression in picking channel layoutPaul B Mahol2025-05-221-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/lcevcdec: don't try to write to output frames directlyJames Almer2025-05-223-35/+78
| | | | | | | | | | The buffer references may not be writable at this point, as the decoder calls get_buffer2() with the AV_GET_BUFFER_FLAG_REF flag. Fixes races as reported by tsan, producing correct output regardless of threading choices. Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/swscale_unscaled: fix planarRgbToplanarRgbWrapper() for formats with ↵Ramiro Polla2025-05-231-2/+9
| | | | | | | | | bpc between 9-14 bits Currently, planarRgbToplanarRgbWrapper() always sets the alpha value to 255, without taking the bit depth into consideration. This commit restricts the alpha value to the bit depth.