Commit Graph

110197 Commits

Author SHA1 Message Date
Jun Zhao
639ded10e3 lavc/videotoolbox: fix warnings
fix mixing declarations and code warnings

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2023-04-09 18:12:26 +08:00
Jun Zhao
aa8ff2240c lavc/videotoolboxenc: fix warnings
fix mixing declarations and code and function
declaration without a prototype warnings

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2023-04-09 18:11:58 +08:00
James Almer
82a14f3602 avformat/matroskadec: also validate the mapping when BlockAddIDType is 0
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 15:24:44 -03:00
Jerome Martinez
05e34523bc avcodec/dpx: fix check of minimal data size for unpadded content
stride value is not relevant with unpadded content and the total count
of pixels (width x height) must be used instead of the rounding based on
width only then multiplied by height

unpadded_10bit value computing is moved sooner in the code in order to
be able to use it during computing of minimal content size. Also make sure to
only set it for 10bit.

Fix 'Overread buffer' error when the content is not lucky enough to have
(enough) padding bytes at the end for not being rejected by the formula
based on the stride value

Fixes ticket #10259.

Signed-off-by: Jerome Martinez <jerome@mediaarea.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-08 20:08:18 +02:00
Devin Heitmueller
12d1f7c4b7 avdevice/decklink_enc: Add support for compressed AC-3 output over SDI
Extend the decklink output to include support for compressed AC-3,
encapsulated using the SMPTE ST 377:2015 standard.

This functionality can be exercised by using the "copy" codec when
the input audio stream is AC-3.  For example:

./ffmpeg -i ~/foo.ts -codec:a copy -f decklink 'UltraStudio Mini Monitor'

Note that the default behavior continues to be to do PCM output,
which means without specifying the copy codec a stream containing
AC-3 will be decoded and downmixed to stereo audio before output.

Thanks to Marton Balint for providing feedback.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-08 20:08:18 +02:00
James Almer
30f1f89572 fate/matroska: add HDR10+ muxing tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:28:41 -03:00
James Almer
bda44f0f39 avformat/matroskaenc: support writing Dynamic HDR10+ packet side data
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:28:41 -03:00
James Almer
e1f691b2e8 avformat/matroskadec: remove itu_t_t35 flag from MatroskaTrack
It's no longer needed after 88de01d878.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:21:56 -03:00
James Almer
6d31619af2 avformat/matroskadec: validate MaxBlockAdditionID in the presence of BlockAdditions
The Matroska spec requires it to be equal to the highest BlockAddID value in a
BlockAdditions, but being purely an informative element, only abort if strict
compliance is requested, as demuxing is otherwise unaffected.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-07 14:13:03 -03:00
James Almer
2133cadfcf avformat/matroskadec: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-07 11:57:17 -03:00
James Almer
88de01d878 avformat/matroskadec: parse all BlockAdditionMapping elements and export the correct value as BlockAdditional side data
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-07 11:55:47 -03:00
J. Dekker
b564ad8eac lavc/aarch64: add hevc deblock chroma 8-12bit
Benched on Ampere Altra:

hevc_h_loop_filter_chroma8_c: 367.7
hevc_h_loop_filter_chroma8_neon: 31.0
hevc_h_loop_filter_chroma10_c: 396.7
hevc_h_loop_filter_chroma10_neon: 27.5
hevc_h_loop_filter_chroma12_c: 377.0
hevc_h_loop_filter_chroma12_neon: 31.7
hevc_v_loop_filter_chroma8_c: 369.0
hevc_v_loop_filter_chroma8_neon: 55.0
hevc_v_loop_filter_chroma10_c: 389.0
hevc_v_loop_filter_chroma10_neon: 54.0
hevc_v_loop_filter_chroma12_c: 389.5
hevc_v_loop_filter_chroma12_neon: 53.0

Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-04-06 06:54:26 +02:00
J. Dekker
68c151cb1b checkasm: add hevc_deblock chroma test
Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-04-06 06:16:57 +02:00
Jerome Martinez
feeeefc3db
avformat/mxfenc: reject unsupported ffv1 versions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-06 00:50:01 +02:00
Jerome Martinez
f0cd5610e0
avcodec/ffv1dec: reject unsupported ffv1 versions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-06 00:50:01 +02:00
Michael Niedermayer
916be62da1
tests/fate/vcodec.mak: drop strict experimental from j2k tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-06 00:49:34 +02:00
Devin Heitmueller
33ef8778e0 avdevice/decklink_enc: Add support for output of Active Format Description (AFD)
Implement support for including AFD in decklink output when putting
out 10-bit VANC data.

Updated to reflect feedback in 2018 from Marton Balint <cus@passwd.hu>,
Carl Eugen Hoyos <ceffmpeg@gmail.com> and Aaron Levinson
<alevinsn_dev@levland.net>.  Also includes fixes to set the AR field
based on the SAR, as well as now sending the AFD info in both fields
for interlaced formats.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-06 00:40:42 +02:00
Marton Balint
88da4b5fcd fate: split mxf test dependencies to DV and MPEG2
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-06 00:40:42 +02:00
Marton Balint
8f534618b5 avformat/mxfdec: treat Random Index Pack as end of file
RIP, if exists is the last KLV item in the MXF files therefore we can stop
parsing the file if it is encountered. This allows us to support files created by
broken muxers such as OpenCube MXFTk Advanced 2.8.0.0.1. which dumps some extra
garbage after the RIP.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-06 00:40:42 +02:00
James Almer
61b27b15fc avutil/hdr_dynamic_metadata: allow av_dynamic_hdr_plus_to_t35() to accept an existing buffer
The function now accepts an existing buffer to avoid unnecessary allocations,
as well as only reporting the needed amount of bytes if you pass a NULL pointer
as input for data.
For this, both parameters become input and output, as well as making data
optional. This is backwards compatible, and as such not breaking any existing
use of the function in external code (if there's any).

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
James Almer
1c2a1e0750 avformat/matroskaenc: write a MaxBlockAdditionID element
A non zero value is mandatory for Matroska if the track has blocks with BlockAdditions.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
James Almer
00fde8063a avformat/matroska: add a few more Block Addition ID Type enum values
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
James Almer
c73cf41f1e avformat/matroskadec: export Dynamic HDR10+ packet side data
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
James Almer
6def862559 avformat/matroskadec: set the default value for BlockAddIDType
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
James Almer
44513156e3 avformat/matroskadec: support parsing more than one BlockMore element
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
Anton Khirnov
2244722f1f doc/ffmpeg: rewrite the introductory paragraph
This is not the place to boast about high-quality polyphase filters -
the most important feature of the program is its universality.
2023-04-04 11:45:51 +02:00
Anton Khirnov
bf6df790c2 doc/ffmpeg: refine program title
It is a media converter, not just a video converter.
2023-04-04 11:45:44 +02:00
Anton Khirnov
1d3f7178ae lavf/mux: clarify log messages when choosing oformat fails
Current log messages talk about 'suitable' output formats. This is
confusing, because it suggests that some formats are suitable, while
others are not, which is not the case.

Also, suggest possible user actions when format cannot be guessed from a
filename.
2023-04-04 11:44:54 +02:00
Anton Khirnov
dffb058f3b lavf: fall back to a more meaningful log instance name
An uninitialized AVFormatContext instance with neither iformat nor
oformat set will currently log as 'NULL', which is confusing and
unhelpful. Print 'AVFormatContext' instead, which provides more
information.

This happens e.g. if choosing an output format fails in
avformat_alloc_output_context2().

E.g. with the following commandline:
 ffmpeg -i <input> -f foobar -y /dev/null
before: [NULL @ 0x5580377834c0] Requested output format 'foobar' is not a suitable output format
after:  [AVFormatContext @ 0x55fa15bb34c0] Requested output format 'foobar' is not a suitable output format
2023-04-04 11:42:52 +02:00
James Almer
97c95961f0 avcodec/libfdk-aaceenc: add a flush callback
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-03 20:15:13 -03:00
James Almer
4c00aa036e avcodec/libx264: add a flush callback
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-03 20:15:13 -03:00
Kyle Manning
9a245bdf5d avcodec/nvenc: fix b-frame DTS behavior with fractional framerates
When using fractional framerates (or any fraction with a numerator != 1),
DTS values for packets would be calculated incorrectly.

Signed-off-by: Kyle Manning <tt2468@irltoolkit.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2023-04-03 11:59:36 +02:00
Gyan Doshi
6941788d24 avformat/movenc: correct loci parameter handling
3GPP TS 26.244 Table 8.10 specifies that longitude is written before
latitude. The MOV demuxer already expects the correct order. So, write
them in that order.

However, the user supplied string may also be used in MOV mode which
requires ISO 6709 format which specifies latitude first. The demuxer
also exports the loci value in that format. So parser adjusted as well.
2023-04-03 15:00:16 +05:30
Michael Niedermayer
c6dedaf491
tests: Add more j2k tests to cover a wider range of cases
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:52 +02:00
Michael Niedermayer
5666c3b8be
avcodec/j2kenc: Add alpha support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:52 +02:00
Michael Niedermayer
60ccb3fe78
Remove libopenjpeg decoder
We do not support other video/image decoders when we have our own.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:51 +02:00
Michael Niedermayer
35b8b4f229
avcodec/j2kenc: support threads
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:51 +02:00
Michael Niedermayer
b2404bd9aa
avcodec/j2kenc: More complete list of supported pixel formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:51 +02:00
Michael Niedermayer
b41dabd00d
avcodec/j2kenc: Planar RGB support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:50 +02:00
Michael Niedermayer
ad4d647591
avcodec/j2kenc: Replace RGB24 special case by generic test
This fixes RGB48 with libavcodec as decoder

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:50 +02:00
Michael Niedermayer
7fb70d27a2
avcodec/j2kenc: Replace BGR48 / GRAY16 test by test for number of bits
BGR48 is not supported and this was probably meant to be RGB48 so this fixes
RGB48 a bit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:50 +02:00
Michael Niedermayer
644d15716d
avcodec/j2kenc: simplify pixel format setup
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:49 +02:00
Michael Niedermayer
b7418f768c
avcodec/j2kenc: Add AV_PIX_FMT_YUV440P
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:49 +02:00
Michael Niedermayer
816676085e
avcodec/j2kenc: Fix funky bpno errors on decoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:49 +02:00
Michael Niedermayer
0adb375377
avcodec/j2kenc: remove misleading pred value
This field is only checked for being 0 or not and not zero means 5/3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:48 +02:00
Michael Niedermayer
f6955b6df4
avcodec/j2kenc: fix 5/3 DWT identifer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:48 +02:00
Michael Niedermayer
dab1cd2dc0
avcodec/vp3: Check width to avoid assertion failure
Fixes: Assertion failure on x86-32
       av_assert2(block_w * sizeof(pixel) <= FFABS(buf_linesize)); in ff_emulated_edge_mc()
Fixes: 39641/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-5925660741206016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:48 +02:00
Michael Niedermayer
6d1d8609ac
avcodec/g729postfilter: Limit shift in long term filter
Fixes: shift exponent 34 is too large for 32-bit type 'int'
Fixes: 57389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-6229522659016704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:47 +02:00
Michael Niedermayer
c2ed905b68
avcodec/vc1dec: Use av_fast_realloc() for slices
Fixes: Timeout
Fixes: 57281/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-4594141064724480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:47 +02:00
Michael Niedermayer
1942dbb8ca
avcodec/wavarc: Fix several integer overflows
Fixes: signed integer overflow: -532410125 + -1759642300 cannot be represented in type 'int'
Fixes: 57045/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-637023665297817

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:47 +02:00