Commit Graph

115279 Commits

Author SHA1 Message Date
Andreas Rheinhardt
a7e506fcd8 avcodec/vc1_parser: Check init_get_bits8()
Addresses Coverity issue #1441935.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:49:33 +02:00
Andreas Rheinhardt
95937d6316 avcodec/codec_desc: Mark AVRN, TGQ, PhotoCD, VBN as intra-only
Also remove the then redundant assignments of AV_FRAME_FLAG_KEY,
AV_PICTURE_TYPE_I.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:55 +02:00
Andreas Rheinhardt
2a00d68c09 avcodec/yop: Add missing AV_CODEC_CAP_DR1
This decoder does not do anything fancy any more since
c6303f8d70 (before that,
it overwrote the frame's linesize) so that it supports
direct rendering. This effectively reverts
d3de3a16d1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:43 +02:00
Andreas Rheinhardt
df3cdf4c75 avcodec: Remove redundant setting of AV_FRAME_FLAG_KEY, AV_PICTURE_TYPE_I
This is done generically now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:07 +02:00
Andreas Rheinhardt
eee88ba0dc avcodec/decode: Set KEY flag+pict_type generically for intra-only codecs
This commit is the analog of 3f11eac757
for decoding: It sets the AV_FRAME_FLAG_KEY and (for video decoders)
also pict_type to AV_PICTURE_TYPE_I. It furthermore stops setting
audio frames as always being key frames -- it is wrong for e.g.
TrueHD/MLP. The latter also affects TAK and DFPWM.

The change already improves output for several decoders where
it has been forgotten to set e.g. pict_type like speedhq, wnv1
or tiff. The latter is the reason for the change to the exif-image-tiff
FATE test reference file.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:45 +02:00
Andreas Rheinhardt
41fc62f2e8 avcodec/codec_desc, jvdec: JV is not intra-only
It reuses the previous frame and does not code unchanged blocks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:35 +02:00
Andreas Rheinhardt
876a25027c avcodec/mlpdec: Set AV_FRAME_FLAG_KEY explicitly
It is currently always set for all audio frames, but this is
wrong (namely for MLP/TrueHD) and will be changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:18 +02:00
Rémi Denis-Courmont
259c639137 lavc/vp9_intra: fix another .irp use with LLVM as 2024-05-19 10:22:46 +03:00
Rémi Denis-Courmont
8cea66a73c lavc/vp9_intra: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont
cbe51ebf93 lavc/vp8dsp: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont
fa47299516 lavc/startcode: add R-V V startcode_find_candidate 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont
4ad5b9c8db lavc/startcode: add R-V Zbb startcode_find_candidate
The main loop processes 8 bytes in 5 instructions.
For comparison, the optimal plain strnlen() requires 4 instructions per
byte (6.4x worse): LBU; ADDI; BEQZ; BNE. The current libavcodec C code
involves 5 instructions per byte (8x worse). Actual benchmarks may be
slightly less favourable due to latency from ORC.B to BNE.
2024-05-19 10:03:49 +03:00
Marcus B Spencer
8b8b555de0 avformat/aacdec: strictly conform to K&R style
In the K&R style, a single-statement block does not have braces.
Edit the code to conform to this rule.

It is FFmpeg's code formatting convention to use K&R style.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
2024-05-19 01:26:40 +02:00
James Almer
7e59f02c14 fate/lavf-container: add a test for VVC in mp4 muxing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:30:32 -03:00
James Almer
3765305928 configure: split ISOBMFF writer helpers into a separate component
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:35 -03:00
James Almer
9ab8dddf1f avformat/vvc: use align_get_bits() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:35 -03:00
James Almer
f00b23453c avformat/vvc: reduce the scope of some variables
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:24 -03:00
James Almer
a48203d51a avformat/vvc: fix parsing some early VPS bitstream values
vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:35:27 -03:00
James Almer
f121d52b35 avformat/vvc: remove duplicate struct
VVCCProfileTierLevel is the same as VVCPTLRecord since the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
James Almer
cba15ca0ec avformat/vvc: generalize calculating num_bytes_constraint_info
Will be useful for when the aditional bits are supported, as well as for the
next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
James Almer
415dfa89e2 avformat/vvc: fix writing general_constraint_info bytes
The existing implementation was completely broken.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
Zhao Zhili
8c21f1e3b7 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>
2024-05-18 19:44:50 +08:00
Brad Smith
115c96b9bd avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-18 07:38:40 -04:00
Aaron Thompson
be3404bbac lavc/libvpxenc: Fix parsing of ts_layering_mode parameter
The value was being parsed as base 4, so the value "4" was invalid and
would result in ts_layering_mode being set to 0.

Signed-off-by: Aaron Thompson <dev@aaront.org>
Signed-off-by: James Zern <jzern@google.com>
2024-05-17 15:40:31 -07:00
James Almer
727a603158 checkasm/h264dsp: use int64_t scale values
Fixes "signed integer overflow: [varies] * 104858 cannot be represented in type 'int'" errors
under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-17 17:04:08 -03:00
sunyuechi
d521b7280c lavc/vp9dsp: R-V V ipred tm
C908:
vp9_tm_4x4_8bpp_c: 116.5
vp9_tm_4x4_8bpp_rvv_i32: 43.5
vp9_tm_8x8_8bpp_c: 416.2
vp9_tm_8x8_8bpp_rvv_i32: 86.0
vp9_tm_16x16_8bpp_c: 1665.5
vp9_tm_16x16_8bpp_rvv_i32: 187.2
vp9_tm_32x32_8bpp_c: 6974.2
vp9_tm_32x32_8bpp_rvv_i32: 625.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-17 18:12:11 +03:00
Rémi Denis-Courmont
88d973a5d6 lavc/flacdsp: R-V V flac_wasted33
T-Head C908:
flac_wasted_33_c:       786.2
flac_wasted_33_rvv_i64: 486.5
2024-05-17 18:08:04 +03:00
Andreas Rheinhardt
784672b833 tests/checkasm/sw_gbrp: Use correct function types for calls
E.g. f2de911818 forgot to
add the unused void* here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:36:03 +02:00
Andreas Rheinhardt
9126705e6e tests/checkasm/vf_blend: Update function type
Forgotten in 5b8faaad6c,
a69a0b689c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:35:33 +02:00
Andreas Rheinhardt
caec57eb3a tests/checkasm/vf_bwdif: Use correct function pointer type
Forgotten in fa06f48371.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:37 +02:00
Andreas Rheinhardt
4c57cbda67 tests/checkasm/vf_colorspace: Use correct function pointer type
Forgotten in 9b26a8077f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:23 +02:00
Andreas Rheinhardt
e3de22e307 tests/checkasm/vvc_mc: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:09 +02:00
Andreas Rheinhardt
6c0994864e tests/checkasm/vp8dsp: Use correct function pointer type
Forgotten in a54e53a1c4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:30:17 +02:00
Andreas Rheinhardt
dcbdcc3bf5 tests/checkasm/motion: Use correct function pointer type
Forgotten in abb85429f3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:30:06 +02:00
Andreas Rheinhardt
99135a2f8b tests/checkasm/llviddsp: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:29:51 +02:00
Andreas Rheinhardt
631636e582 tests/checkasm/huffyuvdsp: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:29:34 +02:00
Andreas Rheinhardt
895dd370a2 tests/checkasm/hevc_*: Fix funtion pointer types
Forgotten in b3bbbb14d0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:28:20 +02:00
Andreas Rheinhardt
dff0a1557e tests/checkasm/llauddsp: Avoid UB integer overflow
The only multiplicators used in scalarproduct_and_madd_*
are -1, 0 and +1. Yet it is of type int and the checkasm
test uses the complete range of int for it, leading to overflows
that don't happen for actual users.

Fix this by using a more reasonable range for mul: Given
that it is used in v1[i] += v3[i] * mul with v1 being
a 16bit integer, it makes no sense to use values for mul
that don't fit into 16bit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:16:58 +02:00
sunyuechi
d4083ecb7c 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>
2024-05-16 17:08:18 +03:00
Rémi Denis-Courmont
7b47099bc0 lavc/flacdsp: R-V V flac_wasted32
T-Head C908:
flac_wasted_32_c:       949.0
flac_wasted_32_rvv_i32: 278.7
2024-05-15 20:04:08 +03:00
Rémi Denis-Courmont
83e5fdd3f4 lavu/riscv: fix parsing the unaligned access capability
Pointed-out-by: Stefan O'Rear <sorear@fastmail.com>
2024-05-15 20:04:08 +03:00
sunyuechi
0cc8661499 lavc/vp9dsp: R-V V ipred hor
C908:
vp9_hor_8x8_8bpp_c: 74.7
vp9_hor_8x8_8bpp_rvv_i32: 35.7
vp9_hor_16x16_8bpp_c: 175.5
vp9_hor_16x16_8bpp_rvv_i32: 80.2
vp9_hor_32x32_8bpp_c: 510.2
vp9_hor_32x32_8bpp_rvv_i32: 264.0

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:56:06 +03:00
sunyuechi
b82d9f55d1 lavc/vp9dsp: R-V mc copy
C908:
vp9_put4_8bpp_c: 0.7
vp9_put4_8bpp_rvi: 0.5
vp9_put8_8bpp_c: 2.5
vp9_put8_8bpp_rvi: 0.5
vp9_put16_8bpp_c: 16.7
vp9_put16_8bpp_rvi: 1.5
vp9_put32_8bpp_c: 37.2
vp9_put32_8bpp_rvi: 5.7
vp9_put64_8bpp_c: 107.5
vp9_put64_8bpp_rvi: 21.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:52:28 +03:00
sunyuechi
aa9dbd91cf lavc/vp9dsp: R-V ipred vert
C908:
vp9_vert_8x8_8bpp_c: 22.0
vp9_vert_8x8_8bpp_rvi: 15.7
vp9_vert_16x16_8bpp_c: 71.2
vp9_vert_16x16_8bpp_rvi: 39.0
vp9_vert_32x32_8bpp_c: 300.2
vp9_vert_32x32_8bpp_rvi: 135.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:52:25 +03:00
Rémi Denis-Courmont
a3e45063c0 lavc/flacdsp: fix CPU requirement for 32-bit LPC 2024-05-15 19:45:07 +03:00
James Almer
8670615743 checkasm/h264dsp: add missing pixel_mask values
Fixes "runtime error: index 4 out of bounds for type 'uint32_t [3]'" errors
after commit 4ced36744e.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 23:17:30 -03:00
James Almer
e9741f1a6b fate/checkasm: test vvc_alf
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 22:58:21 -03:00
Michael Niedermayer
4ed4f9a6c0
avcodec/jpeg2000dec: remove ST=3 case
Fixes: CID1460979 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-15 03:53:25 +02:00
Michael Niedermayer
8789c550fa
avcodec/qsvdec: Check av_image_get_buffer_size() for failure
Fixes: CID1477406 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-15 03:53:24 +02:00
Marton Balint
b0093ab8a3 avfilter/vf_geq: fix interpolation with 1 pixel width/height
Fixes ticket #9740.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00