1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

115993 Commits

Author SHA1 Message Date
Ramiro Polla
f6859cade3 swscale/x86: add sse2 and avx2 {lum,chr}ConvertRange
chrRangeFromJpeg_8_c: 22.3
chrRangeFromJpeg_8_sse2: 13.3
chrRangeFromJpeg_8_avx2: 13.3
chrRangeFromJpeg_24_c: 72.8
chrRangeFromJpeg_24_sse2: 22.3
chrRangeFromJpeg_24_avx2: 17.5
chrRangeFromJpeg_128_c: 345.5
chrRangeFromJpeg_128_sse2: 106.0
chrRangeFromJpeg_128_avx2: 57.8
chrRangeFromJpeg_144_c: 380.5
chrRangeFromJpeg_144_sse2: 118.5
chrRangeFromJpeg_144_avx2: 62.3
chrRangeFromJpeg_256_c: 646.3
chrRangeFromJpeg_256_sse2: 218.8
chrRangeFromJpeg_256_avx2: 109.0
chrRangeFromJpeg_512_c: 1461.5
chrRangeFromJpeg_512_sse2: 426.5
chrRangeFromJpeg_512_avx2: 211.5
chrRangeToJpeg_8_c: 37.8
chrRangeToJpeg_8_sse2: 10.5
chrRangeToJpeg_8_avx2: 14.0
chrRangeToJpeg_24_c: 114.3
chrRangeToJpeg_24_sse2: 23.5
chrRangeToJpeg_24_avx2: 16.3
chrRangeToJpeg_128_c: 633.5
chrRangeToJpeg_128_sse2: 107.5
chrRangeToJpeg_128_avx2: 55.0
chrRangeToJpeg_144_c: 758.3
chrRangeToJpeg_144_sse2: 132.0
chrRangeToJpeg_144_avx2: 64.5
chrRangeToJpeg_256_c: 1345.0
chrRangeToJpeg_256_sse2: 218.0
chrRangeToJpeg_256_avx2: 105.3
chrRangeToJpeg_512_c: 2524.0
chrRangeToJpeg_512_sse2: 417.0
chrRangeToJpeg_512_avx2: 218.8
lumRangeFromJpeg_8_c: 11.8
lumRangeFromJpeg_8_sse2: 11.0
lumRangeFromJpeg_8_avx2: 10.3
lumRangeFromJpeg_24_c: 38.5
lumRangeFromJpeg_24_sse2: 15.5
lumRangeFromJpeg_24_avx2: 12.5
lumRangeFromJpeg_128_c: 232.3
lumRangeFromJpeg_128_sse2: 60.0
lumRangeFromJpeg_128_avx2: 26.8
lumRangeFromJpeg_144_c: 259.5
lumRangeFromJpeg_144_sse2: 65.3
lumRangeFromJpeg_144_avx2: 29.0
lumRangeFromJpeg_256_c: 464.5
lumRangeFromJpeg_256_sse2: 107.5
lumRangeFromJpeg_256_avx2: 54.0
lumRangeFromJpeg_512_c: 897.5
lumRangeFromJpeg_512_sse2: 224.5
lumRangeFromJpeg_512_avx2: 109.8
lumRangeToJpeg_8_c: 17.8
lumRangeToJpeg_8_sse2: 11.0
lumRangeToJpeg_8_avx2: 11.8
lumRangeToJpeg_24_c: 56.3
lumRangeToJpeg_24_sse2: 11.0
lumRangeToJpeg_24_avx2: 12.5
lumRangeToJpeg_128_c: 333.8
lumRangeToJpeg_128_sse2: 53.3
lumRangeToJpeg_128_avx2: 26.5
lumRangeToJpeg_144_c: 375.5
lumRangeToJpeg_144_sse2: 60.8
lumRangeToJpeg_144_avx2: 29.0
lumRangeToJpeg_256_c: 652.0
lumRangeToJpeg_256_sse2: 109.5
lumRangeToJpeg_256_avx2: 53.5
lumRangeToJpeg_512_c: 1284.3
lumRangeToJpeg_512_sse2: 218.0
lumRangeToJpeg_512_avx2: 108.3
2024-06-16 00:35:51 +02:00
Ramiro Polla
874152033d checkasm: add tests for {lum,chr}ConvertRange 2024-06-16 00:34:24 +02:00
Osamu Watanabe
6f4a95cfb8
avcodec/jpeg2000dec: fix tilepart processing
Fix http://trac.ffmpeg.org/ticket/10121

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-06-15 10:25:17 -07:00
Thomas Siedel
c75940db29 avcodec: add external enc libvvenc for H266/VVC
Add external encoder VVenC for H266/VVC encoding.
Register new encoder libvvenc.
Add libvvenc to wrap the vvenc interface.
libvvenc implements encoder option: preset,qp,qpa,period,
passlogfile,stats,vvenc-params,level,tier.
Enable encoder by adding --enable-libvvenc in configure step.

Co-authored-by: Christian Bartnik chris10317h5@gmail.com
Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com>
2024-06-15 21:00:05 +08:00
Rémi Denis-Courmont
4e4444f97c configure: remove stray bfin architecture
This seems to have been omitted in
880e2aa236.
2024-06-14 21:28:11 +03:00
Rémi Denis-Courmont
4819aeebf4 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.
2024-06-14 21:28:10 +03:00
Tomas Härdin
be2cabce32 lavu/intmath.h: Fix UB in ff_ctz_c() and ff_ctzll_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin
3b9e457647 lavu/common.h: Fix UB in av_clip_uintp2_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin
60ab40be70 lavu/common.h: Fix UB in av_clip_intp2_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin
818a487849 lavu/common.h: Fix UB in av_clipl_int32_c()
Found by value analysis
2024-06-14 14:28:24 +02:00
Niklas Haas
6225ad5c19 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.
2024-06-14 13:43:55 +02:00
James Almer
08383443ff avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer
1b9af306da avcodec: use the renamed av_zero_extend
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer
4b57ea8fc7 avutil/common: assert that bit position in av_zero_extend is valid
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer
39c90d6466 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>
2024-06-13 20:35:57 -03:00
Sean McGovern
cdd139d760 libavcodec/alpha: remove DSP & support code
Introduced in 1992, the Alpha was a 64-bit RISC processor designed
to replace the VAX CISC machines sold by Digital Equipment Corporation.

After Digital was acquired by Compaq in 1998 -- who themselves would be
later purchased by Hewlett-Packard, the architecture was phased out over
the following decade. It became effectively defunct in 2007, the last
publicly available processor being the Alpha 21364.

FFmpeg has not added any DSP code for this architecture since lowres2
was introduced in 2012, and it is more than unlikely someone still wishes
to maintain it.

Remove the DSP and support code.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-06-13 23:14:26 +02:00
Rémi Denis-Courmont
a5d2d26742 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.
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont
c5f69719bc 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.)
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont
0231097d1b 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.)
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont
424ac84839 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.)
2024-06-13 21:16:16 +03:00
James Almer
a7e9f1c1e7 checkasm/lls: add missing random values to the test buffers
Fixes valgrind warnings after 18adaf9fe5.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 14:21:18 -03:00
Anton Khirnov
0060a368b1 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 d725c737fe.

Reported-by: llyyr <llyyr.public@gmail.com>
2024-06-13 11:44:05 +02:00
Michael Niedermayer
959cb2e2e3
doc/developer: Provide information about git send-email and gmail
The 2 links are the clearest i found.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-13 00:39:57 +02:00
Marton Balint
9fb6f024c3 avformat/mxfdec: use the newly added channel ids for more exact mapping
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Marton Balint
d9a0a6a2b5 avformat/mov_chan: make iso_channel_position table more compact
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Marton Balint
e405afdd0a 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>
2024-06-12 19:37:01 +02:00
sunyuechi
a4901a56c6 lavc/vp8dsp: R-V V bilin_load to bilin_load_h
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-06-12 18:38:41 +03:00
sunyuechi
8d9fb7b5cf 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>
2024-06-12 18:38:41 +03:00
Frank Plowman
d72a5fe719 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>
2024-06-12 20:48:08 +08:00
Andreas Rheinhardt
edcfa846cf api/api-band-test: Query codec capabilities to decide admissibility
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
b8cc5cf233 api/api-band-test: Perform codec admissibility check earlier
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
4c22b00780 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>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
89742b88c6 avcodec/mpegvideo_enc: Don't pretend ff_dct_encode_init() can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:25:10 +02:00
Andreas Rheinhardt
1dc1b6c5af 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>
2024-06-12 13:24:20 +02:00
Andreas Rheinhardt
e80bd068c5 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>
2024-06-12 13:24:09 +02:00
Andreas Rheinhardt
8327828205 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>
2024-06-12 13:23:30 +02:00
Andreas Rheinhardt
adb1521385 avcodec/mpegvideo_enc: Move initializing H263DSP to ituh263enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:23:29 +02:00
Andreas Rheinhardt
bf8208d0cd avcodec/mpegvideo_enc: Make ff_dct_quantize_c() static
Only used here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:20:47 +02:00
Andreas Rheinhardt
f0c021b6ff avcodec/dnxhdenc: Remove always-false check
Always false since 49331f7ba3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:20:41 +02:00
Andreas Rheinhardt
1fe2a97b61 avcodec/vc1_pred: Fix indentation
Forgotten after 41f9742053.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:49 +02:00
Andreas Rheinhardt
bf087a7e26 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>
2024-06-12 12:07:31 +02:00
Andreas Rheinhardt
34ed9d1954 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>
2024-06-12 12:07:20 +02:00
Andreas Rheinhardt
b2ac792367 avcodec/mpegvideo: Use enum for msmpeg4_version
Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:03:00 +02:00
Andreas Rheinhardt
2f6768c761 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>
2024-06-12 12:02:31 +02:00
Andreas Rheinhardt
1f5c64cbdc 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>
2024-06-12 12:02:14 +02:00
Andreas Rheinhardt
9bb35cfa4d avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start()
Avoids a cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:03 +02:00
Andreas Rheinhardt
c703a519a5 avcodec/mpegvideo_dec: Don't sync encoder-only coded_picture_number
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:01:42 +02:00
Andreas Rheinhardt
a13ca893cf avcodec/mpegvideo_dec, rv34: Simplify check for "does pic exist?"
The days in which an MPVPicture* is set with the corresponding frame
being blank are over; this allows to simplify some checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:01:27 +02:00
Andreas Rheinhardt
7e61e77c4e avcodec/mpeg12enc: Simplify writing startcodes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:56:06 +02:00
Andreas Rheinhardt
4f2719a239 avcodec/mpegvideo_enc: Unify initializing PutBitContexts
This also rids us of the requirement to preserve the PutBitContext
in ff_update_duplicate_context().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:55:44 +02:00