aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/nvenc: add support for writing mastering metadata SEI messagesJames Almer2025-02-043-1/+89
| | | | | | | Including Mastering Display and Content Light Level. Requires SDK 13.0, and only supports HEVC and AV1. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nvenc: add compile time check for outputRecoveryPointSEI for HEVCJames Almer2025-02-042-0/+7
| | | | | | | Fixes compilation when using API headers older than 12.0 Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/amfenc: redesign to use hwcontext_amf.Dmitrii Ovchinnikov2025-02-045-632/+306
| | | | | Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com> v3: cleanup code
* avcodec: add amfdec.Evgeny Pavlov2025-02-044-2/+787
| | | | | | | Added AMF based h264, hevc, av1 decoders. Co-authored-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com> v2: added encoder reinitialisation v3: use AMF_SURFACE_UNKNOWN to int decoder(ctx->output_format before)
* avcodec/nvenc: Enable recovery point SEI for intra refresh modeZhao Zhili2025-02-041-0/+2
| | | | | | | | Otherwise all frames can be dropped after seek without the output_corrupt/showall flags. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/speexdec: fix frame_size for mode == 2James Almer2025-02-031-3/+3
| | | | | | Should match the non-extradata path now, and fix ticket #11078. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264dec: make slice header parse errors fatal under AV_EF_EXPLODEDale Curtis2025-02-021-1/+3
| | | | | | | | This fixes timeout issues and seems like it was intended since the line emits an error log. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Marth64 <marth64@proxyid.net>
* avcodec/mpeg12dec: rename 0x0502 CC formatScott Theisen2025-02-021-14/+14
| | | | | | | | | The format is used by at least Dish Network, but is not defined in any DVB standard, so remove references to DVB. This is a simple rename, no functional change. Signed-off-by: Marth64 <marth64@proxyid.net>
* avcodec/nvenc: finalize SDK 13.0 supportTimo Rothenpieler2025-02-022-3/+5
|
* avcodec/nvenc: use encoder level options for qmin/qmaxTimo Rothenpieler2025-02-025-19/+44
| | | | | | | | AV1 uses a vastly different range than what the global options permit, and also for the other codecs the range of the global options is at least misaligned. Fixes #11365
* avcodec/nvenc: add Temporal Filtering for AV1 and H.264 in NVENCDiego de Souza2025-02-024-1/+52
| | | | | | | | | This commit extends the support for Temporal Filtering in NVENC for AV1 and H.264 codecs. For natural videos with noise, NVENC temporal filtering improves video coding efficiency by 4-5%. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add UHQ to AV1 for NVENCDiego de Souza2025-02-022-1/+5
| | | | | | | | This commit adds support for Ultra High Quality mode for AV1 on NVIDIA GPUs. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add 4:2:2 encoding and H.264 10-bit supportDiego de Souza2025-02-023-6/+83
| | | | | | | | | This commit adds support for 4:2:2 encoding for HEVC and H.264 on NVIDIA Blackwell GPUs. Additionally, it supports 10-bit encoding for H.264 on Blackwell GPUs. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: add HEVC/H.264 4:2:2 and H.264 10-bit supportDiego de Souza2025-02-021-11/+72
| | | | | | | | | This commit adds support for 4:2:2 decoding for HEVC and H.264 on NVIDIA Blackwell GPUs for cuviddec. Moreover, it supports 10-bit decoding for H.264 on Blackwell GPUs. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvdec: add 4:2:2 decoding and 10-bit supportDiego de Souza2025-02-025-9/+51
| | | | | | | | | This commit adds support for 4:2:2 decoding for HEVC and H.264 on NVIDIA Blackwell GPUs. Additionally, it supports 10-bit decoding for H.264 on Blackwell GPUs. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/libxvid: add check for invalid intra/inter matrix valuesMarton Balint2025-02-011-0/+4
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/h263dec: Check against previous dimensions instead of codedMichael Niedermayer2025-01-311-4/+9
| | | | | | | | | Fixes: out of array access Fixes: crash-a41ef3db699013f669b076f02f36942925f5a98c Found-by: Kacper Michajlow <kasper93@gmail.com> Reviewed-by: Kacper Michajlow <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpegxl_parse{,r}: fix integer overflow for some malformed filesLeo Izen2025-01-302-10/+11
| | | | | | | | | | | | | | If there's a very large ISOBMFF box that needs to be skipped, it can cause an overflow for ctx->skip. There's already a safeguard to return quickly if ctx->skip > bufsize, so changing ctx->skip to int64_t will allow this to happen even if ctx->skip would overflow a signed int. Several other members are also changed to int64_t to avoid this problem in other possible scenarios. Signed-off-by: Leo Izen <leo.izen@gmail.com> Reported-by: Kacper Michajlow <kasper93@gmail.com> Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6085331937460224
* avcodec/hevc/hevcdec: Don't add to null pointerVitaly Buka2025-01-301-2/+3
| | | | | | | | | | | | | `POS(1,` and `POS(2,` may trigger UBSAN report: "runtime error: applying non-zero offset 304 to null pointer" Looks like values are not used without `chroma_format_idc`, so maybe there is no other issues than the UB. Can't reproduce with "fate". Signed-off-by: Vitaly Buka <vitalybuka@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/vvcdec: ensure slices contain nonzero CTUsNuo Mi2025-01-291-2/+9
| | | | | | fixes https://github.com/ffvvc/tests/tree/main/fuzz/passed/000323.bit Co-authored-by: Frank Plowman <post@frankplowman.com>
* lavc/vvcdec: remove unneeded VVCContext->pix_fmtNuo Mi2025-01-292-13/+6
| | | | | | AVCodecContext->sw_pix_fmt is used to hold the software pixel format. Co-authored-by: Frank Plowman <post@frankplowman.com>
* lavc/vvcdec: remove unneeded set_output_formatNuo Mi2025-01-291-21/+2
| | | | | | Downstream can determine the format from the output frame format Co-authored-by: Frank Plowman <post@frankplowman.com>
* avcodec/aarch64/aacencdsp: NEON implementationKrzysztof Pyrkosz2025-01-284-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch supplies handwritten NEON code for AAC. The benchmarks below were collected by invoking these two commands on each of my boards, A78, A72 and Thinkpad x13s: 1) ./tests/checkasm/checkasm --test=aacencdsp --bench --runs=12 2) ./ffmpeg -y -t 10:00 -f lavfi -i sine /tmp/foo.aac (the first line is speed without the patch, second, with) - A78 abs_pow34_c: 4161.5 ( 1.00x) abs_pow34_neon: 3586.2 ( 1.16x) quant_bands_signed_c: 5548.0 ( 1.00x) quant_bands_signed_neon: 1126.8 ( 4.92x) quant_bands_unsigned_c: 3979.2 ( 1.00x) quant_bands_unsigned_neon: 800.2 ( 4.97x) size= 5251KiB time=00:10:00.00 bitrate= 71.7kbits/s speed=71.6x size= 5251KiB time=00:10:00.00 bitrate= 71.7kbits/s speed=82.3x - A72 abs_pow34_c: 15362.2 ( 1.00x) abs_pow34_neon: 15382.5 ( 1.00x) quant_bands_signed_c: 9926.5 ( 1.00x) quant_bands_signed_neon: 2467.8 ( 4.02x) quant_bands_unsigned_c: 5469.8 ( 1.00x) quant_bands_unsigned_neon: 2089.5 ( 2.62x) size= 5251KiB time=00:10:00.00 bitrate= 71.7kbits/s speed=34.3x size= 5251KiB time=00:10:00.00 bitrate= 71.7kbits/s speed=37.8 - x13s abs_pow34_c: 2413.4 ( 1.00x) abs_pow34_neon: 1796.2 ( 1.34x) quant_bands_signed_c: 2968.9 ( 1.00x) quant_bands_signed_neon: 675.6 ( 4.39x) quant_bands_unsigned_c: 2311.9 ( 1.00x) quant_bands_unsigned_neon: 477.1 ( 4.85x) size= 5251KiB time=00:10:00.00 bitrate= 71.7kbits/s speed= 135x size= 5251KiB time=00:10:00.00 bitrate= 71.7kbits/s speed= 159x Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/sanm: codec37 buffers are privateManuel Lauss2025-01-261-5/+5
| | | | | | | | | | | | | | | | codec37 operates on 2 buffers, which must be considered private to the codec and must therefore not be changed by subsequent FOBJs. Let codec37 therefore operate on frm1/2 instead of frm0/2, but copy the decoded image to frm0 where other codecs operate on. Fixes artifacts encountered in Full Throttle "dazed.san" and also in a lot of Rebel Assault II gameplay videos: these videos consist of frames with an initial codec37 FOBJ image to set the stage, and optional codec1-23 FOBJs overlaid on top of that image. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/svq1enc: restrict Altivec acceleration to big-endian POWER ↵Sean McGovern2025-01-261-4/+4
| | | | | | | | | | | | configurations This was disabled in da60b99a8857d5ca236f32c1799a066e0135a866 and then accidentally re-enabled in 172b0e2e88832822632841e8e0d3794f974cbc93. The code in question was never properly adapted for litte-endian mode. refs: trac/10955 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegvideo_enc: use 64bit multiplication in dct_quantize_trellis_c ↵Marton Balint2025-01-251-11/+11
| | | | | | | | | | | | | | and dct_quantize_c Fixes corruption with: ffmpeg -t 1 -filter_complex "sine=f=21,showwaves=scale=cbrt:mode=line:colors=white:draw=full" -c:v mpeg2video -non_linear_quant 1 -qmin 1 -qmax 1 -cpuflags 0 out.mpg or ffmpeg -t 1 -filter_complex "sine=f=21,showwaves=scale=cbrt:mode=line:colors=white:draw=full" -c:v mpeg2video -non_linear_quant 1 -qmin 1 -qmax 1 -trellis 1 out.mpg Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/mpegvideo_enc: fix qmat value commentsMarton Balint2025-01-251-17/+20
| | | | | | | | | The comments supposed to track the possible value of the qmat and qmat16 matrices, but they were not updated properly in the long history of the mpegvideo encoder. Also they wrongly assumed the usage of built-in quantizer matrices and linear quantization. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/mpegvideo_enc: add checks for custom inter/intra/chroma matricesMarton Balint2025-01-253-0/+36
| | | | | | Make the checker functions available for all codecs. Signed-off-by: Marton Balint <cus@passwd.hu>
* Fix the tail handling in R-V V sadsunyuechi2025-01-252-19/+19
| | | | Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
* avcodec/huffyuvdec: Initialize whole output for decode_gray_bitstream()Michael Niedermayer2025-01-211-0/+2
| | | | | | | | Fixes: use of uninitialized memory Fixes: 375286238/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-6352546854141952 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cbs_vp9: Initialize VP9RawSuperframeIndexMichael Niedermayer2025-01-211-1/+1
| | | | | | | | Fixes: use-of-uninitialized-value Fixes: 70907/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_METADATA_fuzzer-6339363208757248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1enc: Fix RCT for GBR colorspaceMichael Niedermayer2025-01-211-0/+4
| | | | | | | | | | | | | | | It performs better when its less buggy Compression changes for rgb_scanline_half_piz_dw_t08 (using float16 with remaping) from 56086 byte to 34371 (with a single slice its 28122 byte) prior remap it was 188186 bytes ACES_OT_VWG_SampleFrames/ACES_OT_VWG_SampleFrames improves too but only by a fraction of a percent Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1enc: dont reset versionMichael Niedermayer2025-01-211-1/+0
| | | | | | resetting the version causes any previously set values to be disregarded Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1: simplify version checks with combined_versionMichael Niedermayer2025-01-214-4/+10
| | | | | Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffv1dec: move slice decoding into a separate functionLynne2025-01-221-46/+60
| | | | | This simply movies all slice decoding code from decode_frame to decode_slices; nothing more.
* ffv1dec: move header parsing into a separate functionLynne2025-01-221-24/+40
|
* ffv1dec: move slice start finding into a functionLynne2025-01-221-19/+47
| | | | This also cleans up and gives the code some much needed comments.
* ffv1dec: use dedicated pix_fmt field and call ff_get_formatLynne2025-01-222-63/+78
| | | | | Adding support for hwaccels means that avctx->pix_fmt will indicate hardware formats.
* avcodec/h264: fix stride calculation in slice_table for multi-slice field ↵Lingyi Kong2025-01-201-1/+1
| | | | | | | | | video deblocking fix for https://trac.ffmpeg.org/ticket/11360 A new fate test case is added to validate the fix, the smaple file is located at https://trac.ffmpeg.org/attachment/ticket/11360/slice2_field_aurora4.264. Signed-off-by: Lingyi Kong <konglingyi@visionular.com>
* avcodec/ac3dec: only export matrix encoding and downmix info side data when ↵James Almer2025-01-191-5/+8
| | | | | | | | | | necessary Don't export a matrix encoding side data when there's none signaled. And if downmixing was handled by the decoder itself, then the downmix info does not apply to the frame. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/ac3dec: don't override existing downmix coefficient with default onesJames Almer2025-01-191-2/+4
| | | | | | | | With this, if the eac3 dependent frame doesn't have coded downmix values when parsed by ff_eac3_parse_header(), it will inherit the coded ones from the core ac3 frame instead of ignoring them. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vvc: Add support for output_corrupt/showall flagsZhao Zhili2025-01-192-1/+20
|
* avcodec/sanm: simplify codec37 subcodec 3/4 pathManuel Lauss2025-01-171-77/+37
| | | | | | | | | | | | A flag in the codec header determines whether opcodes 0xfd/0xfe are to be treated as special or not. The current code has 2 implementations of the same decoding scheme, with one treating the 2 opcodes as special, the other not. Collapse them into a single implementation and treat these opcode according to the flag. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/sanm: implement codec37 subcodec1Manuel Lauss2025-01-171-3/+62
| | | | | | | | | | | RLE-compressed stream of motion vector indices and a special opcode to fill a block with data from the source stream. It is used in the LucasArts "Full Throttle" blink*.san animations. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Fixes: Ticket5753 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mediacodecenc: Support config qp rangeZhao Zhili2025-01-152-2/+64
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/cuviddec: Fix missing HW_CONFIG_METHOD_HW_FRAMES_CTX flagZhao Zhili2025-01-151-0/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/bit_depth_template: Remove empty macro INIT_CLIPZhao Zhili2025-01-154-17/+0
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mpegvideo_enc: Check FLV1 resolution limitsMichael Niedermayer2025-01-151-0/+6
| | | | | | Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com> Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1enc: Fix handling of 32bit unsigned symbolsMichael Niedermayer2025-01-151-1/+1
| | | | | | | | This may be needed for floats Sponsored-by: Sovereign Tech Fund Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/vvc/refs: export keyframe and picture type in output framesNuo Mi2025-01-131-0/+32
| | | | | | | fixes https://trac.ffmpeg.org/ticket/11406 Co-authored-by: Ruben Gonzalez <rgonzalez@fluendo.com> Signed-off-by: James Almer <jamrial@gmail.com>