aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* avfilter/x86/vf_colordetect_init: don't enable ASM functions on targets ↵James Almer13 days1-1/+1
| | | | | | where it's known they will be slower Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/x86/vf_colordetect: don't use rax to return a 32bit integerJames Almer13 days1-3/+3
| | | | | | Fixes compilation on x86_32 targets Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/x86/vf_colordetect: fix use of AVX512 instruction in AVX2 function ↵James Almer13 days1-3/+3
| | | | | | on non Unix64 targets Signed-off-by: James Almer <jamrial@gmail.com>
* tests/checkasm: add check for vf_colordetectNiklas Haas14 days5-0/+145
|
* avfilter/vf_colordetect: add x86 SIMD implementationNiklas Haas14 days5-0/+264
| | | | | | | | | | | | | | | | | | | | | alphadetect8_full_c: 5658.2 ( 1.00x) alphadetect8_full_avx2: 215.1 (26.31x) alphadetect8_full_avx512: 133.5 (42.40x) alphadetect8_limited_c: 7391.5 ( 1.00x) alphadetect8_limited_avx2: 649.3 (11.38x) alphadetect8_limited_avx512: 330.5 (22.36x) alphadetect16_full_c: 3027.4 ( 1.00x) alphadetect16_full_avx2: 209.4 (14.46x) alphadetect16_full_avx512: 141.4 (21.41x) alphadetect16_limited_c: 3880.9 ( 1.00x) alphadetect16_limited_avx2: 734.9 ( 5.28x) alphadetect16_limited_avx512: 349.2 (11.11x) rangedetect8_c: 5854.2 ( 1.00x) rangedetect8_avx2: 138.9 (42.15x) rangedetect8_avx512: 106.2 (55.12x) rangedetect16_c: 4122.0 ( 1.00x) rangedetect16_avx2: 138.6 (29.74x) rangedetect16_avx512: 104.1 (39.60x)
* avfilter/vf_colordetect: add new color range detection filterNiklas Haas14 days5-0/+443
| | | | | | | | | | This filter can detect various properties about the image, including whether or not there are out-of-range values, or whether the input appears to use straight or premultiplied alpha. Of course, these can only be heuristics, with "undetermined" as the base case. While we can definitely prove the existence of full range or straight alpha colors, we can never infer the opposite.
* avformat/concatdec: Clip duration in one more case in get_best_effort_duration()Michael Niedermayer2025-07-211-1/+1
| | | | | | | | | Fixes: signed integer overflow: 40000 - -9223372036854770000 cannot be represented in type 'long' Fixes: 427262541/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-4831506940100608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/smacker: cleanup on bet buffer failureMichael Niedermayer2025-07-201-1/+1
| | | | | | | | Fixes: memleak (of vlc) Fixes: 430343927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-5265858979233792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1dec: Check k in get_vlc_symbol()Michael Niedermayer2025-07-201-0/+5
| | | | | | | | | | | | The true problem happens in several previous get_vlc_symbol() but checking that is more expensive (involving FFABS()) here its just a simple check between 2 variables we have. Fixes: Assertion log >= k failed at libavcodec/golomb.h:406 Fixes: 429296194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-4691594622337024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Check luma/chroma mb_sizeMichael Niedermayer2025-07-201-3/+5
| | | | | | | | Fixes: shift exponent -1 is negative Fixes: 429011224/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5031059358285824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cfhd: Check idwt_buf size before allocationMichael Niedermayer2025-07-201-0/+4
| | | | | | | | Fixes: OOM Fixes: 428760799/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_DEC_fuzzer-5685176435015680 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools/cmdutils: Add av_freep() to avoid memory leakJiasheng Jiang2025-07-201-2/+5
| | | | | | | | Add av_freep() to free new_elem to avoid memory leak. Fixes: 3ca1e31e63 ("fftools/cmdutils: Atomically add elements to list of pointers, fix crash") Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/apv: use memset to zero initialize frame_infoJames Almer2025-07-191-1/+9
| | | | | | | | Don't rely on implicit zeroing. Should fix fate failures on msvc targets. Found-by: Kacper Michajlow <kasper93@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_curves: don't add offsets to NULL pointersJames Almer2025-07-191-6/+10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/swscale_unscaled: don't add offsets to more NULL pointersJames Almer2025-07-181-2/+2
| | | | | | Continuation of af9b43455a972841154b194057a79ee8b606e727. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vaf_spectrumsynth: don't use uninitialized variable as scaleKacper Michajłow2025-07-191-2/+2
| | | | | | | | scale was never initialized. av_tx_init() will use default scale if we pass NULL. Fixes: b3117f376d1c50b3c39befe27cbba12d5c0f80da Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avcodec/sonic: move code closer to use to avoid unused warningsKacper Michajłow2025-07-191-128/+129
| | | | | | Put decoding and encoding code into thier respective #if blocks. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avcodec/sonic: remove dead codeKacper Michajłow2025-07-191-299/+0
| | | | | | | This was in else branch of `#if 1` since ever. No need to keep dead code like that, if anyone needs it they can get it from git history. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* configure: remove ossfuzz sanitizer flagsKacper Michajłow2025-07-191-5/+0
| | | | | | | | In OSS-Fuzz build environment flags are handled by CFLAGS and LDFLAGS. In local build use --toolchain=clang-fuzz-asan-ubsan or similar combination depending on requested sanitizers. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* configure: add -fuzz support to --toolchainKacper Michajłow2025-07-191-1/+6
| | | | | | libFuzzer is linked only for fuzzing targets. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* configure: allow -ubsan in toolchainKacper Michajłow2025-07-191-3/+3
| | | | | | It's is commonly called UBSAN after all. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* configure: add -fno-omit-frame-pointer when sanitizers are usedKacper Michajłow2025-07-191-1/+2
| | | | | | | All sanitizers give better reports with frame pointers. And skip adding -fomit-frame-pointer. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* configure: allow multiple sanitizers in --toolchainKacper Michajłow2025-07-191-6/+15
| | | | | | For example this allows: --toolchain=clang-asan-usan. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/hevc: don't print parameter_set_id for SEI NALUsJames Almer2025-07-181-3/+4
| | | | | | | | The field is unset for those. Fixes use of uninitialized variable errors under sanitizer. Signed-off-by: James Almer <jamrial@gmail.com>
* tests/fate/mov: add a test for HEIF files with multiple thumbnailsJames Almer2025-07-182-0/+94
| | | | | | As well as entries in iloc and iinf being not being stored in the same order. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/x86/vf_blackdetect: add missing preprocessor checkJames Almer2025-07-181-0/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: don't assume iloc and iinf entries for each item_id will be in ↵James Almer2025-07-181-15/+26
| | | | | | | | | | | the same order Nothing forbids them to be in any order the muxer desires. Fixes demuxing heif samples generated by S1II. Tested-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* fate/lavf-container: add test for APV in MP4James Almer2025-07-182-0/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_muxer: Extended MOV muxer to handle APV video contentDawid Kozinski2025-07-1810-9/+493
| | | | | | | | | - Changes in mov_write_video_tag function to handle APV elementary stream - Provided structure APVDecoderConfigurationRecord that specifies the decoder configuration information for APV video content Co-Authored-by: James Almer <jamrial@gmail.com> Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/motion_est: don't add offsets to NULL pointersJames Almer2025-07-181-3/+3
| | | | | Fixes: libavcodec/motion_est.c:94:31: runtime error: applying zero offset to null pointer Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/swscale_unscaled: don't add offsets to NULL pointersJames Almer2025-07-181-1/+1
| | | | | Fixes: libswscale/swscale_unscaled.c:916:20: runtime error: applying zero offset to null pointer Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/x86/vf_blackdetect_init: don't enable the ASM functions on targets ↵James Almer2025-07-181-1/+1
| | | | | | where it's known they will be slower Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/x86/vf_blackdetect: don't use rax to return a 32bit integerJames Almer2025-07-181-5/+5
| | | | | | Fixes compilation on x86_32. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_blackdetect: Fix header guardZhao Zhili2025-07-181-3/+3
| | | | Fix fate-source failure.
* tests/checkasm: add test for vf_blackdetectNiklas Haas2025-07-185-0/+75
|
* avfilter/vf_blackdetect: add AVX2 SIMD versionNiklas Haas2025-07-185-25/+188
| | | | | | | | | | | | Requested by a user. Even with autovectorization enabled, the compiler performs a quite poor job of optimizing this function, due to not being able to take advantage of the pmaxub + pcmpeqb trick for counting the number of pixels less than or equal-to a threshold. blackdetect8_c: 4625.0 ( 1.00x) blackdetect8_avx2: 155.1 (29.83x) blackdetect16_c: 2529.4 ( 1.00x) blackdetect16_avx2: 163.6 (15.46x)
* avcodec/ohenc: Add h264/hevc OpenHarmony encodersZhao Zhili2025-07-188-3/+732
|
* avcodec/ohdec: Add h264/hevc OpenHarmony decodersZhao Zhili2025-07-187-1/+908
|
* avutil/hwcontext: Add ohcodec device and pixel formatZhao Zhili2025-07-1811-2/+109
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avdevice/android_camera: Set image linesize aligment to 1wangbin2025-07-181-2/+2
| | | | | | | Can't read alignment from packet, codecpar or decoded frame linesizes, so don't set it. My test device redmi k60 produces images in 4624x3472, not 32 aligned Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: Enable jpeg streams in HEIF MOVContextEric Joyner2025-07-171-0/+1
| | | | | | | | | | | | | Nikon HEIFs from a camera or NX studio include a small jpeg thumbnail in addition to the expected HEVC thumbnails; allowing jpegs allows all thumbnails to have an associated stream for Nikon HEIF files. With this, Nikon HEIFs can finally be decoded without failing and the thumbnails can be extracted into their own files. Signed-off-by: Eric Joyner <erj@erj.cc> Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: Support multiple thumbnails in HEIFEric Joyner2025-07-172-8/+19
| | | | | | | | | | | | | | | | | | | | | | Prevents ffmpeg/ffprobe from erroring out when reading an HEIF that contains multiple hvcC thumbnails (e.g. from a Nikon Z6III camera). Before, move_read_iref_thmb() would always override the stored thmb_item_id in the MOVContext with each new read thumbnail, causing a stream and item_id mismatch later in mov_parse_heif_items(), resulting in the "HEIF thumbnail doesn't reference a stream" error message. To solve this, - Turn thmb_item_id into an array of IDs because multiple thumbnails can exist - Change check in mov_parse_heif_items() to compare against all stored thumbnail IDs to see if any item missing a stream is in the list of thumbnail IDs. Signed-off-by: Eric Joyner <erj@erj.cc> Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/whip: force NONBLOCK for rtpJack Lau2025-07-171-0/+1
| | | | | | | | We need to ensure rtp sets NONBLOCK since the dtls handshake has potentially overriden the sockets mode. Signed-off-by: Jack Lau <jacklau1222@qq.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avformat/tls_openssl: avoid unusual inline-if styleTimo Rothenpieler2025-07-171-2/+5
|
* avformat/tls_openssl: make tls and dtls use one close functionJack Lau2025-07-171-15/+3
| | | | | Signed-off-by: Jack Lau <jacklau1222@qq.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avfilter/vf_thumbnail: unroll and use multiple histogramsNiklas Haas2025-07-171-14/+57
| | | | | | | | This naive hist[p[x]]++ loop suffers badly when there are large regions of identical values in the image, because of store-to-load forwarding delay. Splitting up the histogram into four "parallel" histograms and processing them one at a time speeds things up significantly, about 40% on my end.
* avfilter/x86/scene_sad: add high bit depth AVX2/AVX512 versionNiklas Haas2025-07-172-13/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | Since psadbw only exists for 8-bits, we have to emulate it for 16-bit inputs. The simplest sequence is to use a normal subtraction, which is safe as long as the inputs do not exceed 32767 - so limit this implementation to 15-bit inputs and below. For 16-bit inputs, we could in theory instead use a pminw / pmaxw to ensure the resulting difference does not overflow, but this is slower, and also breaks the subsequent use of pmaddwd, so I opted to skip 16-bit SIMD for now. scene_sad10_c: 114175.6 ( 1.00x) scene_sad10_avx2: 9617.7 (11.87x) scene_sad10_avx512: 5208.8 (21.92x) scene_sad12_c: 114537.8 ( 1.00x) scene_sad12_avx2: 9614.0 (11.91x) scene_sad12_avx512: 5186.3 (22.08x) scene_sad14_c: 114113.9 ( 1.00x) scene_sad14_avx2: 9612.9 (11.87x) scene_sad14_avx512: 5186.0 (22.00x) scene_sad15_c: 114108.9 ( 1.00x) scene_sad15_avx2: 9612.3 (11.87x) scene_sad15_avx512: 5186.4 (22.00x) scene_sad16_c: 114136.0 ( 1.00x)
* avfilter/x86/scene_sad: add AVX512 implementationNiklas Haas2025-07-172-0/+14
| | | | | | | | | Trivial to add, but a lot faster (on my machine). scene_sad8_c: 114476.4 ( 1.00x) scene_sad8_sse2: 8644.3 (13.24x) scene_sad8_avx2: 4520.1 (25.33x) scene_sad8_avx512: 3153.0 (36.31x)
* tests/checkasm: add scene_sad checkasm testNiklas Haas2025-07-175-0/+79
|
* avfilter/scene_sad: pass true depth to ff_scene_sad_get_fn()Niklas Haas2025-07-178-10/+9
| | | | | I need to be able to distinguish between 10/12/14 and 16 bit depths, for overflow reasons.