summaryrefslogtreecommitdiffstats
path: root/libavfilter
Commit message (Collapse)AuthorAgeFilesLines
* libavfi/dnn: enable LibTorch xpu device option supportWenbin Chen2024-06-081-1/+15
| | | | | | | | | Add xpu device support to libtorch backend. To enable xpu support you need to add "-Wl,--no-as-needed -lintel-ext-pt-gpu -Wl,--as-needed" to "--extra-libs" when configure ffmpeg. Signed-off-by: Wenbin Chen <[email protected]>
* libavfilter/signature_lookup: fix jaccard distanceGerion Entrup2024-06-071-1/+2
| | | | | | | | | | | | | | | Actually, the jaccard distance is defined as D = 1 - intersect / union. Additionally, the distance value is compared against a constant that must be between 0 and 1, which is not the case here. Both facts together has led to the fact, that the function always returned a matching course signature. To leave the constant intact and to avoid floating point computation, this commit multiplies with 1 << 16 making the constant effectively 9000 / (1<<16) =~ 0.14. Reported-by: Sachin Tilloo <[email protected]> Reviewed-by: Sachin Tilloo <[email protected]> Tested-by: Sachin Tilloo <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/trim: flag trim filter as metadata onlyGyan Doshi2024-06-061-0/+1
| | | | Similar to select filter for video - it can only pass through or drop frames
* lavfi: get rid of bespoke double scalar productsRémi Denis-Courmont2024-05-313-40/+4
|
* avfilter/af_afir: Merge header into af_afir.cAndreas Rheinhardt2024-05-312-111/+80
| | | | | | | Done in 0df18f29ae218f30b3ecff7c930176b8ebee56aa, accidentally undone in 163e737c1793eeea9c2df15298253ffc04906afe. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/af_aiir: Avoid unchecked allocationAndreas Rheinhardt2024-05-311-4/+3
| | | | | | | W has not been checked at all; allocate it jointly with M to fix this. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/af_aiir: Remove dead codeAndreas Rheinhardt2024-05-311-4/+0
| | | | | | Fixes Coverity issue #1468252. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_signalstats: Use 64bit for processing histogramAndreas Rheinhardt2024-05-311-5/+5
| | | | | | | | | | The result might not fit into 32bit if an image has gigantic dimensions and one of the planes has a dominant value (particularly so if said value is big). Fixes Coverity issues #1598399, #1598401, #1598402, #1598403, #1598404. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/dnn: Remove a level of dereferenceZhao Zhili2024-05-305-34/+29
| | | | | | | | | For code such as 'model->model = ov_model' is confusing. We can just drop the member variable and use cast to get the subclass. Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn_backend_torch: Simplify memory allocationZhao Zhili2024-05-301-19/+12
| | | | | | Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn_backend_tf: Simplify memory allocationZhao Zhili2024-05-301-20/+13
| | | | | | Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn_backend_tf: Fix free context at random placeZhao Zhili2024-05-301-1/+1
| | | | | | | | It will be freed again by ff_dnn_uninit. Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn_backend_tf: Remove one level of indentationZhao Zhili2024-05-301-31/+32
| | | | | | Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn_backend_openvino: simplify memory allocationZhao Zhili2024-05-301-27/+20
| | | | | | Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn_backend_openvino: Fix free context at random placeZhao Zhili2024-05-301-1/+0
| | | | | | | | It will be freed again by ff_dnn_uninit. Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/dnn: Don't show backends which are not supported by a filterZhao Zhili2024-05-308-12/+28
|
* avfilter/dnn: Use dnn_backend_info_list to search for dnn moduleZhao Zhili2024-05-305-18/+12
| | | | | | Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/af_atempo: Fix indentationAndreas Rheinhardt2024-05-231-14/+14
| | | | | | Forgotten after b8f74ee57a6e9e75a507adcddf30f84dd4a39d39. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/af_atempo: Simplify resettingAndreas Rheinhardt2024-05-231-34/+35
| | | | | | | | | | | | | The earlier code distinguished between a partial reset (yae_clear()) and a complete reset (yae_release_buffers() which also releases the buffers); this separation existed to avoid allocations, as buffers were reallocated on reconfigs. Yet it is pointless since a5704659e3e41b7698812b89f67d9a7467a74d20, so simply use yae_release_buffers() everywhere. Reviewed-by: Pavel Koshevoy <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/af_atempo: Properly check av_tx_init()Andreas Rheinhardt2024-05-231-6/+9
| | | | | | Fixes Coverity issue #1516804. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_dnn_detect: Fix null pointer dereferenceZhao Zhili2024-05-211-4/+6
| | | | Signed-off-by: Zhao Zhili <[email protected]>
* avfilter/vf_signalstats: Reindent after the previous commitAndreas Rheinhardt2024-05-211-72/+71
| | | | | | Also use loop scope for iterators while just at it. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit codeAndreas Rheinhardt2024-05-211-236/+43
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_signalstats: Use av_dict_set_int() where appropriateAndreas Rheinhardt2024-05-211-40/+40
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* libavfilter/vf_curves: fix a memory leak on error pathLuMingYin2024-05-201-2/+4
| | | | | Signed-off-by: LuMingYin <[email protected]> Signed-off-by: Zhao Zhili <[email protected]>
* avfilter/vf_v360: Add assert to suppress Coverity false positivesAndreas Rheinhardt2024-05-201-0/+2
| | | | | | | Should fix many Coverity false positives, namely #1457947-#1457994 as well as #1461195-#146210. Signed-off-by: Andreas Rheinhardt <[email protected]>
* fftools, avfilter, avformat: Simplify check for "is dictionary empty?"Andreas Rheinhardt2024-05-201-2/+2
| | | | | Reviewed-by: [email protected] Signed-off-by: Andreas Rheinhardt <[email protected]>
* lavfi/qsvvpp: require a dynamic frame pool for output if possibleHaihao Xiang2024-05-201-23/+29
| | | | Signed-off-by: Haihao Xiang <[email protected]>
* lavfi/qsvvpp: use the right mfxFrameInfo when dynamic frame pool is usedHaihao Xiang2024-05-201-1/+1
| | | | Signed-off-by: Haihao Xiang <[email protected]>
* avfilter/smartblur: Added alpha layer supportAndrea Mastroberti2024-05-192-9/+36
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/dnn: Refactor DNN parameter configuration systemZhao Zhili2024-05-1813-229/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch trying to resolve mulitiple issues related to parameter configuration: Firstly, each DNN filters duplicate DNN_COMMON_OPTIONS, which should be the common options of backend. Secondly, backend options are hidden behind the scene. It's a AV_OPT_TYPE_STRING backend_configs for user, and parsed by each backend. We don't know each backend support what kind of options from the help message. Third, DNN backends duplicate DNN_BACKEND_COMMON_OPTIONS. Last but not the least, pass backend options via AV_OPT_TYPE_STRING makes it hard to pass AV_OPT_TYPE_BINARY to backend, if not impossible. This patch puts backend common options and each backend options inside DnnContext to reduce code duplication, make options user friendly, and easy to extend for future usecase. For example, ./ffmpeg -h filter=dnn_processing dnn_processing AVOptions: dnn_backend <int> ..FV....... DNN backend (from INT_MIN to INT_MAX) (default tensorflow) tensorflow 1 ..FV....... tensorflow backend flag openvino 2 ..FV....... openvino backend flag torch 3 ..FV....... torch backend flag dnn_base AVOptions: model <string> ..F........ path to model file input <string> ..F........ input name of the model output <string> ..F........ output name of the model backend_configs <string> ..F.......P backend configs (deprecated) options <string> ..F.......P backend configs (deprecated) nireq <int> ..F........ number of request (from 0 to INT_MAX) (default 0) async <boolean> ..F........ use DNN async inference (default true) device <string> ..F........ device to run model dnn_tensorflow AVOptions: sess_config <string> ..F........ config for SessionOptions dnn_openvino AVOptions: batch_size <int> ..F........ batch size per request (from 1 to 1000) (default 1) input_resizable <boolean> ..F........ can input be resizable or not (default false) layout <int> ..F........ input layout of model (from 0 to 2) (default none) none 0 ..F........ none nchw 1 ..F........ nchw nhwc 2 ..F........ nhwc scale <float> ..F........ Add scale preprocess operation. Divide each element of input by specified value. (from INT_MIN to INT_MAX) (default 0) mean <float> ..F........ Add mean preprocess operation. Subtract specified value from each element of input. (from INT_MIN to INT_MAX) (default 0) dnn_th AVOptions: optimize <int> ..F........ turn on graph executor optimization (from 0 to 1) (default 0) Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Wenbin Chen <[email protected]> Reviewed-by: Guo Yejun <[email protected]>
* avfilter/vf_geq: fix interpolation with 1 pixel width/heightMarton Balint2024-05-141-8/+12
| | | | | | Fixes ticket #9740. Signed-off-by: Marton Balint <[email protected]>
* avfilter/blend: use a per-thread AVExprMarton Balint2024-05-142-10/+28
| | | | | | | | Otherwise expression state is accessed and changed from multiple threads. Fixes ticket #10987. Signed-off-by: Marton Balint <[email protected]>
* avfilter/blend: put slice parameters to a single structMarton Balint2024-05-145-7/+15
| | | | | | This should make future extensibility easier. Signed-off-by: Marton Balint <[email protected]>
* avfilter/vsrc_testsrc: do not round down width and height for color srcMarton Balint2024-05-141-2/+0
| | | | | | | | ff_draw_rectangle handles subsampling since 2013. Fixes ticket #10989. Signed-off-by: Marton Balint <[email protected]>
* avfilter/riscv: build afir only if requiredJ. Dekker2024-05-141-2/+2
| | | | Signed-off-by: J. Dekker <[email protected]>
* avfilter/af_volume: Don't free options manuallyAndreas Rheinhardt2024-05-091-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/f_select.c: add support for iw and ih variablesPoorvaGaikar2024-05-081-0/+12
| | | | | | Fixes ticket #10509. Signed-off-by: Marton Balint <[email protected]>
* avfilter/Makefile: Add missing morpho->framesync dependencyAndreas Rheinhardt2024-05-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/Makefile: Add missing identity->framesync dependencyAndreas Rheinhardt2024-05-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/x86/Makefile: Fix standalone build of haldclut filterAndreas Rheinhardt2024-05-071-0/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_lut3d: Fix standalone build of lut1dAndreas Rheinhardt2024-05-071-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/Makefile: Add missing multiply->framesync dependencyAndreas Rheinhardt2024-05-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/x86/Makefile: Add missing dependencies for sobel filterAndreas Rheinhardt2024-05-071-0/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_convolution: Fix compilation with sobel disabledAndreas Rheinhardt2024-05-072-1/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/Makefile: Add missing guided->framesync dependencyAndreas Rheinhardt2024-05-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vsrc_testsrc: Fix compilation of colorchart filterAndreas Rheinhardt2024-05-071-9/+9
| | | | | | Move set_color() out of the CONFIG_TESTSRC2_FILTER block. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/Makefile: Add scale(2ref)->framesync dependencyAndreas Rheinhardt2024-05-071-2/+2
| | | | | | | Forgotten in e82a3997cdd6c0894869b33ba42430ac3c57fb3b. Reviewed-by: Frank Plowman <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_xmedian: Define OFFSET, FLAGS macros unconditionallyAndreas Rheinhardt2024-05-071-4/+4
| | | | | | | | They are currently defined inside the #if CONFIG_XMEDIAN_FILTER block. Fixes standalone compilation of the tmedian filter. Broken in f58939affe39f39038cbdfc6b731b1c9caed3caf. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/Makefile: Add missing colormap->framesync dependencyAndreas Rheinhardt2024-05-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>