Commit Graph

14577 Commits

Author SHA1 Message Date
Michael Niedermayer f9c28d544d avfilter/qsvvpp: Remove unreachable code
Fixes: CID1598548 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:51:16 +08:00
openvela-robot 0986b39270 MAINTAINERS: Update the entries for the release maintainer for FFmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:51:15 +08:00
openvela-robot 328953e3c5 ffmpeg:fix build warning in sim/m64
Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-04-20 20:51:11 +08:00
Michael Niedermayer fe59fe1460 avfilter/vf_rotate: Check ff_draw_init2() return value
Fixes: NULL pointer dereference
Fixes: 3_343

Found-by: De3mond
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:50:56 +08:00
Rémi Denis-Courmont 0541e0e71b riscv: probe for Zbb extension at load time
Due to hysterical raisins, most RISC-V Linux distributions target a
RV64GC baseline excluding the Bit-manipulation ISA extensions, most
notably:
- Zba: address generation extension and
- Zbb: basic bit manipulation extension.
Most CPUs that would make sense to run FFmpeg on support Zba and Zbb
(including the current FATE runner), so it makes sense to optimise for
them. In fact a large chunk of existing assembler optimisations relies
on Zba and/or Zbb.

Since we cannot patch shared library code, the next best thing is to
carry a flag initialised at load-time and check it on need basis.
This results in 3 instructions overhead on isolated use, e.g.:
1:  AUIPC rd, %pcrel_hi(ff_rv_zbb_supported)
    LBU   rd, %pcrel_lo(1b)(rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

The C compiler will typically load the flag ahead of time to reducing
latency, and can also keep it around if Zbb is used multiple times in a
single optimisation scope. For this to work, the flag symbol must be
hidden; otherwise the optimisation degrades with a GOT look-up to
support interposition:
1:  AUIPC rd, GOT_OFFSET_HI
    LD    rd, GOT_OFFSET_LO(rd)
    LBU   rd, (rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

This patch adds code to provision the flag in libraries using bit
manipulation functions from libavutil: byte-swap, bit-weight and
counting leading or trailing zeroes.
2026-04-20 20:50:55 +08:00
Wenbin Chen c193488671 libavfi/dnn: enable LibTorch xpu device option support
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 <wenbin.chen@intel.com>
2026-04-20 20:50:47 +08:00
Gerion Entrup 4df2a698b6 libavfilter/signature_lookup: fix jaccard distance
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 <sachin.tilloo@gmail.com>
Reviewed-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Tested-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:50:44 +08:00
openvela-robot 333b84b8d1 avcodec/h265_metadata: Add options to set width/height after crop
It's a common usecase to request a video size after crop. Before
this patch, user must know the video size before crop, then set
crop_right/crop_bottom accordingly. Since HEVC can have different
CTU size, it's not easy to get/deduce the video size before crop.
With the new width/height options, there is no such requirement.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-04-20 20:50:43 +08:00
openvela-robot ee91b60ce0 audio:add nuttx_enc lastpkt for count latency
add nuttx_enc lastpkt for count latency

Signed-off-by: shipei <shipei@xiaomi.com>
2026-04-20 20:50:39 +08:00
Gyan Doshi 7c032757be avfilter/trim: flag trim filter as metadata only
Similar to select filter for video - it can only pass through or drop frames
2026-04-20 20:50:37 +08:00
openvela-robot 4c0f0ba0fb libavcodec/libxvid: code cleanup (replace magic numbers) 2026-04-20 20:50:36 +08:00
openvela-robot 09c5d5b854 FFMPEG: Fix the inaccurate pts value of offload recorder
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2026-04-20 20:50:32 +08:00
Rémi Denis-Courmont 3c81c6c4c2 lavfi: get rid of bespoke double scalar products 2026-04-20 20:50:23 +08:00
Andreas Rheinhardt 8c2cbab632 avfilter/af_afir: Merge header into af_afir.c
Done in 0df18f29ae218f30b3ecff7c930176b8ebee56aa,
accidentally undone in 163e737c1793eeea9c2df15298253ffc04906afe.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:50:21 +08:00
Andreas Rheinhardt f9ee5c70bc avfilter/af_aiir: Avoid unchecked allocation
W has not been checked at all; allocate it jointly with M
to fix this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:50:21 +08:00
Andreas Rheinhardt 683d2db251 avfilter/af_aiir: Remove dead code
Fixes Coverity issue #1468252.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:50:21 +08:00
Andreas Rheinhardt 913d206531 avfilter/vf_signalstats: Use 64bit for processing histogram
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 <andreas.rheinhardt@outlook.com>
2026-04-20 20:50:20 +08:00
Zhao Zhili e05a1d3bf2 avfilter/dnn: Remove a level of dereference
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 <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili b0f3fb72c3 avfilter/dnn_backend_torch: Simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili be55dde1d6 avfilter/dnn_backend_tf: Simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili 97f4e4a3a1 avfilter/dnn_backend_tf: Fix free context at random place
It will be freed again by ff_dnn_uninit.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili a889c17f5c avfilter/dnn_backend_tf: Remove one level of indentation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili b925abbcc6 avfilter/dnn_backend_openvino: simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili dcde65260a avfilter/dnn_backend_openvino: Fix free context at random place
It will be freed again by ff_dnn_uninit.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
Zhao Zhili d728f4237d avfilter/dnn: Don't show backends which are not supported by a filter 2026-04-20 20:50:19 +08:00
Zhao Zhili c395fbcfd4 avfilter/dnn: Use dnn_backend_info_list to search for dnn module
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:50:19 +08:00
openvela-robot 7b5d8cac3a libavcode/x86/vvc: change label to vvc_sad_16 to reflect block sizes
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that  8x16, 16x8, and 16x16 are the only allowed sizes. This re-labels vvc_sad_16_128 to vvc_sad_16 to reflect this and adds a comment about the block size constraints. There's no functionality change.
2026-04-20 20:50:15 +08:00
openvela-robot a9bd2a22c2 FFMPEG: Support opus offload encoding
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2026-04-20 20:50:03 +08:00
Andreas Rheinhardt 9d63f27d2a avfilter/af_atempo: Fix indentation
Forgotten after b8f74ee57a6e9e75a507adcddf30f84dd4a39d39.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:55 +08:00
Andreas Rheinhardt e6b50c2186 avfilter/af_atempo: Simplify resetting
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 a5704659e3,
so simply use yae_release_buffers() everywhere.

Reviewed-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:55 +08:00
Andreas Rheinhardt da58897818 avfilter/af_atempo: Properly check av_tx_init()
Fixes Coverity issue #1516804.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:55 +08:00
Zhao Zhili ad32883fef avfilter/vf_dnn_detect: Fix null pointer dereference
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-04-20 20:49:52 +08:00
Andreas Rheinhardt c64641249c avfilter/vf_signalstats: Reindent after the previous commit
Also use loop scope for iterators while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:52 +08:00
Andreas Rheinhardt 5269ddd283 avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:51 +08:00
Andreas Rheinhardt d9601dd72a avfilter/vf_signalstats: Use av_dict_set_int() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:51 +08:00
LuMingYin c729bd65ed libavfilter/vf_curves: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-04-20 20:49:51 +08:00
Andreas Rheinhardt e744371482 avfilter/vf_v360: Add assert to suppress Coverity false positives
Should fix many Coverity false positives, namely #1457947-#1457994
as well as #1461195-#146210.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:51 +08:00
Andreas Rheinhardt 7241cceea7 fftools, avfilter, avformat: Simplify check for "is dictionary empty?"
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:49:50 +08:00
Haihao Xiang d1bbe9cd7a lavfi/qsvvpp: require a dynamic frame pool for output if possible
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2026-04-20 20:49:49 +08:00
Haihao Xiang 86183ce7bd lavfi/qsvvpp: use the right mfxFrameInfo when dynamic frame pool is used
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2026-04-20 20:49:49 +08:00
Andrea Mastroberti f062c722b0 avfilter/smartblur: Added alpha layer support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:49:47 +08:00
Zhao Zhili 80d1f3fa87 avfilter/dnn: Refactor DNN parameter configuration system
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 <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-04-20 20:49:45 +08:00
openvela-robot a6d0ac50e3 lavc/vc1dsp: R-V V mspel_pixels
C908 X60
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c            :  14.7 13.2
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32      :   2.5  2.2
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c            :   3.7  3.5
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i64      :   1.0  1.2
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c            :   9.0  8.0
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi          :   1.0  1.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c            :   2.5  2.2
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi          :   0.5  0.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2026-04-20 20:49:43 +08:00
openvela-robot 4253848f6b FFMPEG: add dsp reboot event notify
Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-04-20 20:49:40 +08:00
openvela-robot a0557ef6a5 lavc/flacdsp: fix CPU requirement for 32-bit LPC 2026-04-20 20:49:36 +08:00
openvela-robot 34879f9974 bluelet: reset 'available' flag when audio path re-setup, avoid this flag is unknown
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 20:49:32 +08:00
Marton Balint 0425876103 avfilter/vf_geq: fix interpolation with 1 pixel width/height
Fixes ticket #9740.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:49:29 +08:00
Marton Balint 987d86da75 avfilter/blend: use a per-thread AVExpr
Otherwise expression state is accessed and changed from multiple threads.

Fixes ticket #10987.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:49:29 +08:00
Marton Balint 877603553d avfilter/blend: put slice parameters to a single struct
This should make future extensibility easier.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:49:29 +08:00
Marton Balint 7b2ad66331 avfilter/vsrc_testsrc: do not round down width and height for color src
ff_draw_rectangle handles subsampling since 2013.

Fixes ticket #10989.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:49:29 +08:00