Commit Graph

115574 Commits

Author SHA1 Message Date
Frank Plowman
d866f49791 lavc/vvc: Reallocate pixel buffers if pixel shift changes
Allocations in the following lines depend on the pixel shift, and so
these buffers must be reallocated if the pixel shift changes.  Patch
fixes segmentation faults in fuzzed bitstreams.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-04 20:13:47 +08:00
Anton Khirnov
9576a00527 lavc/hevcdec: drop unused HEVCContext.width/height 2024-06-04 11:46:27 +02:00
Anton Khirnov
a13b892080 lavc/hevcdec: deduplicate calling hwaccel decode_params() 2024-06-04 11:46:27 +02:00
Anton Khirnov
e4601cc339 lavc/hevc*: move to hevc/ subdir 2024-06-04 11:46:27 +02:00
Anton Khirnov
ba56a300a9 lavc/hevcdec: drop HEVCContext.frame
It is merely a redundant pointer to cur_frame->f
2024-06-04 11:46:27 +02:00
Anton Khirnov
db84c1c6ef lavc/hevcdec: rename HEVCFrame.frame to just f
This is shorter, loses no information, and is consistent with other
similar structs.
2024-06-04 11:46:23 +02:00
Anton Khirnov
9226514ced lavc/hevcdec: rename HEVCContext.ref to cur_frame
Since it stores a pointer to the current frame.
2024-06-04 11:44:37 +02:00
Anton Khirnov
7ad9400952 lavc/hevcdec: drop HEVCContext.HEVClc
It is merely a pointer to local_ctx[0], which we can just as well use
directly.
2024-06-04 11:36:51 +02:00
Anton Khirnov
67ca18dd56 lavc/hevcdec: drop HEVCLocalContext.gb
In all HEVCLocalContext instances except the first one, the bitreader is
never used for actually reading bits, but merely for passing the buffer
to ff_init_cabac_decoder(), which is better done directly.

The instance that actually is used for bitreading gets moved to stack in
decode_nal_unit(), which makes its lifetime clearer.
2024-06-04 11:36:51 +02:00
Anton Khirnov
ac69e6caf6 lavc/hevcdec: include first row in SliceHeader.offset/size
Will be useful in the following commit.
2024-06-04 11:36:51 +02:00
Anton Khirnov
79c0310aca lavc/hevcdec: drop a useless condition
hls_slice_data_wpp() is only called when num_entry_point_offsets>0
2024-06-04 11:36:51 +02:00
Anton Khirnov
74159cbfc3 lavc/hevcdec: move handling of byte alignment at the end of slice header
Do it in hls_slice_header() rather than cabac_init_decoder() - the
former is a more logical place as according the spec the byte alignment
is a part of the slice header, not slice data. Avoids a second instance
of alignment handling in vaapi_hevc.

Also, check that alignment_bit_equal_to_one is, in fact, equal to one.
2024-06-04 11:36:51 +02:00
James Almer
a14440867c x86/float_dsp: add SSE2 and AVX versions of scalarproduct_double
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-03 22:14:55 -03:00
Lynne
7413b81e50
aacdec_usac: fix typo in debug message 2024-06-04 03:08:46 +02:00
Lynne
f4371029f8
aacdec_usac: fix off by one error check on channel numbers 2024-06-04 03:08:45 +02:00
Lynne
0d93e04bc6
aacdec_usac: error out on receiving too many channels for the current layout
Verify that we have a correct number of channels.
2024-06-04 03:08:45 +02:00
Lynne
39826eacff
aacdec_usac: error out on too many elements
USAC supports up to 64 audio channels, but puts no limit on the total
number of extensions that may be present. Which may mean that there's
a single audio channel, with 65 thousand extension elements.

We assume that 64 elements is the maximum for now. So check the value.
2024-06-04 03:08:44 +02:00
Lynne
b70fdbde9c
aacdec_usac: prevent get_bits(0) in get_escaped_value
Some calls to get_escaped_value() specify 0 bits as the third value.
This would result in get_bits(0), which is not a correct usage of the
get_bits API.
2024-06-04 03:08:39 +02:00
Rémi Denis-Courmont
fd4977c876 lavc/aacencdsp: R-V V quant_bands
T-Head C908:
quant_bands_signed_c:        576.0
quant_bands_signed_rvv_f32:   48.7
quant_bands_unsigned_c:      414.2
quant_bands_unsigned_rvv_f32: 31.7

SpacemiT X60:
quant_bands_signed_c:        497.7
quant_bands_signed_rvv_f32:   23.0
quant_bands_unsigned_c:      353.5
quant_bands_unsigned_rvv_f32: 16.2
2024-06-03 22:43:37 +03:00
Rémi Denis-Courmont
be6f8c439a checkasm: add aacencdsp.quant_bands test 2024-06-03 22:43:37 +03:00
Andreas Rheinhardt
bb3c50b46d avcodec/tiff: Suppress unused variable warnings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-03 16:38:32 +02:00
Andreas Rheinhardt
87a13986bc avformat/nutdec: Don't create inconsistent side data
Forgotten in 65ddc74988.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-03 16:38:15 +02:00
Tomas Härdin
4037d5e103 lavc/speedhqenc: Require width to be a multiple of 16 2024-06-03 14:13:56 +02:00
Tomas Härdin
017a18b026 lavc/speedhqdec: Reindent 2024-06-03 14:13:34 +02:00
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