Commit Graph

106710 Commits

Author SHA1 Message Date
Andreas Rheinhardt
0bc3ab3a5e tests/Makefile: Add FRAMECRC function
Intended for scenarios that currently use DEMDEC, but are missing
the requirements that are implicitly needed by framecrc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
737130ce6f fate/image: Fix requirements of tests
Also reduce the amount of repetitions a bit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
1171eab137 tests/Makefile: Make DEMDEC etc. auxiliary functions more flexible
Add a parameter that allows to add additional requirements.
Also add FILE_PROTOCOL to all the auxiliary functions
that use a demuxer.

Also fix the requirements for the fate-mpegts-probe-(latm|program)
tests. They have misused DEMDEC.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
fedc60d07d fate/lavf-image: Fix requirements of tests
In particular, add the missing dependency on the scale filter
(and therefore on libswscale).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
2b39952b08 fate/mov: Use REMUX and TRANSCODE where appropriate
Also fix the requirements of fate-mov-channel-description:
It needs the pcm_s16le decoder and the mov demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
90103c9afc fate/caf: Use REMUX where appropriate
And drop the FATE_CAF_REMUX variables which only existed
to avoid having to repeat the common FILE_PROTOCOL PIPE_PROTOCOL
FRAMECRC_MUXER stuff.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
b182d5c4f3 fate/amr[nw]b: Use REMUX where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
d57822b57d fate/id3v2: Use REMUX where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
705f1a43ea fate/matroska: Use REMUX and TRANSCODE where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:39:37 +02:00
Andreas Rheinhardt
56a062f53c avcodec/xfacedec: Add AV_CODEC_CAP_DR1
This decoder uses ff_get_buffer() and does nothing weird
(it does not even rely on any alignment of the frame's data/linesize).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:28:18 +02:00
Andreas Rheinhardt
a655b0a506 avcodec/pgxdec: Use unsigned types for unsigned values
Both AV_PIX_FMT_GRAY8 and AV_PIX_FMT_GRAY16 use unsigned values,
not signed ones. The fact that the input might be signed
in some cases in the original format doesn't change this.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:28:14 +02:00
Andreas Rheinhardt
84a80ac15d avcodec/pgxdec: Hoist branch out of loop
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:28:10 +02:00
Andreas Rheinhardt
e4a26a64a8 avcodec/pgxdec: Fix issue with negative linesizes
The PGX decoder accesses the lines via code like
(PIXEL*)frame->data[0] + i*frame->linesize[0]/sizeof(PIXEL)
where PIXEL is a macro parameter. This code has issues with negative
linesizes, because the type of sizeof(PIXEL) is size_t, so
that on common systems i*linesize/sizeof(PIXEL) will
always be an unsigned type that is very large in case linesize is
negative. This happens to work*, but it is undefined behaviour
and e.g. leads to "src/libavcodec/pgxdec.c:114:1: runtime error:
addition of unsigned offset to 0x7efe9c2b7040 overflowed to 0x7efe9c2b6040"
errors from UBSAN.
Fix this by using (PIXEL*)(frame->data[0] + i*frame->linesize[0]).
This is allowed because linesize has to be suitably aligned.

*: Converting a negative int to size_t works by adding SIZE_MAX + 1
to the number, so that the result is off by (SIZE_MAX + 1) /
sizeof(PIXEL). Converting the pointer arithmetic (performed on PIXELs)
back to ordinary pointers is tantamount to multiplying by sizeof(PIXEL),
so that the result is off by SIZE_MAX + 1; but SIZE_MAX + 1 == 0
for the underlying pointers.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:28:03 +02:00
Andreas Rheinhardt
67f7960505 avcodec/pgxdec: Remove pointless checks
These checks were (most likely) added to check for overreads
as the bytestream2_get_* functions return 0 in this case.
Yet this is not necessary anymore as we now have an explicit check
for the size. Should the input contain a real \0, pgx_get_number()
will error out lateron.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:27:57 +02:00
Andreas Rheinhardt
be6cd7dfd1 avcodec/pgxdec: Avoid always-false checks
We have already checked that there is data to be read.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:27:51 +02:00
Andreas Rheinhardt
a7e8b0f360 avcodec/pgxdec: Make better use of size check
Each of the three calls to pgx_get_number() consumes at least two bytes.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:18:04 +02:00
Paul B Mahol
14b74610d7 avfilter/af_anlms: add timeline support 2022-04-27 21:30:43 +02:00
Timo Rothenpieler
4fc806bbe6 lavf/tls_mbedtls: add support for mbedtls version 3
- certs.h is gone. Only contains test data, and was not used at all.
- config.h is renamed. Was seemingly not used, so can be removed.
- MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE is gone, instead
  MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE will be thrown.
- mbedtls_pk_parse_keyfile now needs to be passed a properly seeded
  RNG. Hence, move the call to after RNG seeding.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-04-27 18:43:01 +02:00
Zhao Zhili
43afd8c681 avformat/mov: log the right variable
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-04-27 21:00:17 +08:00
Yubo Xie
7795f045a0 libavformat/rtsp: pkt_size option is not honored in rtsp
Signed-off-by: xyb <xyb@xyb.name>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-04-27 20:47:59 +08:00
Zhao Zhili
d114f064c6 avformat/mov: fix missing extra data updating
The stsc_index is checked and updated for the next sample. If the
next sample needs to update stsd_index and stsc_index, then only
stsc_index is updated, which leads to a missing
AV_PKT_DATA_NEW_EXTRADATA. For example, the sample in the second
chunk needs to update both.

entry[0]
    first_chunk = 1
    samples_per_chunk = 3
    sample_description_index = 1
entry[1]
    first_chunk = 2
    samples_per_chunk = 1
    sample_description_index = 2
entry[2]
    first_chunk = 3
    samples_per_chunk = 8
    sample_description_index = 2

The fix is simple: first check and update stsd_index for current
sample, then check and update stsc_index for the next.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-04-27 20:14:18 +08:00
Thilo Borgmann
79286d3eb6 avfilter/vf_blurdetect: fix uninitialized variables and possible div by zero
Found-by: Coverity
2022-04-27 11:41:41 +02:00
Paul B Mahol
39f22df6cd avfilter/vsrc_testsrc: fix typo for yellow patch 2022-04-26 22:04:30 +02:00
Paul B Mahol
944e60f4ae avfilter/vf_blurdetect: remove set but not used variables 2022-04-26 20:15:26 +02:00
Paul B Mahol
452d611fc7 avfilter/vf_lut3d: allow to control when to upload CLUT for haldclut 2022-04-26 20:07:04 +02:00
Thilo Borgmann
1da3394adb avfilter/vf_blurdetect: cleanup headers, remove unused variables, fix type of variable 2022-04-26 12:39:17 +02:00
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
Paul B Mahol
08ac8bda38 avfilter/vf_colormap: avoid reallocating memory to build map 2022-04-26 09:21:56 +02:00
Paul B Mahol
494139bcc7 doc/filters: add colorchart to section 2022-04-26 09:21:56 +02:00
Paul B Mahol
f908f365f9 avfilter/vf_colormap: change default nb_patches 2022-04-26 09:21:55 +02: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
Thilo Borgmann
b23208826b lavfi: Add blurdetect filter 2022-04-25 20:52:15 +02:00
Thilo Borgmann
22df52c444 lafi/vf_edgedetect: Move some common functions into seperate file 2022-04-25 20:52:15 +02:00
Vignesh Venkatasubramanian
f2724d2b69 avformat/mov: Add avif to list of supported extensions
AVIF still and animations are now supported by the MOV parser.
Add the "avif" extension to the list of supported extensions to
AVInputFormat.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-04-25 15:42:11 +05:30
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
Paul B Mahol
fe85afbf8c avfilter/af_afftdn: use better approach for gain smoothing 2022-04-23 23:05:51 +02:00
Jan Ekström
eae3b84189 libavfilter/version: bump minor version for icc{gen,detect}
Missed during that patch set's life time.
2022-04-23 23:07:26 +03:00
Leo Izen
58039129e5 avformat/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
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
Niklas Haas
2cb0cebd11 lavfi: add vf_iccdetect for parsing ICC profiles
This filter is designed to parse embedded ICC profiles and attempt
extracting colorspace tags from them, updating the AVFrame metadata
accordingly.

This is intentionally made a separate filter, rather than being part of
libavcodec itself, so that it's an opt-in behavior for the time being.
This also gives the user more flexibility to e.g. first attach an ICC
profile and then also set the colorspace tags from it.

This makes #9673 possible, though not automatic.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas
5cfeaeef0c lavfi: add vf_iccgen for generating ICC profiles
This filter is designed to specifically cover the task of generating ICC
profiles (and attaching them to output frames) on demand. Other tasks,
such as ICC profile loading/stripping, or ICC profile application, are
better left to separate filters (or included into e.g. vf_setparams).

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas
b9a25963f7 lavfi: add ICC profile support via lcms2
This introduces an optional dependency on lcms2 into FFmpeg. lcms2 is a
widely used library for ICC profile handling, which apart from being
used in almost all major image processing programs and video players,
has also been deployed in browsers. As such, it's both widely available
and well-tested.

Add a few helpers to cover our major use cases. This commit merely
introduces the helpers (and configure check), even though nothing uses
them yet.

It's worth pointing out that the reason the cmsToneCurves for each
AVCOL_TRC are cached inside the context, is because constructing a
cmsToneCurve requires evaluating the curve at 4096 (by default) grid
points and constructing a LUT. So, we ideally only want to do this once
per curve. This matters for e.g. ff_icc_profile_detect_transfer, which
essentially compares a profile against all of these generated LUTs.
Re-generating the LUTs for every iteration would be unnecessarily
wasteful.

The same consideration does not apply to e.g. cmsCreate*Profile, which
is a very lightweight operation just involving struct allocation and
setting a few pointers.

The cutoff value of 0.01 was determined by experimentation. The lowest
"false positive" delta I saw in practice was 0.13, and the largest
"false negative" delta was 0.0008. So a value of 0.01 sits comfortaby
almost exactly in the middle.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas
072dd047f0 lavfi: add ff_detect_color_primaries helper
Related to #9673, this helper exists to facilitate "guessing" the right
primary tags from a given set of raw primary coefficients.

The cutoff value of 0.001 was chosen by experimentation. The smallest
"false positive" delta observed in practice was 0.023329, while the
largest "false negative" delta was 0.00016. So, a value of 0.001 sits
comfortably in the middle.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00