1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
Commit Graph

46488 Commits

Author SHA1 Message Date
Andre Kempe
861285c146 arm64: Fix wrong BTI landing pad
This patch fixes a wrong type of BTI landing pad when branching to
functions instantiated via the fft*_neon macro.

Although the previously employed paciasp instruction serves as a landing
pad, for the ways that this function is invoked it is the wrong type, resulting
in an unexpected termination of the running process.

Signed-off-by: André Kempe <andre.kempe@arm.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-04-26 10:26:49 +03:00
Jan Ekström
ded0334d21 avcodec/libsvtav1: add support for setting chroma sample location
Support for configuring this was added with version 1.0.0.
2022-04-26 09:17:47 +03:00
Christopher Degawa
6fd1533057 avcodec/libsvtav1: pass pict_type to library
match the behavior of SvtAv1EncApp to ensure pic_type is always set
before passing it to the library.

The other options for pic_type aren't currently used inside the library,
so they aren't introduced in this patch.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-04-25 20:35:31 -03:00
Christopher Snowhill
944b8c96c9 avcodec/audiotoolboxdec: Properly fill out_format
Monterey needs mBytesPerFrame and mBytesPerPacket to be set, and I'm
surprised this didn't break any previous system versions.

Fixes bug #9564: Cannot decode xHE-AAC with audiotoolbox (aac_at) on
Mac OS Monterey. Fixes likely bug that none of the AudioToolbox
decoders work on Monterey.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-24 19:11:33 -03:00
Paul B Mahol
058a1ff9b4 avcodec/pcm-blurayenc: set fixed number of samples per packet
Other values are forbidden by specification.
2022-04-24 14:26:47 +02:00
Wu Jianhua
037fa0437d avcodec/x86/hevc_mc: add qpel_h64_8_avx512icl
ff_hevc_put_hevc_qpel_h64_8_sse4       56782981
ff_hevc_put_hevc_qpel_h64_8_avx2       40097816
ff_hevc_put_hevc_qpel_h64_8_avx512icl  25488576

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:47:13 +08:00
Wu Jianhua
68437bf169 avcodec/x86/hevc_mc: add qpel_h32_8_avx512icl
ff_hevc_put_hevc_qpel_h32_8_sse4       14122151
ff_hevc_put_hevc_qpel_h32_8_avx2        9337675
ff_hevc_put_hevc_qpel_h32_8_avx512icl   6424654

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:47:09 +08:00
Wu Jianhua
6fbb8cc8ad avcodec/x86/hevc_mc: add qpel_h4_8_avx512icl
ff_hevc_put_hevc_qpel_h4_8_sse4       993694
ff_hevc_put_hevc_qpel_h4_8_avx512icl  686647

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:47:01 +08:00
Wu Jianhua
c1790b60d6 avcodec/x86/hevc_mc: add qpel_h16_8_avx512icl
ff_hevc_put_hevc_qpel_h16_8_sse4       3290870
ff_hevc_put_hevc_qpel_h16_8_avx512icl  1730033

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:46:41 +08:00
Wu Jianhua
d4cd8830bd avcodec/x86/hevc_mc: add qpel_h8_8_avx512icl and qpel_hv8_8_avx512icl
This commit uses the instruction `vpdpbusd` introduced by AVX512 VNNI
to calculate the horizontal filter.

ff_hevc_put_hevc_qpel_h8_8_sse4       1039169
ff_hevc_put_hevc_qpel_h8_8_avx512icl   677153
ff_hevc_put_hevc_qpel_hv8_8_sse4      3603511
ff_hevc_put_hevc_qpel_hv8_8_avx512icl 2995354

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:45:59 +08:00
Leo Izen
cfbde390f3 avcodec/version: bump minor version for Jpeg XL
The version.h bump got missed with the Jpeg XL patchset. This should
bump the minor version in accordance with the contributing guidelines.
2022-04-23 22:57:56 +03:00
Leo Izen
5f0b4e9c70 avcodec/libjxl: add Jpeg XL encoding via libjxl
This commit adds encoding support to libavcodec
for Jpeg XL images via the external library libjxl.
2022-04-23 19:51:46 +02:00
Leo Izen
458cc7e314 avcodec/libjxl: add Jpeg XL decoding via libjxl
This commit adds decoding support to libavcodec
for Jpeg XL images via the external library libjxl.
2022-04-23 19:51:46 +02:00
Leo Izen
0008c15956 avcodec/jpegxl: add Jpeg XL image codec
This commit adds support to libavcodec to read
encoded Jpeg XL images. Jpeg XL is intended to be an
extended-life replacement to legacy mjpeg.
2022-04-23 19:51:46 +02:00
Andreas Rheinhardt
202da3bf48 avcodec/mjpegenc: Don't unnecessarily grow buffer
The size of the ICC chunk has already been accounted for when
the packet's buffer was initially set in ff_mpv_encode_picture()
and the header (including the ICC chunk) has already been written
at this point.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-14 18:38:55 +02:00
Andreas Rheinhardt
f703cbabdb avcodec/mpegvideo_enc: Remove always-true check
It is a remnant of the old way for user-supplied buffers;
it is always-true since 93016f5d1d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-14 18:38:55 +02:00
Andreas Rheinhardt
c3047da646 avcodec/mpegvideo_enc: Fix unnecessary linear growth of buffer
If one encodes MJPEG with a single slice and uses input with
AV_FRAME_DATA_ICC_PROFILE side data, the current allocation code
in ff_mpv_encode_picture() will always increase the size of the
temporary buffer used for allocating packets by the size needed
for to write the ICC chunk even when the current buffer is actually
large enough. This commit fixes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-14 18:38:55 +02:00
Andreas Rheinhardt
4487dd8bb5 avcodec/mpegvideo_enc: Ignore ICC profile size when not MJPEG
MJPEG is the only mpegvideo-based encoder making use of it.
Fixes linking failures in case mpegvideo_enc.c is compiled
with AMV, LJPEG and MJPEG encoders disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-14 18:38:55 +02:00
Andreas Rheinhardt
fa3f9f2f6a avcodec/avcodec: Don't reset decoder-fields for encoders when flushing
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 18:04:25 +02:00
Andreas Rheinhardt
f6e167998f avcodec/avcodec: Simplify accessing AVSubtitleRect via dedicated pointer
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 18:03:40 +02:00
Andreas Rheinhardt
3649051dc4 avcodec/avcodec: Avoid av_frame_unref(NULL)
It works, but it is not documented to work.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 18:03:25 +02:00
Andreas Rheinhardt
3a920372a1 avcodec/encode: Fix check for encoders impl. encode-simple API
FFCodec.cb is a union.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 17:59:34 +02:00
Paul B Mahol
f67403edb3 avcodec/mlpenc: fix encoding after receiving last frame
This happened when major header needed to be written
after input EOF.
2022-04-13 14:22:39 +02:00
Anton Khirnov
e663030267 lavc/encode: pick a sane default for bits_per_raw_sample if it's not set
Fixes #9563.
2022-04-13 12:48:19 +02:00
Anton Khirnov
ee26138e67 lavc/encode: reindent 2022-04-13 12:48:18 +02:00
Anton Khirnov
15975881ae lavc/encode: factor audio/video-specific parts out of ff_encode_preinit() 2022-04-13 12:45:47 +02:00
Anton Khirnov
ce3c20f2aa lavc: move default get_buffer2() to its own file
It is also used by some encoders, so decode.c is not the right place for
it.
2022-04-13 12:15:02 +02:00
Anton Khirnov
32413600e8 lavc/encode: drop EncodeSimpleContext
It has only a single member.
2022-04-13 12:14:30 +02:00
Anton Khirnov
1c01dca144 lavc/avcodec: only allocate the encoding frame for encoders
And only when needed, i.e. for encoders using the simple API.
2022-04-13 12:14:08 +02:00
Anton Khirnov
7efa6418b8 lavc/avcodec: simplify codec id/type validity checking
On entry to avcodec_open2(), the AVCodecContext type and id either have
to be UNKNOWN/NONE or have to match the codec to be used.
2022-04-13 12:13:15 +02:00
Andreas Rheinhardt
7427b87e44 avcodec/mss12: Constify slice context->parent context pointer
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 00:37:13 +02:00
Andreas Rheinhardt
77ed56f0ec avcodec/vbnenc: Add AV_CODEC_CAP_DR1
This encoder uses ff_get_encode_buffer().

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 00:37:06 +02:00
Andreas Rheinhardt
cc0a4fa630 avcodec/vbn(dec|enc): Avoid always-false checks
Do this by switching to bytestream2_(get|put)_le32u() from
bytestream2_(get|put)_le32(); it has after all already been checked
that the packet contains at least a full header, making all
the implicit checks in bytestream2_(get|put)_le32() dead code.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 00:36:57 +02:00
Andreas Rheinhardt
300dd79c3d avcodec/vbn(dec|enc): Avoid leaving stale pointers in context
Therefore move the (Get|Put)ByteContext from the context to the stack.
It is transient anyway.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 00:36:39 +02:00
Andreas Rheinhardt
81b6a10937 avcodec/vbn(dec|enc): Remove empty close function
Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13 00:25:36 +02:00
Paul B Mahol
c2351d5a53 avcodec/mlpenc: simplify calling function 2022-04-12 19:30:58 +02:00
Paul B Mahol
dc068a7265 avcodec/mlpenc: use FFMAX() 2022-04-12 19:30:58 +02:00
Paul B Mahol
cbad385f04 avcodec/mlpenc: improve handling of last samples 2022-04-12 19:30:58 +02:00
Andreas Rheinhardt
3bbbb09a53 avcodec/hevc_sei: Don't use GetBit-API for byte-aligned reads
Instead use the bytestream2-API.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-11 19:19:50 +02:00
Andreas Rheinhardt
cf3f8ab9e6 avcodec/hevc_sei: Fix parsing SEI messages
SEI messages are naturally byte-aligned by adding padding bits
to achieve byte-alignment. The parsing code in libavcodec/hevc_sei.c
nevertheless uses a GetBitContext to read it. When doing so, parsing
the next SEI message starts exactly at the position where reading
the last message (if any) ended.

This means that one would have to handle both the payload extension data
(which makes most SEI messages extensible structs) as well as the
padding bits for byte-alignment. Yet our SEI parsing code in
libavcodec/hevc_sei.c does not read these at all. Instead several of
the functions used for parsing specific SEI messages use
skip_bits_long(); some don't use it at all, in which case it is possible
for the GetBitContext to not be byte-aligned at the start of the next
SEI message (the parsing code for several types of SEI messages relies
on byte-alignment).

Fix this by always using a dedicated GetBitContext per SEI message;
skipping the necessary amount of bytes in the NALU context
is done at a higher level. This also allows to remove unnecessary
parsing code that only existed in order to skip enough bytes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-11 19:19:50 +02:00
Niklas Haas
e254af3154 avcodec/mjpegenc: support writing ICC profiles
This is mostly straightforward. The major complication is that, as a
result of the 16-bit chunk size limitation, ICC profiles may need to be
split up into multiple chunks.

We also need to make sure to allocate enough extra space in the packet
to fit the ICC profile, so modify both mpegvideo_enc.c and ljpegenc.c to
take into account this extra overhead, failing cleanly if necessary.

Also add a FATE transcode test to ensure that the ICC profile gets
written (and read) correctly. Note that this ICC profile is smaller than
64 kB, so this doesn't test the APP2 chunk re-arranging code at all.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-11 17:29:57 +02:00
Niklas Haas
4a580975d4 avcodec/pngenc: support writing iCCP chunks
We re-use the PNGEncContext.zstream for deflate-related operations.
Other than that, the code is pretty straightforward. Special care needs
to be taken to avoid writing more than 79 characters of the profile
description (the maximum supported).

To write the (dynamically sized) deflate-encoded data, we allocate extra
space in the packet and use that directly as a scratch buffer. Modify
png_write_chunk slightly to allow pre-writing the chunk contents like
this.

Also add a FATE transcode test to ensure that the ICC profile gets
encoded correctly.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-11 17:29:57 +02:00
Mark Thompson
9f02e03387 vaapi_encode_h265: Query encoding block sizes and features
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Mark Thompson
77fd2f9c7c vaapi_encode_h265: Explicitly set and correct some flags
max_14bit_constraint_flag should be set if the bit depth is not greater than
14 (currently always true).

one_picture_only_flag should not be set because we don't support the still
picture profiles.

general_profile_compatibility_flag should be set according to general_profile_idc
instead of bit depth.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Mark Thompson
99b333e5ff vaapi_encode: Move block size calculation after entrypoint selection
The block size can be dependent on the profile and entrypoint selected.
It defaults to 16x16, with codecs able to override this choice with their
own function.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Linjie Fu
a285968a0b lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi
Use GPB frames to replace regular P/B frames if backend driver does not
support it.

- GPB:
    Generalized P and B picture. Regular P/B frames replaced by B
    frames with previous-predict only, L0 == L1. Normal B frames
    still have 2 different ref_lists and allow bi-prediction

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Marton Balint
ee50cc18b3 avcodec/vbnenc: add VBN encoder
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint
013d774e22 avcodec/vbndec: add VBN decoder
Add support for decoding Vizrt Binary Image (VBN) files.

LZW-compressed data is not supported yet.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint
a4570d7a66 avcodec/hapenc: use the common texturedsp encode function
And add slice thread capabilities.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint
b3074ac9f4 avcodec/hapdec: use the common texturedsp decode function
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00