aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
Commit message (Collapse)AuthorAgeFilesLines
...
* bwdif_vulkan: convert to storage imagesLynne2025-02-182-49/+45
| | | | | | | | | | | | | | | texture() uses bilinear scaling; imageLoad() accesses the image directly. The reason why texture() was used throughout Vulkan filters is that back when they were written, they were targetting old Intel hardware, which had a texel cache only for sampled images. These days, GPUs have a generic cache that doesn't care what source it gets populated with. Additionally, bypassing the sampling circuitry saves us some performance. Finally, all the old texture() code had an issue where unnormalized coordinates were used, but an offset of 0.5 was not added, hence each pixel ended up being interpolated. This fixes this.
* vulkan_filter: use GENERAL image layout when no sampler is givenLynne2025-02-181-7/+16
| | | | This allows using the generic filter code with STORAGE image inputs.
* avfilter/interlace_vulkan: add interlace_vulkan filterNiklas Haas2025-02-173-0/+315
| | | | This is a Vulkan-accelerated version of the existing interlace filter.
* avfilter/vpp_amf: add option reset_sarGyan Doshi2025-02-103-6/+14
| | | | | | | | 4b77a0a681 added a new consumer of ff_scale_adjust_dimensions which was recently modified to allow for square pixel output. This commit extends the new option to vpp_amf, and unbreaks the building of vf_amf_common.c
* avfilter/vf_amf_common: fix buildTimo Rothenpieler2025-02-101-1/+1
| | | | AMF was forgotten in a28dc06869fe1f98c07e42f9b0a411d2744ff7d7
* avfilter/scale*: add option reset_sarGyan Doshi2025-02-109-22/+66
| | | | | | | | | | | | | | | | For anamorphic videos, enabling this option leads to adjustment of output dimensions to obtain square pixels when the user requests proportional scaling through either of the w/h expressions or force_original_aspect_ratio. Output SAR is always reset to 1. Option added to scale, scale_cuda, scale_npp & scale_vaapi. libplacebo already has a similar option with different semantics, scale_vt and scale_vulkan don't implement force_oar, so for these three filters, I've made minimal changes needed to not break building or change output.
* avfilter/drawtext: fix memory leak when using "reinit" runtime commandSteven Zhou2025-02-061-0/+1
| | | | | | | | Free AVOption in drawtext private context when freeing old copy of drawtext private context during processing of "reinit" runtime command. Signed-off-by: Steven Zhou <steven.zhou@netint.ca> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/xpsnr: avoid division by zeroGyan Doshi2025-02-061-1/+4
| | | | | | | | The ref input may have its frame rate unset, which would then lead to SIGFPE. So fall back to the main link frame rate. If that too is unset, default to 0. Related to #11428
* avfilter/Makefile: add missing SKIPHEADERS for AMFJames Almer2025-02-041-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/scale_amf: Add AMF VPP & super resolution filtersEvgeny Pavlov2025-02-046-0/+1036
| | | | | | | | This commit adds two AMF filters: vpp_amf & sr_amf. Both filters are using AMF hardware acceleration. vpp_amf supports simple scaling algorithms & color conversion. sr_amf supports advanced scaling algorithms such as FSR & can be used for upscaling only.
* avfilter/vf_scale: remove global side data when it no longer applies after ↵James Almer2025-02-031-0/+10
| | | | | | scaling Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/avfilter: remove accidental loop index variable resetJames Almer2025-02-031-2/+2
| | | | | | Fixes ticket #11442. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/buffersrc: remove unused variableJames Almer2025-01-281-1/+0
| | | | | | Added by mistake in 7a025e1cb5fe61888a3e71a9b33842add02c8340. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/setpts: add option strip_fps to decide framerate handlingGyan Doshi2025-01-271-1/+5
| | | | | | | | | | | | In f121d95, the outlink framerate was unconditionally unset. This breaks/bloats outputs from CFR muxers unless the user explicitly sets a sane framerate. And the most common invocation for setpts seen in workflows, our docs and across the web is `PTS-STARTPTS` or others of the general form `PTS+constant` which preserves the input framerate. Default value is false, which restores old behaviour. Fixes #11428
* avfilter/af_aresample: propagate downmix metadata to swresample if presentJames Almer2025-01-251-0/+45
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/buffersink: add av_buffersink_get_side_data()James Almer2025-01-253-1/+13
| | | | | | | This will be used to get global side data that was propagated through the filterchain. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/buffersrc: add a side_data fieldJames Almer2025-01-253-1/+30
| | | | | | This will be used to propagate global side data through the filterchain. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/avfilter: add a side_data field to AVFilterLinkJames Almer2025-01-253-3/+22
| | | | | | This will be used to propagate global side data through the filterchain. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_v360: Fix NULL pointer useMichael Niedermayer2025-01-151-2/+2
| | | | | | | | Fixes: applying zero offset to null pointer partly Fixes: verysmall.flv Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_xpsnr: Avoid array only one of whose elements is usedAndreas Rheinhardt2025-01-121-28/+17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_xpsnr: Fix leaksAndreas Rheinhardt2025-01-121-25/+17
| | | | | | | | | | | | | | | | This filter uses the AVBuffer API to allocate buffers that are never shared at all and frees them via av_freep() (actually, it passes pointers to AVBufferRefs to av_freep, so that only the AVBuffer structures are freed at all (because AVBufferRef has a AVBuffer* as its first member), not the AVBufferRef and not the underlying buffers; and due to a wrong check the AVBuffers corresponding to buf_org[c] with c>0 were never freed at all). This is a violation of the AVBuffer API and causes a memleak. Fix this by avoiding the AVBuffer API altogether. (The FATE tests don't catch this, because they use piping to awk, so that the error code from ffmpeg is ignored.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add FFFilter, hide internals of AVFilterAndreas Rheinhardt2025-01-12461-3608/+3592
| | | | | | | | | | This patch is analogous to 20f972701806be20a77f808db332d9489343bb78: It hides the internal part of AVFilter by adding a new internal structure FFFilter (declared in filters.h) that has an AVFilter as its first member; the internal part of AVFilter is moved to this new structure. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_overlay: Remove spec-incompliant ';'Andreas Rheinhardt2025-01-121-26/+26
| | | | | | Fixes warnings with -pedantic with GCC and Clang. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/af_pan: Fix sscanf() useMichael Niedermayer2025-01-081-1/+1
| | | | | | | Fixes: Memory Data Leak Found-by: Simcha Kosman <simcha.kosman@cyberark.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_grayworld: Use the correct pointer for av_log()Michael Niedermayer2025-01-081-2/+2
| | | | | | | | Fixes: crash Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com> Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_addroi: Add missing NULL termination to addroi_var_names[]()Michael Niedermayer2025-01-081-0/+1
| | | | | | | | Fixes: out of array read Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com> Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/scale_vulkan: add dynamic crop region and aspect ratio matchKoushik Dutta2025-01-071-6/+20
| | | | | | | | | | | | | The scale_vulkan filter initializes the shader once, with the crop region set by the original frame. However, subsequent frames may specify a different crop region than the first frame. This change updates the cropping to match the behavior present on the other hardware frame scale filters. The scale filter should also allow negative values that respect aspect ratio, similar to other scale filters. Signed-off-by: Koushik Dutta <koushd@gmail.com>
* avfilter/aeval: don't leak the strdup'd expression stringJames Almer2025-01-041-1/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/aeval: tighten the check for empty expressionJames Almer2025-01-041-1/+1
| | | | | | Fixes ticket #11395 Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_dnn_detect: fix loading anchors when labels file is setLeandro Santiago2025-01-041-1/+6
| | | | | | | | | | | | References https://trac.ffmpeg.org/ticket/11387 Defining anchors is needed, even when a filename with the labels is set. The issue was identified when using yolov4-tiny model using openvino. More information about how to reproduce the bug can be found on the trac issue referenced by this commit. Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
* avfilter/buffersrc: make channel_layout a CHLAYOUT type AVOptionJames Almer2025-01-021-12/+2
| | | | | | | The string type is a remnant of the old channel layout API implementation. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/buffersink: don't leak the reallocated channel layouts arrayJames Almer2025-01-011-1/+2
| | | | | | | | And ensure the last element is the zeroed terminator. Fixes ticket #11392. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/buffersrc: check for valid sample rateJames Almer2024-12-311-0/+5
| | | | | | | | | A sample rate <= 0 is invalid. Fixes an assert in ffmpeg_enc.c that assumed a valid sample rate would be set. Fixes ticket #11385. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_lut*: strip color volume metadataNiklas Haas2024-12-233-0/+8
| | | | | These filters, in general, will apply some arbitrary color volume transformation. Strip corresponding metadata to be conservative/safe.
* avfilter/vf_colorspace: strip color volume metadataNiklas Haas2024-12-231-0/+7
|
* avfilter/vf_libplacebo: update metadata stripping logicNiklas Haas2024-12-231-15/+9
| | | | | | | Switches to av_frame_side_data_remove_by_props(), covering a number of cases that we previously ignored. Additionally, stop stripping metadata when merely changing colorspace or color range, since these do not affect the actual color volume of the image data, only the encoding.
* avfilter/vf_zscale: strip metadata on changeNiklas Haas2024-12-231-1/+7
| | | | | Required for both size changes and color volume changes (as a result of changing primaries/transfer).
* avfilter/vf_scale*: strip metadata on size changeNiklas Haas2024-12-236-10/+33
|
* avfilter/vf_scale: strip metadata when changing colorspaceNiklas Haas2024-12-231-0/+12
| | | | This is no longer relevant after a change in color space.
* avfilter/vf_scale: make options alignment consistent (cosmetic)Niklas Haas2024-12-231-24/+24
|
* avfilter/vf_scale: add colorspace and transfer property optionsNiklas Haas2024-12-231-1/+72
| | | | | In the long run, it would be ideal if we could add these to the avfilter negotiation as well, but for now, this is a good start.
* vulkan: do not reinvent a queue context structLynne2024-12-2312-36/+108
| | | | | | | | | | We recently introduced a public field which was a superset of the queue context we used to have. Switch to using it entirely. This also allows us to get rid of the NIH function which was valid only for video queues.
* avfilter/af_ashowinfo: fix scaling factor of replaygain peak valuesKacper Michajłow2024-12-071-1/+1
| | | | | | | | | | Commit 8542f9c4f17125d483c40c0c5723842f1c982f81 changed replaygain peak values to use 100k instead of UINT32_MAX as peak, with possibility of overflow. af_ashowinfo was never updated to reflect this, so we update it now. Fixes: 8542f9c4f17125d483c40c0c5723842f1c982f81 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avfilter/asrc_sine: increase frequency accuracyMarton Balint2024-11-291-1/+23
| | | | | | | | | | | | | Previously the delta phase was fixed point fractional with 2^32 fractions, which caused inaccuracies in the output frequency, unless the input frequency*2^32 was divisable by the sample rate. This patch improves frequency accuracy by tracking subfractions of the delta phase fractions. For this we are using a denominator which is a multiple of the sample rate, making sure that integer frequencies are always accurately represented. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/asrc_sine: factorize sampling to a separate contextMarton Balint2024-11-291-11/+23
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/textutils: Add missing time_internal.hZhao Zhili2024-11-291-0/+1
| | | | | | | This fix build error on Windows with MSVC. We need time_internal.h for gmtime_r and localtime_r. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavfi/qsvvpp: Copy frame props before modify itFei Wang2024-11-281-11/+12
| | | | | | | The changes to output frame props in query_frame overlapped since 578ac59887. Move the copy frame props before the changes. Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* avfilter/scale_vt: implement frame cropKoushik Dutta2024-11-261-0/+55
| | | | | | | | | | | | The crop filter has no effect on scale_vt: -vf crop=100:100,scale_vt=300x300 Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties, as seen in the implementation vf_crop.c. Signed-off-by: Koushik Dutta <koushd@gmail.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avfilter/scale_vt: implement negative width/height aspect ratio sizingKoushik Dutta2024-11-261-0/+2
| | | | | Signed-off-by: Koushik Dutta <koushd@gmail.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avfilter/vf_scale: fix off-by-one in loop boundsNiklas Haas2024-11-251-2/+2
| | | | | | | | Results in over-read of the array. Fortunately, the excess element was never actually used, but it still triggers ASAN (and could in theory trigger a segfault). Fixes: 04ce01df0bb2d66e143bcfcea439afc2a1b8d96e