Commit Graph

116221 Commits

Author SHA1 Message Date
Rémi Denis-Courmont
4d42288748 configure: remove stray bfin architecture
This seems to have been omitted in
880e2aa236.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-15 09:43:06 +02:00
Rémi Denis-Courmont
0cd153a2a3 avr32: remove explicit support
The vendor has long since switched to Arm, with the last product
reaching their official end-of-life over 11 years ago. Linux support for
the ISA was dropped 7 years ago. More importantly, this architecture was
never supported by upstream GCC, and the vendor fork is stuck at version
4.2, which FFmpeg no longer supports (as per C11 requirement).

Presumably, this is still the case given the lack of vendor support.
Indeed all of the code being removed here consisted of inline assembler
scalar optimisations. A sane C compiler should be able to perform those
automatically nowadays (with the sole exception of fast CLZ detection),
but this is moot as this architecture is evidently dead.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-15 09:43:06 +02:00
Paul B Mahol
ee83f351bc avfilter: add audio dequantization filter 2024-06-15 09:43:05 +02:00
Paul B Mahol
9fd315c8e2 avfilter/af_afade: refactor code 2024-06-15 00:31:16 +02:00
Nicolas Gaullier
7b223b8fc5 avfilter/framesync: fix forward EOF pts
Note1: when the EOF pts is not accurate enough, the last frame
can be dropped by vf_fps with default rounding.

Note2: vf_scale use framesync since e82a3997cdd6c0894869b33ba42430ac3,
so this is a very commonplace scenario.

For example:
./ffprobe -f lavfi testsrc=d=1,scale,fps -of flat \
  -count_frames -show_entries stream=nb_read_frames

Before:
streams.stream.0.nb_read_frames="24"

After:
streams.stream.0.nb_read_frames="25"
2024-06-14 15:05:01 +02:00
Tomas Härdin
a1c96cbe0f lavu/intmath.h: Fix UB in ff_ctz_c() and ff_ctzll_c()
Found by value analysis

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:01 +02:00
Tomas Härdin
c717e525ba lavu/common.h: Fix UB in av_clip_uintp2_c()
Found by value analysis

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:01 +02:00
Tomas Härdin
90e108a2e9 lavu/common.h: Fix UB in av_clip_intp2_c()
Found by value analysis

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
Tomas Härdin
ef6ea6e31a lavu/common.h: Fix UB in av_clipl_int32_c()
Found by value analysis

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
Niklas Haas
ecef34a7c2 avcodec/dovi_rpu{enc,dec}: fix ms_weight handling
The code as written was wrong. In the spec, these fields are treated
merely as plain integers in the range 0 to 4095. The only difference
between L2 and L8 is that L2.ms_weight also accepts an additional value
of -1, hence the extra sign bit. While it's likely that these are still
shifted integers in disguise, since all real-world samples seem to use
a value of 2048 here, the offset used in the code was wrong.

In addition, because the l8.ms_weight struct member is unsigned, these
wrong shifting semantics ended up overflowing the field, leading to
undefined behavior when transcoding. Fortunately, the damage was
relatively contained in practice, because it just corrupts the coding of
this field, which is ignored in practice in all implementations I have
seen.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
James Almer
534f671fbc avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
James Almer
22021b7ebe avcodec: use the renamed av_zero_extend
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
James Almer
f23c47f7b6 avutil/common: assert that bit position in av_zero_extend is valid
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
James Almer
c24d1b47c3 avutil: rename av_mod_uintp2 to av_zero_extend
It's more descriptive of what it does.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-14 15:05:00 +02:00
Paul B Mahol
60fe9b4f41 avfilter/buffersink: add av_buffersink_close() 2024-06-14 15:05:00 +02:00
Paul B Mahol
e13fa5872a avfilter/af_apad: make sure that all frames are flushed at EOF 2024-06-14 15:05:00 +02:00
Paul B Mahol
c67153908e avfilter/af_afir: small refactoring
Free no longer needed buffers.
Move ch_gain* to IR structure.
Move delay to IR structure.
Remove store only pts field.
2024-06-14 12:46:18 +02:00
Paul B Mahol
be49e2ade9 avfilter/adynamicequalizer_template: better compare equal floats 2024-06-14 12:46:16 +02:00
Paul B Mahol
6af14ec064 avfilter: add aidentity filter 2024-06-14 12:46:15 +02:00
Rémi Denis-Courmont
084a8c006b sh4: remove architecture
Support for SuperH was dropped over a decade ago. There no longer is any
architecture-specific code to be found, so just remove the corresponding
test. Technically it is still possible to compile FFmpeg as the
"generic" (pure C) architecture.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
Rémi Denis-Courmont
10285e8875 lavu/bswap: remove some inline assembler
C code or compiler built-ins are preferable over inline assembler for
byte-swaps as it allows for better optimisations (e.g. instruction
scheduling) which would otherwise be impossible.

As with f64c2e710f for x86 and Arm,
this removes the inline assembler on GCC (and Clang) since we now
require recent enough compiler versions. This indeed seems to work on
AArch64, SuperH and, if Zbb is enabled, RISC-V. (AVR32 was not tested
since it has no known working compilers at this time.)

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
Rémi Denis-Courmont
b3583f545b lavu/x86: remove GCC 4.4- stuff
Since the C11 support is required, those GCC versions can no longer be
supported anyhow. (Clang pretends to be GCC 4.4, but it looks like the
code was intended for old GCC specifically.)

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
Rémi Denis-Courmont
e6bdfc1f0c lavu/arm: remove GCC 4.6- stuff
Since the C11 support is required, those GCC versions can no longer be
supported anyhow. (Clang pretends to be GCC 4.4, but the removed code
does not seem to have been intended for Clang.)

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
James Almer
5200d0b509 checkasm/lls: add missing random values to the test buffers
Fixes valgrind warnings after 18adaf9fe558587cb1b707c647af83015b69da48.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
Anton Khirnov
52276e43e1 lavc/hevcdec: always call hevc_frame_end() after successfully decoding an AU
Currently it is only done if the final CTB address is at the end of the
frame, however that address is not known with hwaccel decoding. As we
only support exactly one AU per packet, and not partial/multiple AUs, we
can just as well call hevc_frame_end() unconditionally.

Fixes hwaccel decoding after d725c737fe2a19091b481d4d115fd939e0a674b2.

Reported-by: llyyr <llyyr.public@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
Marton Balint
c114d98f5e avformat/mxfdec: use the newly added channel ids for more exact mapping
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
Marton Balint
c8d44209df avformat/mov_chan: make iso_channel_position table more compact
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
Marton Balint
8f2ee60617 avformat/mov_chan: use the newly added channel ids for more exact mapping
Also make the iso_channel_position table consistent with what the AAC decoder
uses in avcodec/aac/aacdec_usac.c.

Fate changes are caused by the change of how 7.1 layout is mapped, previously
it included Side Surround channels, now it includes the Surround channels.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
sunyuechi
098b5afc8d lavc/vp8dsp: R-V V bilin_load to bilin_load_h
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
sunyuechi
2f8f54b5a6 lavc/vp8dsp: R-V V put_bilin_h v unroll
Since len < 64, the registers are sufficient, so it can be
directly unrolled (a4 is even).

Another benefit of unrolling is that it reduces one load operation
vertically compared to horizontally.

                                 old                 new
                             C908   X60          C908   X60
vp8_put_bilin4_h_c         :    6.2    5.5     :    6.2    5.5
vp8_put_bilin4_h_rvv_i32   :    2.2    2.0     :    1.5    1.5
vp8_put_bilin4_v_c         :    6.5    5.7     :    6.2    5.7
vp8_put_bilin4_v_rvv_i32   :    2.2    2.0     :    1.2    1.5
vp8_put_bilin8_h_c         :   24.2   21.5     :   24.2   21.5
vp8_put_bilin8_h_rvv_i32   :    5.2    4.7     :    3.5    3.5
vp8_put_bilin8_v_c         :   24.5   21.7     :   24.5   21.7
vp8_put_bilin8_v_rvv_i32   :    5.2    4.7     :    3.5    3.2
vp8_put_bilin16_h_c        :   48.0   42.7     :   48.0   42.7
vp8_put_bilin16_h_rvv_i32  :    5.7    5.0     :    5.2    4.5
vp8_put_bilin16_v_c        :   48.2   43.0     :   48.2   42.7
vp8_put_bilin16_v_rvv_i32  :    5.7    5.2     :    4.5    4.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
Paul B Mahol
28942f1b67 avfilter/avfiltergraph: improve sample-rate picking
Fixes possible hang with A->V filtergraphs.
2024-06-13 11:01:00 +02:00
Paul B Mahol
e95db011d4 avfilter/avfiltergraph: fix samplerate picking
Previous implementation was suboptimal.
2024-06-12 18:21:34 +02:00
Frank Plowman
0e2b4ad281 lavc/vvc: Prevent overflow in chroma QP derivation
On the top of p. 112 in VVC (09/2023):

It is a requirement of bitstream conformance that the values of
qpInVal[ i ][ j ] and qpOutVal[ i ][ j ] shall be in the range
of −QpBdOffset to 63, inclusive for i in the range of 0 to
numQpTables − 1, inclusive, and j in the range of 0 to
sps_num_points_in_qp_table_minus1[ i ] + 1, inclusive.

Additionally, don't discard the return code from sps_chroma_qp_table.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
2f8ea9f62f api/api-band-test: Query codec capabilities to decide admissibility
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
defe49c0d9 api/api-band-test: Perform codec admissibility check earlier
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
f2e61dc423 api/api-band-test: Remove write-only variable
Besides being write only it had the wrong type:
An uint8_t is definitely not enough to store the size
of these buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
a41a80e5e8 avcodec/mpegvideo_enc: Don't pretend ff_dct_encode_init() can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
690cd9294d avcodec/mpegvideo: Remove fast_dct_quantize
It has been added in 3a87ac948f,
but there was never an implementation different from the ordinary
dct_quantize of it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
30b658db08 avcodec/mpegvideo_enc: Always set c funcs in ff_dct_encode_init()
Use the common approach whereby the _c versions are set first
and then (potentially) overwritten by the arch-specific ones
instead of calling the arch-specific code first, followed by
setting the function pointers that have not already been set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
9d673966b8 avcodec/mips/mpegvideo: Set denoise_dct only for encoder
The C version is set in ff_dct_encode_init(), yet the MIPS version
is set in dct_init() (in ff_mpv_common_init() and therefore also
for decoders). This commit fixes this inconsistency.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
e46e7ad4df avcodec/mpegvideo_enc: Move initializing H263DSP to ituh263enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
cb7df31951 avcodec/mpegvideo_enc: Make ff_dct_quantize_c() static
Only used here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
522cc2afdb avcodec/dnxhdenc: Remove always-false check
Always false since 49331f7ba3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
b51d118eda avcodec/vc1_pred: Fix indentation
Forgotten after 41f9742053.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
9d5342e1b6 avcodec/mpegvideo_enc: Binarize reference
The H.264 decoder used reference to store its picture_structure
into it; yet it does not use mpegvideo any more since commit
2c54155407. Afterwards commit
629259bdb5 removed the last remnants.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:48 +02:00
Andreas Rheinhardt
abdbdf7264 avcodec/ituh263enc: Remove redundant check
It is redundant due to the identical check in ff_mpv_encode_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:48 +02:00
Andreas Rheinhardt
ea1eae6745 avcodec/mpegvideo: Use enum for msmpeg4_version
Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:48 +02:00
Andreas Rheinhardt
ae0eb1340e avcodec/mpegvideo: Remove pblocks
It has been added in a579db0c4f
due to XvMC, but today it is only used to swap U and V
for VCR2, a MPEG-2 variant with U and V swapped.
This can be done in a simpler fashion, namely by simply
swapping the U and V pointers of the corresponding
MPVWorkPictures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:48 +02:00
Andreas Rheinhardt
142988b6fe avcodec/mpeg12dec: Don't initialize inter_scantable
MPEG-1/2 only needs one scantable and therefore all code
already uses the intra one. So stop initializing
the inter one altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:48 +02:00
Andreas Rheinhardt
e8c47f8427 avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start()
Avoids a cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:48 +02:00