Commit Graph

115650 Commits

Author SHA1 Message Date
Tomas Härdin
42d5ddb2de lavc/speedhqdec: Add AV_CODEC_CAP_SLICE_THREADS
Each field slice is assigned to one thread.
Serial performance is unaffected.
2024-06-03 14:13:30 +02:00
Stefano Sabatini
77ad449911 doc/filters/curves: fix typos 2024-06-03 11:24:33 +02:00
Stefano Sabatini
17a759cce1 doc/filters/tiltandshift: apply typo fixes, add introductory description 2024-06-03 11:07:27 +02:00
Marcus B Spencer
26084887b0 doc/developer: update outdated information
Codec IDs have split from `avcodec.h` into `codec_id.h` after commit
c6978418b8.

General documentation contents (which are now in
`general_contents.texi`) have split from the header in `general.texi`
after commit 6accb7718a.

Update the developer documentation to match these changes.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
2024-06-03 10:58:31 +02:00
James Almer
4d59d58ea6 avcodec/aac/aacdec_usac: remove unnecessary cast
Fixes "libavcodec/aac/aacdec_usac.c(543): error C2440: 'type cast': cannot convert from 'GetBitContext' to 'GetBitContext'"
from msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-02 20:14:20 -03:00
Michael Niedermayer
6106177ad6
avcodec/proresenc_anatoliy: Assert that AV_PROFILE_UNKNOWN is replaced
If its not replaced we would have a negative index used in an array potentially

Helps: CID1440385 Negative array index read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:42 +02:00
Michael Niedermayer
160b81ce2a
avcodec/pcm-dvdenc: 64bit pkt-size
It seems nothing prevents such overflow even though odd

Fixes: CID1441934 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:42 +02:00
Michael Niedermayer
19db9636c5
avcodec/notchlc: Check init_get_bits8() for failure
Fixes: CID1500300 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer
161d0aa2a8
avcodec/tests/dct: Use 64bit in intermediate for error computation
Fixes: CID1500284 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer
d741638042
avcodec/scpr3: Check add_dec() for failure
Fixes: CID1441459 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer
e5098589b0
avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()
Helps: CID1548380 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer
6f976db251
avcodec/wavpackenc: Use unsigned for potential 31bit shift
Fixes: CID1465481 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer
30f2bac9f7
avcodec/wavpack: Remove dead assignments
Fixes: CID1442018 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer
2e5433dc12
avcodec/vvc/mvs: Initialize mvf
This might not be needed for correctness but it could
help general reproducability of issues

Related to: CID1560037 Uninitialized scalar variable
Related to: CID1560044 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer
12391b732f
avcodec/tests/jpeg2000dwt: Use 64bit in comparission
Found while reviewing: CID1500309 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer
847a53f264
avcodec/tests/jpeg2000dwt: Use 64bit in err2 computation
This issue cannot happen with the current function parameters

Fixes: CID1500309 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer
348c3a7ffe
avformat/fwse: Remove always false expression
Fixes: CID1460758 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:21 +02:00
Lynne
18757b26bd
aacdec_usac: fix typo in fac_length
The spec says:
fac_length = (window_sequence==EIGHT_SHORT_SEQUENCE) ? ccfl/16 : ccfl/8;

The length used was flipped for short vs long.
2024-06-02 21:12:31 +02:00
James Almer
d8ffd65bfd avcodec/aac/aacdec_usac: remove call to realloc
Must be one of the lavu wrappers instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-02 15:32:04 -03:00
Lynne
63e166d802
lavu: bump minor and add APIchanges entries for the new channel positions 2024-06-02 19:19:25 +02:00
Lynne
24d3291f7c
changelog: add entry for xHE-AAC 2024-06-02 18:34:46 +02:00
Lynne
7852d9e604
libavcodec: bump minor version for xHE-AAC 2024-06-02 18:34:46 +02:00
Lynne
b3212797ae
fate: add tests for xHE-AAC
Starting off small with a few features.
Samples and reference decoded files copied from the official ISO
reference suite.
2024-06-02 18:34:46 +02:00
Lynne
eee5fa0808
aacdec: add a decoder for AAC USAC (xHE-AAC)
This commit adds a decoder for the frequency-domain part of USAC.

What works:
 - Mono
 - Stereo (no prediction)
 - Stereo (mid/side coding)
 - Stereo (complex prediction)

What's left:
 - SBR
 - Speech coding

Known issues:
 - Desync with certain sequences
 - Preroll crossover missing (shouldn't matter, bitrate adaptation only)
2024-06-02 18:34:45 +02:00
Lynne
23b45d7e20
aactab: add new scalefactor offset tables for 96/768pt windows 2024-06-02 18:34:45 +02:00
Lynne
a300ec3569
aactab: add tables for the new USAC arithmetic coder 2024-06-02 18:34:45 +02:00
Lynne
7cd8a3f509
aactab: add deemphasis tables for USAC 2024-06-02 18:34:44 +02:00
Lynne
0513c5cd25
aacdec_dsp: implement 768-point transform and windowing
Required for USAC
2024-06-02 18:34:44 +02:00
Lynne
f8543f3763
aacdec: expose decode_tns
USAC has the same syntax, with one minor change we can check for.
2024-06-02 18:34:43 +02:00
Lynne
0f2303f629
aacdec: expose channel layout related functions 2024-06-02 18:34:43 +02:00
Lynne
39b8d84b53
aacdec: move from scalefactor ranged arrays to flat arrays
AAC uses an unconventional system to send scalefactors
(the volume+quantization value for each band).
Each window is split into either 1 or 8 blocks (long vs short),
and transformed separately from one another, with the coefficients
for each being also completely independent. The scalefactors
slightly increase from 64 (long) to 128 (short) to accomodate
better per-block-per-band volume for each window.

To reduce overhead, the codec signals scalefactor sizes in an obtuse way,
where each group's scalefactor types are sent via a variable length decoding,
with a range.
But our decoder was written in a way where those ranges were carried through
the entire decoder, and to actually read them you had to use the range.

Instead of having a dedicated array with a range for each scalefactor,
just let the decoder directly index each scalefactor.

This also switches the form of quantized scalefactors to the format
the spec uses, where for intensity stereo and regular, scalefactors
are stored in a scalefactor - 100 form, rather than as-is.

USAC gets rid of the complex scalefactor handling. This commit permits
for code sharing between both.
2024-06-02 18:34:43 +02:00
Lynne
caeb275092
channel_layout: add new channel positions supported by xHE-AAC
apichanges will be updated upon merging, as well as a version bump.
2024-06-02 18:34:38 +02:00
Rémi Denis-Courmont
6c6bec04f3 lavc/vc1dsp: fix R-V V avg_mspel_pixels
The 8x8 pixel arrays are not necessarily aligned to 64 bits, so the
current code leads to Bus error on real hardware. This reproducible
with FATE's vc1_ilaced_twomv test case.

The new "pessimist" code can trivially be shared for 16x16 pixel
arrays so we also do that. FWIW, this also nominally reduces the
hardware requirement from Zve64x to Zve32x.

T-Head C908:
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c:      14.7
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32: 3.5
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c:       3.7
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i32: 1.5

SpacemiT X60:
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c:      13.0
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32: 3.0
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c:       3.2
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i32: 1.2
2024-06-02 10:37:09 +03:00
Andreas Rheinhardt
2c38ca3d37 avcodec/hevc_ps: Fix UB 1 << 31
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-02 05:15:00 +02:00
Michael Niedermayer
00d029d5c0
avcodec/sga: Make it clear that the return is intentionally not checked
Related: CID1473496 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:29 +02:00
Michael Niedermayer
70b4994762
avformat/asfdec_f: Use 64bit for preroll computation
Fixes: CID1500342 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer
d9d1f65308
avformat/argo_asf: Use 64bit in offset intermediate
Fixes: CID1467435 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer
a2b8d03347
avformat/ape: Use 64bit for final frame size
Fixes: CID1505963 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer
2f04cb673c
avformat/ac4dec: Check remaining space in ac4_probe()
Fixes: CID1538298 Untrusted loop bound
Fixes: undefined behavior

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:27 +02:00
Michael Niedermayer
6f52b64bcc
avdevice/pulse_audio_enc: Use av_rescale() to avoid integer overflow
Fixes: CID1503075 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:05 +02:00
Rémi Denis-Courmont
eed0a1d3d4 lavu/lls: R-V V update_lls
update_lls_8_c:        7.5
update_lls_8_rvv_f64:  4.2
update_lls_12_c:      14.5
update_lls_12_rvv_f64: 5.7
2024-06-01 18:05:58 +03:00
Rémi Denis-Courmont
fc85aff72f checkasm: add linear least square tests 2024-06-01 18:05:58 +03:00
James Almer
7087da303f avutil/float_dsp.h: fix doxy for scalarproduct_double
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 11:15:30 -03:00
James Almer
7736ca1d7b avutil/float_dsp: revert accidental doxy removal
done by accident in 6a7c4d60a1.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 11:14:42 -03:00
James Almer
7e182a8d92 avcodec/videotoolbox: use the correct HEVCSPS field name
Fixes compilation that was broken in 6fed1841a1.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 10:56:19 -03:00
James Almer
0a949aacae checkasm/lpc: use fixed length to bench apply_welch_window
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 17:06:08 -03:00
Rémi Denis-Courmont
16132a810d checkasm/lpc: test compute_autocorr
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 16:36:43 -03:00
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