1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00
Commit Graph

120644 Commits

Author SHA1 Message Date
nyanmisaka
523134587a lavu/hwcontext_vaapi: drop a redundant check
vaapi_get_image_format() will be called in vaapi_map_frame().

So it's a double check, drop it to avoid redundancy.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-08-08 12:53:39 +00:00
nyanmisaka
eb9070aba4 lavu/hwcontext_vaapi: fix a race mapping to allow CSC to YUV420P
There's a race condition for YUV420P when mapping from pix_fmt
to VA fourcc, both I420 and YV12 could be found by pix_fmt.

Currently, vaapi_get_image_format() iterates over the query results
of pix_fmt and returns the first matching result in the order
declared in the driver. This may result in an incorrect image_format.

Now use fourcc to find the image_format.

Fixes:
ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i INPUT \
-vf scale_vaapi=format=yuv420p,hwmap,format=yuv420p \
-vframes 1 -f rawvideo -y yuv420p.yuv

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-08-08 12:53:39 +00:00
Michael Niedermayer
d643a5ba08 avcodec/aac/aacdec_usac: Limit sfo from noise offset to be above -200
Fixes: out of array read
Fixes: 397731127/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5577772965101568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-08 14:21:50 +02:00
Michael Niedermayer
01a1b99fc2 avcodec/aacsbr_template: Check ilb
Fixes: index 50 out of bounds for type 'INTFLOAT [40][2]'
Fixes: 401661737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4866055713652736

Someone knowing AAC well should review this, there is likely a nicer fix

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-08 14:21:36 +02:00
David Rosca
069daca9e0 vulkan_encode_av1: Fix uninitialized return value in write_extra_headers 2025-08-08 12:18:24 +00:00
David Rosca
db6fd82651 vulkan_encode_av1: Fix setting QP
Use the "qp" param instead of "global_quality" to match H264/5.
2025-08-08 12:00:16 +00:00
Niklas Haas
6862ec704a avfilter/vf_libplaceb: use TS2T() macro 2025-08-08 11:29:27 +00:00
Niklas Haas
d69ccbfc18 avfilter/vf_libplacebo: use the first visible input for metadata
Instead of undconditionally using the first input. This covers the case of
one layer fully obscuring another layer, in which case that should become
the new "base" layer.
2025-08-08 11:29:27 +00:00
Niklas Haas
62893fb94e avfilter/vf_libplacebo: flush render cache when input is invisible
This prevents leaking stale metadata from previous frames, for example if
an overlay temporarily obscures this input and then un-obscures it again. It
is worth pointing out that this does change the semantics subtly, because of
the smoothing period on detected HDR metadata, but I argue that the new
behavior is an improvement, as it will avoid leaking past metadata that is
definitely no longer relevant after an image is unobscured.
2025-08-08 11:29:27 +00:00
Niklas Haas
3091bca3ed avfilter/vf_libplacebo: skip rendering fully invisible planes
Sometimes, one input fully obscures another. In this case, we can skip
actually rendering any input below the obscuring one.

The reason I don't simply start the main render loop at `idx_start` will
become apparent in the following commit.

We can't use pl_frame_is_cropped() on this dummy frame, but we need to
determine the reference frame before we can map the real output, so to
resolve this conflict, we just reimplement the crop detection logic using
the output link dimensions.
2025-08-08 11:29:27 +00:00
Niklas Haas
6627c8ea4b avfilter/vf_libplacebo: skip empty inputs
It is possible for pl_queue_update() to return PL_QUEUE_OK, but to generate
an empty frame mix. This happens if the first frame of that input is in the
future.

In this case, we should skip an input as not active, similar to inputs that
have already reached EOF.
2025-08-08 11:29:27 +00:00
Niklas Haas
e57874768a avfilter/vf_libplacebo: simplify unnecessary indirection
in->idx is equal to the array index by definition, so just use the loop
index directly.
2025-08-08 11:29:27 +00:00
Niklas Haas
4125495849 avfilter/vf_libplacebo: whitelist properties on linear blend tex
Instead of copying over the entire target and changing a few fields,
set the entire struct to a whitelist of safe properties that we want to
persist on the intermediate texture.

In particular, this avoids leaking irrelevant state related to the
acquire/release callbacks, e.g., which can otherwise cause deadlocks
when the same vulkan frame is attempted to be acquired twice.
2025-08-08 11:29:27 +00:00
Lynne
4898a6400e Changelog: add entries for ProRes RAW decoder and ProRes RAW Vulkan hwaccel 2025-08-08 19:47:06 +09:00
Lynne
404de96e36 Changelog: add entries for AV1 Vulkan encoder and Vulkan VP9 hwaccel 2025-08-08 19:46:45 +09:00
Jacob Lifshay
14a95ab471 lavf: add mcc muxer
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
ceb9688fee lavf/mccdec: clean up, add support for mcc 2.0 features, and add SMPTE_436M_ANC output stream
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
a18d5a766d lavf/mxfenc: support EIA-608/708 streams by using eia608_to_smpte436m bsf
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
0271d0423a lavc: add eia608_to_smpte436m bitstream filter
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
aa5b9db7bd lavc: add smpte436m_to_eia608 bitstream filter
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
1c85a3832a lavc: add API for manipulating SMPTE-436M VBI/ANC data
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
a566fcb9dc lavf: mxf [de]muxer now uses AV_CODEC_ID_SMPTE_436M_ANC instead of ..._NONE
this makes it easier to match against when using that format from other parts of ffmpeg.

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:40 -07:00
Jacob Lifshay
f4ff379bae lavc: add AV_CODEC_ID_SMPTE_436M_ANC
This creates a new codec id for mxf vbi_vanc_smpte_436M streams.
This makes it easier to use from other [de]muxers and bitstream filters.

It's just the data in Table 7 (starts on page 13) of:
https://pub.smpte.org/latest/st436/s436m-2006.pdf

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:02:57 -07:00
Jacob Lifshay
c421da385f forgejo/pre-commit/config: ensure .forgejo/pre-commit/ignored-words.txt is sorted
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 02:58:59 -07:00
Jacob Lifshay
880f82e2d2 forgejo/pre-commit/ignored-words: sort words
They were not sorted before, sort using: LC_ALL=C sort --ignore-case
since that's what file-contents-sorter (added in next commit) supports.

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 02:58:59 -07:00
Benjamin Cheng
70cebba490 vulkan_encode: Remove unneeded VkImageUsageFlags
There is no point where we need to have the SAMPLED usage on the DPB
resource, and the ENCODE_DST usage does not mean anything.
2025-08-08 09:32:06 +00:00
Lynne
75aeffb1c6 lavc: add a ProRes RAW Vulkan hwaccel
This commit adds a ProRes RAW hardware implementation written in Vulkan.
Both version 0 and version 1 streams are supported.
The implementation is highly parallelized, with 512 invocations dispatched
per every tile, with generally 4k tiles on a 5.8k stream.

Thanks to unlord for the 8-point iDCT.

Benchmark for a generic 5.8k RAW HQ file:
6900XT: 63fps
7900XTX: 84fps
6000 Ada: 120fps
Intel: 9fps
2025-08-08 18:29:41 +09:00
Lynne
589b3ed943 lavc: add a ProRes RAW decoder 2025-08-08 18:29:41 +09:00
Lynne
5674879db5 proresdsp: add idct_put_bayer
This commit adds a 12-bit DCT function to directly write to Bayer
images. Will be used in the following commit.
2025-08-08 18:29:40 +09:00
Lynne
b2928971e8 lavc: add an av1_vulkan encoder
This commit adds a Vulkan AV1 encoder, using the native acceleration API.
2025-08-08 18:29:40 +09:00
Lynne
2caf23e7c4 vp9: add Vulkan VP9 hwaccel 2025-08-08 18:29:40 +09:00
Lynne
c0bf1382a7 lavc/vp9dec: use cbs_vp9 to parse the frame header 2025-08-08 18:29:39 +09:00
Zhao Zhili
7f150dc4b7 configure: Fix build with MSVC
The copyright message of cl.exe doesn't always begin with Microsoft,
e.g., when local is Chinese.

Fix regression since 53da090ab7.
2025-08-07 21:16:40 +00:00
Michael Niedermayer
85a2beaa81 avcodec/ffv1: Clear state on alloc
Fixes: use of uninitialized memory
Fixes: 428969823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-5909681623334912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:45:04 +00:00
Michael Niedermayer
27a541bb4c avcodec/utvideodec: Set B for the width= 1 case
Fixes: use of uninitialized meory
Fixes: 428034093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-6195630160805888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:45:04 +00:00
Michael Niedermayer
70fc46d185 avcodec/ffv1: Clear state on alloc
Fixes: use of uninitialized memory
Fixes: 428969823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-5909681623334912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:44:59 +00:00
Michael Niedermayer
032dfe8584 avcodec/utvideodec: Set B for the width= 1 case
Fixes: use of uninitialized meory
Fixes: 428034093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-6195630160805888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:44:59 +00:00
Sean McGovern
218a4fe28e CODEOWNERS: add myself for lib{avcodec,avutil,swscale}/ppc/ 2025-08-07 14:03:33 -04:00
Lynne
83b36f5410 lavc: bump minor version and add APIChanges entry for ProRes RAW 2025-08-08 01:06:11 +09:00
Lynne
5ff2886e9a lavc: add a ProRes RAW parser
Simple parser that only parses frame information.
This helps avoid requiring the software decoder on init to decode a
single frame, since the decoder can be quite slow.
2025-08-08 01:06:11 +09:00
Lynne
4ad35d78c9 lavc: add codec ID and profiles for ProRes RAW 2025-08-08 01:06:11 +09:00
Lynne
b8c92e2893 scale_vulkan: add support for basic Debayering 2025-08-08 01:06:11 +09:00
Lynne
bc327222e5 scale_vulkan: refactor shader initialization 2025-08-08 01:06:11 +09:00
Lynne
1f72bf5ec8 vulkan: add support for 16-bit RGGB Bayer pixfmt 2025-08-08 01:06:11 +09:00
Michael Niedermayer
01a292c7e3 avcodec/jpeg2000dec: implement cdef remapping during pixel format matching
Fixes: out of array access
Fixes: poc.jp2

Found-by: Andy Nguyen <theflow@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:56 +00:00
Michael Niedermayer
104d6846c1 avcodec/jpeg2000dec: move cdef default check into get_siz()
This way cdef is at its final value earlier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:56 +00:00
Michael Niedermayer
f45da79b2c avcodec/exr: Dont access outside xsize/ysize
Fixes: out of array access
Fixes: BIGSLEEP-436510316/dwa_uncompress_write.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:35 +00:00
Michael Niedermayer
0d9c003d76 avcodec/exr: Check rle_raw_data and surroundings
Fixes: out of array read

Fixes: BIGSLEEP-436510153/dwa_uncompress_read.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:35 +00:00
Frank Plowman
8173ae547a CODEOWNERS: Add myself for VVC 2025-08-07 14:18:42 +00:00
Kacper Michajłow
ea56fe60ac avutil/avassert: use __builtin_assume if available
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-07 13:13:40 +00:00