Commit Graph

115503 Commits

Author SHA1 Message Date
Rémi Denis-Courmont 9238f6cb41 lavu/float_dsp: R-V V scalarproduct_double
C908:
scalarproduct_double_c:       39.2
scalarproduct_double_rvv_f64: 10.5

X60:
scalarproduct_double_c:       35.0
scalarproduct_double_rvv_f64:  5.2
2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont b114952030 lavfi: get rid of bespoke double scalar products 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 73c278d270 lavu/lls: use ff_scalarproduct_double_c() 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 98405d28fa checkasm/float_dsp: add double-precision scalar product 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 6a7c4d60a1 lavu/float_dsp: add double-precision scalar product
The function pointer is appended to the structure for backward binary
compatibility. Fortunately, this is allocated by libavutil, not by the
user, so increasing the structure size is safe.
2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 06fc919aad lavc/sbrdsp: add support for 256-bit vectors
hf_apply_noise_0_c: 35.7
hf_apply_noise_0_rvv_f32: 9.5
hf_apply_noise_1_c: 38.5
hf_apply_noise_1_rvv_f32: 10.0
hf_apply_noise_2_c: 35.5
hf_apply_noise_2_rvv_f32: 9.7
hf_apply_noise_3_c: 38.5
hf_apply_noise_3_rvv_f32: 10.0

Maybe extending the noise table manually is not such great idea, but I
not quite sure how to deal with that otherwise? Allocating the table
dynamically is possible but would require an ELF destructor to clean up.
2024-05-31 22:22:43 +03:00
Anton Khirnov 63a96dbcce lavc/hevc_ps: compactify ShortTermRPS
Do not use larger fields than needed, use size-1 bitfields for flags.

Reduces sizeof(HEVCSPS) by 1280 bytes.
2024-05-31 19:26:06 +02:00
Anton Khirnov 9127819d51 lavc/hevc_ps: reduce the size of ShortTermRPS.used
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.

Reduces sizeof(HEVCSPS) by 1792 bytes.
2024-05-31 19:26:06 +02:00
Anton Khirnov d893667867 lavc/hevc_ps: do not store delta_poc_s[01] in ShortTermRPS
They are only used in vulkan_hevc and are not actually needed, as they
can be computed from delta_poc.

Reduces sizeof(HEVCSPS) by 16kB.

Also, fix a typo (s0->s1) in the code being touched.
2024-05-31 19:26:06 +02:00
Anton Khirnov 4264e4056c lavc/hevc_ps: fix variable signedness in ff_hevc_decode_short_term_rps()
It is actually supposed to go negative in the loop over num_negative
pics, but underflow does not break anything as the result is then
assigned to a signed int.
2024-05-31 19:26:06 +02:00
Anton Khirnov 6fed1841a1 lavc/hevc_ps/HEVCSPS: change flags into uint8_t
Reduces sizeof(HEVCSPS) by 64 bytes.

Also improve flag names: drop redundant suffixes and prefixes, and
consistently use disabled/enabled.
2024-05-31 19:26:06 +02:00
Anton Khirnov bd1a06dc43 lavc/hevc_ps: reduce the size of used_by_curr_pic_lt_sps_flag
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.
2024-05-31 19:26:06 +02:00
Anton Khirnov 72bdbce00d lavc/hevcdec: drop a useless execute() call with 1 job 2024-05-31 19:26:06 +02:00
Anton Khirnov f0aece90d9 lavc/hevcdec: allocate local_ctx as array of structs rather than pointers
It is more efficient and easier to manage.
2024-05-31 19:26:06 +02:00
Anton Khirnov 25ce44efa5 lavc/hevcdec: track local context count separately from WPP thread count
The latter can be lowered while decoding, which would lead to memleaks.
2024-05-31 19:26:06 +02:00
Anton Khirnov a1471ec8ad lavc/hevcdec: rename HEVCContext.HEVClcList to local_ctx
It is more consistent with our naming conventions.
2024-05-31 19:26:06 +02:00
James Almer e0db1f51d6 avcodec/lpc: account for odd len values
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 13:36:02 -03:00
Gyan Doshi 2f184aa89b configure: correct libopenjpeg description
Decoding is no longer possible as the decoder wrapper was removed
in 60ccb3fe78
2024-05-31 21:20:28 +05:30
James Almer 8a1c491354 avcodec/packet: remove reference to old AV_SIDE_DATA_PARAM_CHANGE_ values
They were forgotten in 65ddc74988.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 11:24:37 -03:00
Andreas Rheinhardt 8cbf7e8408 avcodec/diracdec: Mark flush as av_cold
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 0f3090cbd1 avcodec/diracdec: Use FF_CODEC_CAP_INIT_CLEANUP
This was one of the few decoders incompatible with the flag.
Also only call free_sequence_buffers() instead of dirac_decode_flush()
in dirac_decode_end().

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt d9bd5baf9d avcodec/vc2enc: Use already available AVPixFmtDescriptor
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt d1d40a7c9b avcodec/vc2enc: Move transient PutBitContext from ctx to stack
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt c309285666 avcodec/vc2enc: Avoid relocations for short strings
These strings are so short that they can be put directly
into the containing structure, avoiding the pointer
and putting it into .rodata.
Also use chars for interlaced and level while at it, as
these are so small.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 02ecf8d7f3 avcodec/vc2enc: Fix slice length
args->bytes here already includes prefix_bytes (see
SSIZE_ROUND macro), so including it here again and
forgetting it when offsetting skip seems wrong.
This only works because prefix_bytes is currently
always zero in this encoder.
(This has been added in b88be742fa
without any reason.)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt eac8dcb187 avcodec/vc2enc: Remove superfluous error message
ff_get_encode_buffer() already emits an error message of its own.
While just at it, also check for ret < 0 instead of just ret != 0.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt b1702afdfd avcodec/vc2enc: Constify slices->main context pointers
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 6d86146fce avcodec/vc2enc: Avoid void* where possible
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 2d818644a3 avfilter/af_afir: Merge header into af_afir.c
Done in 0df18f29ae,
accidentally undone in 163e737c17.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 21bfc62642 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>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 37cc648fbd avfilter/af_aiir: Remove dead code
Fixes Coverity issue #1468252.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 996e0a57ca avformat/matroskadec: Add assert to silence Coverity false positive
Helps with Coverity issue #1452453.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt dfd0320e23 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>
2024-05-31 14:18:33 +02:00
James Almer 4008a80c1b tests/checkasm/vvc_mc: don't zero the SAD buffers
They will be filled immediately after.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 20:05:21 +08:00
James Almer b70289f354 tests/checkasm/vvc_mc: fix indentation
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 20:05:21 +08:00
Wu Jianhua 442e94e5e4 tests/checkasm/vvc_alf: change alf step size to 8
From Benjamin Bross:
> for ALF where functions are in increments of 4 while 8 should be sufficient according to the spec.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Wu Jianhua 9950f14864 avcodec/x86/vvc/vvc_alf: use xq to match ptrdiff_t
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Wu Jianhua 09d3370c28 avcodec/x86/vvc/vvc_alf: fix integer overflow
Some tests fails with certain seeds

tests/checkasm/checkasm 2325607578 --test=vvc_alf
checkasm: using random seed 2325607578
AVX2:
    vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
  - vvc_alf.alf_filter   [FAILED]
  - vvc_alf.alf_classify [OK]
checkasm: 28 of 9216 tests have failed

Reported-by: James Almer <jamrial@gmail.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Pierre-Anthony Lemieux 249c66bb22
avcodec/jpeg2000dec: fix HT block decoder
Addresses https://trac.ffmpeg.org/ticket/10905

Co-authored-by: Osamu Watanabe <owatanab@es.takushoku-u.ac.jp>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-05-30 21:30:52 -07:00
Shiyou Yin 6b35fcacdb
swscale: [loongarch] Fix undeclared functions prob.
Compile with '--disable-lasx', ‘lumRangeFromJpeg_lasx’ undeclared.

Reviewed-by: 金波 <jinbo@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-31 02:20:23 +02:00
sunyuechi 544acfa2c0 lavc/vp9dsp: R-V V rename ff_avg to ff_vp9_avg
Avoid potential naming conflicts

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont 8a96495fef checkasm/vp8dsp: add VP7 tests 2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont a3d4c73b4e checkasm/vp8dsp: share DSP context across tests
This will simplify later changes.
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont 4fe8f2cc43 riscv: allow passing addend to vtype_vli macro
A constant (-1) is added to the length value, so we can have an added
for free, and optimise the addition away if the addend is exactly 1.
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont add8c46215 Revert "avformat/file: seek back to initial position for fd protocol"
The generally expected behaviour is for software to append from the
current position, not to keep resetting. See also how shell works:
 # (foo && bar) > file
...would normally concatenate the output of both commands to file.

If foo seeks like lavf, bar would instead overwrite the output of
foo (possibly not completely).

This reverts commit 5c3d2177e7.
2024-05-30 18:30:21 +03:00
Zhao Zhili 6de951923b 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>
2024-05-30 18:14:31 +08:00
Zhao Zhili a1fea7e11b 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>
2024-05-30 18:14:27 +08:00
Zhao Zhili abfefbb33b 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>
2024-05-30 18:14:21 +08:00
Zhao Zhili a40df366c4 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>
2024-05-30 18:14:17 +08:00
Zhao Zhili d3db7bbc03 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>
2024-05-30 18:14:10 +08:00