Commit Graph

6076 Commits

Author SHA1 Message Date
Jan Ekström e06ce6d2b4 {avcodec,tests}: rename the bundled Mesa AV1 vulkan video headers
This together with adjusting the inclusion define allows for the
build to not fail with latest Vulkan-Headers that contain the
stabilized Vulkan AV1 decoding definitions.

Compilation fails currently as the AV1 header is getting included
via hwcontext_vulkan.h -> <vulkan/vulkan.h> -> vulkan_core.h, which
finally includes vk_video/vulkan_video_codec_av1std.h and the decode
header, leading to the bundled header to never defining anything
due to the inclusion define being the same.

This fix is imperfect, as it leads to additional re-definition
warnings for things such as
VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION. , but it is
not clear how to otherwise have the bundled version trump the
actually standardized one for a short-term compilation fix.
2024-02-18 13:16:37 +02:00
Marton Balint 65c9c52a5a avutil/tests/channel_layout: add tests for av_channel_order_retype
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-02-18 10:54:22 +01:00
sunyuechi d133e52790 checkasm/rv34dsp: add rv34_idct_dc_add test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-17 14:33:35 +02:00
sunyuechi 6728edadde checkasm/rv34dsp: add rv34_inv_transform_dc test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-17 14:33:35 +02:00
Niklas Haas 2303bf3232 avfilter/buffersrc: promote unspecified color metadata
Currently, this only affects untagged RGB/XYZ/Gray, which get forced to
their corresponding metadata before entering the filter graph. The main
justification for this change, however, is the planned ability to add
automatic promotion of unspecified yuv to mpeg range yuv.

Notably, this change will never allow accidentally cross-promoting
unspecified to jpeg or to a specific YUV matrix, since that is still
bound by the constraints of YUV range negotiation as set up by
query_formats.
2024-02-13 19:30:14 +01:00
Andreas Rheinhardt 99d33cc661 fate/subtitles: Ignore line endings for sub-scc test
Since 7bf1b9b357,
the test produces ordinary \n, yet this is not what the reference
file used for the most time, leading to test failures.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-13 18:26:48 +01:00
rcombs 7bf1b9b357 lavf/assenc: normalize line endings to \n
Previously, we produced output with either \r\n or mixed line endings.
This was undesirable unto itself, but also made working with patches affecting
FATE output particularly challenging, especially via the mailing list.

Everything that consumes the SSA/ASS format is line-ending-agnostic,
so \n is selected to simplify git/ML usage in FATE.

Extra \r characters at the end of a packet are dropped. These are always
ignored by the renderer anyway.
2024-02-11 17:01:07 -08:00
Andreas Rheinhardt 5e2b0862eb tests/fate-run: Sanitize test argument
test -z is a binary operator.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-10 08:05:57 +01:00
Connor Worley d5aaed9d4c lavc/dxv: align to 4x4 blocks instead of 16x16
The previous assumption that DXV needs to be aligned to 16x16 was
erroneous. 4x4 works just as well, and FATE decoder tests pass for all
texture formats.

On the encoder side, we should reject input that isn't 4x4 aligned,
like the HAP encoder does, and stop aligning to 16x16. This both solves
the uninitialized reads causing current FATE tests to fail and produces
smaller encoded outputs.

With regard to correctness, I've checked the decoding path by encoding a
real-world sample with git master, and decoding it with
  ffmpeg -i dxt1-master.mov -c:v rawvideo -f framecrc -
The results are exactly the same between master and this patch.

On the encoding side, I've encoded a real-world sample with both master
and this patch, and decoded both versions with
  ffmpeg -i dxt1-{master,patch}.mov -c:v rawvideo -f framecrc -
Under this patch, results for both inputs are exactly the same.

In other words, the extra padding gained by 16x16 alignment over 4x4
alignment has no impact on decoded video.

Signed-off-by: Connor Worley <connorbworley@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-02-09 23:47:14 +02:00
Connor Worley 395469c1b0 fate/video: add DXV3 HQ tests
Signed-off-by: Connor Worley <connorbworley@gmail.com>
2024-02-08 20:37:27 +01:00
Connor Worley 5fbb6fc636 fate/video: add DXV3 DXT1 encoding test
Signed-off-by: Connor Worley <connorbworley@gmail.com>
2024-02-08 20:37:27 +01:00
Connor Worley c4e9556cf5 lavc/texturedsp: fix premult2straight inversion
This function should convert premultiplied alpha to straight, but does the opposite.

Signed-off-by: Connor Worley <connorbworley@gmail.com>
2024-02-08 20:36:04 +01:00
Niklas Haas ce81237d63 avfilter: pass link YUV colorspace to ff_draw_init2
This makes all ff_draw_* based filters aware of YUV colorspaces and
ranges. Needed for YUVJ removal. Also fixes a bug where e.g. vf_pad
would generate a limited range background even after conversion to
full-scale grayscale.

The FATE changes were a consequence of the aforementioned bugfix - the
gray scale files are output as full range (due to conversion by
libswscale, which hard-codes gray = full), and appropriately tagged as
such, but before this change the padded version incorrectly used
a limited range (16) black background for these formats.
2024-02-06 11:30:10 +01:00
Anton Khirnov f80d91c051 tests/fate/ffmpeg: add a test for the issue fixed in previous commit 2024-02-05 11:55:12 +01:00
Cosmin Stejerean 976cf2343d tests/fate/mov: add a test for reading and writing amve box 2024-02-04 14:03:45 -03:00
James Almer 692e32a7dc fate/checkasm: enable testing vvc_mc
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-01 10:07:26 -03:00
Wu Jianhua 4720cf56ca tests/checkasm/vvc_mc: add check_avg
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-02-01 19:54:29 +08:00
Wu Jianhua fb26c7bfd4 tests/checkasm: add checkasm_check_vvc_mc
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-02-01 19:54:29 +08:00
Anton Khirnov e0da916b8f fftools/ffmpeg: optimize inter-thread queue sizes
Use 8 packets/frames by default rather than 1, which seems to provide
better throughput.

Allow -thread_queue_size to set the muxer queue size manually again.
2024-01-28 13:34:56 +01:00
Anton Khirnov bab7f91c36 tests/fate/ffmpeg: add a test for the issue fixed in previous commit 2024-01-27 09:24:29 +01:00
James Almer 00b288da73 fate/matroska: add missing speex decoder dependency to fate-matroska-ms-mode
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-24 20:55:54 -03:00
Michael Niedermayer d6c62b4bce
tests/checkasm/aacencdsp: Use float_near_ulp_array() for abs_pow34() test
Fixes: ticket/10818
Approved-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-01-24 00:42:13 +01:00
James Almer 67b5012cb1 fate: remove unused filtergraph files
They were added by mistake.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-23 13:49:41 -03:00
James Almer e8759580b1 fate/iamf: add an ambisonic test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-23 13:35:28 -03:00
James Almer 2d712314ec fate: add VVC decoder tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-23 11:15:25 -03:00
James Almer ab39cc36c7 avcodec/speexdec: fix setting frame_size from extradata
Finishes fixing vp5/potter512-400-partial.avi

The fate-matroska-ms-mode test ref is updated to reflect that the Speex decoder
can now read the stream.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-22 10:58:12 -03:00
James Almer 0f4a72b22b fate: add raw IAMF tests
Covers muxing from raw pcm audio input into FLAC, using several scalable layouts,
and demuxing the result.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-22 10:58:12 -03:00
Anton Khirnov a8bc79c3fd fftools/ffmpeg: deprecate -filter_script
It is equivalent to -/filter.
2024-01-20 10:23:24 +01:00
Anton Khirnov c316c4c77b fftools/ffmpeg: deprecate -filter_complex_script
It is equivalent to -/filter_complex.
2024-01-20 10:23:24 +01:00
Anton Khirnov ae06111d74 fftools/ffmpeg_demux: implement -bsf for input
Previously bitstream filters could only be applied right before muxing,
this allows to apply them right after demuxing.
2024-01-19 17:54:10 +01:00
Michael Niedermayer 278fea3664
avutil/eval: Use even better PRNG
This is the 64bit version of Chris Doty-Humphreys SFC64

Compared to the LCGs these produce much better quality numbers.
Compared to LFGs this needs less state. (our LFG has 224 byte
state for its 32bit version) this has 32byte state
Also the initialization for our LFG is slower.
This is also much faster than KISS or PCG.

This commit replaces the broken LCG used before.
(broken as it had only a period ~200M due to being put in a double)

This changes the output from random() which is why libswresample.mak
is updated, update was done using the command in libswresample.mak

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-01-16 01:34:57 +01:00
Martin Storsjö ac40c3bb07 checkasm: Test whether the native FFmpeg timers work
On some platforms (in particular, ARM/AArch64), the implementation
of AV_READ_TIME() may use a privileged instruction - in such
cases, benchmarking just fails with a SIGILL.

Instead of crashing, try executing AV_READ_TIME() once within
a region with the signal handler active, to allow gracefully
informing the user about the issue.

This matches the dav1d checkasm commit
95a192549a448b70d9542e840c4e34b60d09b093.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-01-15 23:29:12 +02:00
James Almer 6f02dcc091 fate/mov: add dependencies to heif tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-15 15:10:15 -03:00
James Almer de01ea4caf fate/subtitles: add missing ref for fate-sub-rcwt
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-15 15:10:15 -03:00
James Almer d9fed9df2a avformat/mov: improve HEIF parsing
Parse iprp and iinf boxes and its child boxes to get the actual codec used
(AV1 for avif, HEVC for heic), and properly export extradata and other
properties in a generic way.
The avif tests reference files are updated as the extradata is now exported.

Based on a patch by Swaraj Hota

Co-authored-by: Swaraj Hota <swarajhota353@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-15 15:10:15 -03:00
sunyuechi 202a35ecdb checkasm/svqenc: add ssd_int8_vs_int16 test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-01-15 19:03:03 +02:00
Marth64 3525544e48 libavformat: add RCWT closed caption muxex
Signed-off-by: Marth64 <marth64@proxyid.net>

Raw Captions With Time (RCWT) is a format native to ccextractor, a commonly
used open source tool for processing 608/708 closed caption (CC) sources.
It can be used to archive the original, raw CC bitstream and to produce
a source file file for later CC processing or conversion. As a result,
it also allows for interopability with ccextractor for processing CC data
extracted via ffmpeg. The format is simple to parse and can be used
to retain all lines and variants of CC.

A free specification of RCWT can be found here:
https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT
This muxer implements the specification as of 01/05/2024, which has
been stable and unchanged for 10 years as of this writing.

This muxer will have some nuances from the way that ccextractor muxes RCWT.
No compatibility issues when processing the output with ccextractor
have been observed as a result of this so far, but mileage may vary
and outputs will not be a bit-exact match.

Specifically, the differences are:
(1)  This muxer will identify as "FF" as the writing program identifier, so
as to be honest about the output's origin.

(2)  ffmpeg's MPEG-1/2, H264, HEVC, etc. decoders extract closed captioning
data differently than ccextractor from embedded SEI/user data.
For example, DVD captioning bytes will be translated to ATSC A53 format.
This allows ffmpeg to handle 608/708 in a consistant way downstream.
This is a lossless conversion and the meaningful data is retained.

(3)  This muxer will not alter the extracted data except to remove invalid
packets in between valid CC blocks. On the other hand, ccextractor
will by default remove mid-stream padding, and add padding at the end
of the stream (in order to convey the end time of the source video).
2024-01-14 14:49:12 +01:00
Martin Storsjö 65739691b9 checkasm: Generalize crash handling
This replaces the riscv specific handling from
7212466e73 (which essentially is
reverted), with a different implementation of the same (plus a bit
more), based on the corresponding feature in dav1d's checkasm,
supporting both Unix and Windows.

See in particular the dav1d commits
0b6ee30eab2400e4f85b735ad29a68a842c34e21,
0421f787ea592fd2cc74c887f20b8dc31393788b,
8501a4b20135f93a4c3b426468e2240e872949c5 and
d23e87f7aee26ddcf5f7a2e185112031477599a7, authored by Henrik Gramner.

The overall approach compared to the existing implementation for
riscv is the same; set up a signal handler, store the state with
sigsetjmp, jump out of the crashing function with siglongjmp.

The main difference is in what happens when the signal handler
is invoked. In the previous implementation, it would resume from
right before calling the crashing function, and then skip that call
based on the setjmp return value.

In the imported implementation from dav1d, we return to right before
the check_func() call, which will skip testing the current function
(as the pointer is the same as it was before).

Other differences are:
- Support for other signal handling mechanisms (Windows
  AddVectoredExceptionHandler)
- Using RtlCaptureContext/RtlRestoreContext instead of setjmp/longjmp
  on Windows with SEH
- Only catching signals once per function - if more than one
  signal is delivered before signal handling is reenabled, any
  signal is handled as it would without our handler
- Not using an arch specific signal handler written in assembly

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-01-11 14:48:53 +02:00
Clément Bœsch af509f9957 avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
The layout for the frame flags is as follow:

   chroma_format  u(2)
   reserved       u(2)
   interlace_mode u(2)
   reserved       u(2)

chroma_format has 2 allowed values:
   0: reserved
   1: reserved
   2: 4:2:2
   3: 4:4:4

interlace_mode has 3 allowed values:
   0: progressive
   1: tff
   2: bff
   3: reserved

0x80 is what we expect for "422 not interlaced", and the extra 0x2 from
0x82 is actually writing into the reserved bits.
2024-01-10 23:33:02 +01:00
Clément Bœsch 21f7a814ea avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits.

alpha_channel_type currently has 3 differents defined values: 0 (no
alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are
reserved. The 4 initial reserved bits are expected to be 0.
2024-01-10 23:33:02 +01:00
Clément Bœsch 6d35911667 avcodec/proresenc_kostya: do not write into alpha reserved bitfields
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits.

alpha_channel_type currently has 3 differents defined values: 0 (no
alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are
reserved. This part is correctly written (alpha_bits>>3 does the correct
thing), but the 4 initial bits are reserved.
2024-01-10 23:33:02 +01:00
Clément Bœsch 85cb1b9b20 avcodec/proresenc_anatoliy: use a compatible bitstream version
Quoting SMPTE RDD 36:2015:
  A decoder shall abort if it encounters a bitstream with an unsupported
  bitstream_version value. If 0, the value of the chroma_format syntax
  element shall be 2 (4:2:2 sampling) and the value of the
  alpha_channel_type element shall be 0 (no encoded alpha); if 1, any
  permissible value may be used for those syntax elements.

So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
2024-01-10 23:33:02 +01:00
James Almer 6d2f64534d fate/mov: force the native av1 decoder for the avif tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-09 20:45:01 -03:00
Vignesh Venkatasubramanian via ffmpeg-devel a0821345eb avformat/mov: Add support for demuxing still HEIC images
They are similar to AVIF images (both use the HEIF container).
The only additional work needed is to parse the hvcC box and put
it in the extradata.

With this patch applied, ffmpeg (when built with an HEVC decoder)
is able to decode the files in
https://github.com/nokiatech/heif/tree/gh-pages/content/images

Also add a couple of fate tests with samples from
https://github.com/nokiatech/heif_conformance/tree/master/conformance_files

Partially fixes trac ticket #6521.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-09 16:44:14 -03:00
James Almer bb819a4ef8 fate/mov: enable the AVIF tests
The samples were uploaded long ago, but this was forgotten.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-09 09:33:57 -03:00
Thilo Borgmann cb6b165b16 fate: Add fsync filter tests 2024-01-05 09:29:05 +01:00
Zhao Zhili 0f824d792d avcodec/hevc_parser: fix missing zero_byte at frame beginning
The start code is matched against 0x000001, zero_byte was treated
as last byte of last frame rather than the beginning of next frame.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-01-05 01:14:33 +08:00
Niklas Haas 8c7934f73a avfilter: add negotiation API for color space/range
Motivated by YUVJ removal. This change will allow full negotiation
between color ranges and matrices as needed. By default, all ranges and
matrices are marked as supported.

Because grayscale formats are currently handled very inconsistently (and
in particular, assumed as forced full-range by swscale), we exclude them
from negotiation altogether for the time being, to get this API merged.

After filter negotiation is available, we can relax the
grayscale-is-forced-jpeg restriction again, when it will be more
feasible to do so without breaking a million test cases.

Note that this commit updates one FATE test as a consequence of the
sanity fallback for non-YUV formats. In particular, the test case now
writes rgb24(pc, gbr/unspecified/unspecified) to the matroska file,
instead of rgb24(unspecified/unspecified/unspecified) as before.
2023-12-31 13:35:03 -08:00
James Almer f7f4ff1b86 tests/dca: remove usage of deprecated request_channel_layout option
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-28 15:31:50 -03:00
James Almer 0b1552ef55 tests/truehd: remove usage of deprecated request_channel_layout option
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-28 15:31:36 -03:00
Gyan Doshi c1340f3439 avformat/riffenc: don't force WAVEFORMATEXTENSIBLE for flt/dbl LPCM
2c2a167ca7 forced WAVEFORMATEXTENSIBLE for all LPCM streams with greater
than 16 bits per sample. However, WAVEFORMATEX allows IEEE Float samples
or any depth where raw depth == coded depth, see Remarks section at
https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatex
and samples M1F1-float32-AFsp, M1F1-float64-AFsp at
https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html

There are hardware devices and likely software players requiring float samples
that fail to qualify files with WAVEFORMATEXTENSIBLE headers.
2023-12-28 11:11:33 +05:30
James Almer 46775e64f8 avcodec/takdsp: fix const correctness
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-22 09:28:04 -03:00
James Almer c5029bb193 checkasm/takdsp: add decorrelate_sf test
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-22 09:26:38 -03:00
Martin Storsjö 935837c3d3 checkasm: Fix the takdsp tests
For memcpy and memcmp, we need to multiply by the element size,
otherwise we're copying and comparing only a fraction of the buffer.

For decorrelate_sr, the buffer p1 is the one that is mutated;
copy and check p1 instead of p2.

For decorrelate_sm, both buffers are mutated, so copy and check
both of them.

For decorrelate_sm, the memcpy initialization of p1 and p1_2 was
reversed - p1 is filled with randomize, but then memcpy copies from
p1_2 to p1. As p1_2 is uninitialized at this point, clang concluded
that the copy was bogus and omitted it entirely, triggering failures
in this test on x86 (where there was an existing assembly implementation
to test).

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-22 14:20:31 +02:00
Vittorio Giovara 05bfc03752 Add new vf_tiltandshift filter
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2023-12-21 17:16:16 -05:00
sunyuechi 21e2b6b501 checkasm/takdsp: add decorrelate_sm test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
sunyuechi c064823b95 checkasm/takdsp: add decorrelate_sr test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
sunyuechi 3bdb0fe511 checkasm/takdsp: add decorrelate_ls test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
Martin Storsjö f5e3e9e04e checkasm: Remove unnecessary const on scalar parameters
The ffmpeg coding style doesn't usually use const on scalar
parameters (or on the pointer values - as opposed to the type
that is pointed to, where it has a semantic meaning), contrary
to the dav1d coding style (where this was imported from).

This avoids warnings about differences in the type signatures
between declaration and definition of this function, with older
versions of MSVC.

The issue was observed with one version of MSVC 2017,
19.16.27024.1, with warnings like these:

    src/tests/checkasm/checkasm.c(969): warning C4028: formal parameter 3 different from declaration

The warning itself is bogus as the const here is harmless, and
newer versions of MSVC no longer warn about this.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-21 00:14:41 +02:00
Martin Storsjö 76cd71bf0c fate: Allow running multiple rounds of tests with differing settings
This can be used to run tests multple times, with e.g. differing
QEMU settings, by adding something like this to the FATE configuration
file:

    target_exec="qemu-aarch64-static"
    fate_targets="fate-checkasm fate-cpu"

    fate_environments="sve128 sve256 sve512"
    sve128_env="QEMU_CPU=max,sve128=on"
    sve256_env="QEMU_CPU=max,sve256=on"
    sve512_env="QEMU_CPU=max,sve512=on"

It's also possible to customize the target_exec command further
by injecting a sufficiently quoted variable into it, which then can
be updated for each run, e.g. target_exec="\$(CUR_EXEC_CMD)".

For each of the environment names in fate_environments, the tests
that are run get the name suffixed on the fate tests in the
test log and fate report, e.g. "fate-checkasm-h264dsp_sve128".

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-19 13:34:25 +02:00
Martin Storsjö d0e215fffc fate: Allow overriding what targets to make for running the tests
This can be useful if doing testing of uncommon CPU extensions by
running tests with QEMU (by configuring with e.g.
"target_exec=qemu-aarch64"), by only running the checkasm tests,
to get a reasonable test coverage without excessive test runtime.

For such a config, setting fate_targets="fate-checkasm fate-cpu"
can be a good tradeoff.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-19 13:34:23 +02:00
Gyan Doshi be8a4f80b9 swr/swresample: avoid reapplication of firstpts
During a resampling operation where

1) user has specified first_pts
2) SWR_FLAG_RESAMPLE is not set initially (directly or otherwise)
3) first_pts has been fulfilled (always using hard compensation)

then upon first encountering a delay where a soft compensation is
required, swr_set_compensation will lead to another init of swr which
will reset outpts to the specified firstpts thus leading to an output
frame having its pts = firstpts. When the next input frame is received,
swr will see a large delay and inject silence from firstpts to the
current frame's pts. This can lead to severe desync and in worst case,
loss of audio playback.

Parameter firstpts initialized to AV_NOPTS_VALUE in swr_alloc and then
checked in swr_init to avoid resetting outpts, thus avoiding reapplication
of firstpts.

Fixes #4131.
2023-12-18 15:47:04 +05:30
Leo Izen 1a04959532
fate/jpegxl: add multiframe permuted TOC image parser test
This test verifies the parser's handling of multiframe JXL files that
have an entropy-encoded permuted table of contents for each frame. The
testcase is actually six JXL codestreams concatenated together, and the
parser needs to be able to find the boundaries.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-12-15 11:52:43 -05:00
Paul B Mahol bc45a9c6de
tests/fate: add pixelize filter tests
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-14 23:34:46 +01:00
Paul B Mahol 41ee95dc52
tests/fate: add median filter test
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-14 23:34:46 +01:00
Marton Balint 74a269c3ce avutil/imgutils: add support for 32bit pixel format for av_image_fill_black()
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-12-13 18:51:32 +01:00
Marton Balint 32cb4504f3 avutil/imgutils: fix av_image_fill_black() for some pixel formats
- Fixes YA formats, because previous code always assumed alpha as the 4th
  component.
- Fixes PAL format (as long as 0 is black, as in a systematic palette), because
  previous code assumed it as limited Y.
- Fixes XYZ format because it does not need nonzero chroma components
- Fixes xv30be as the bitstream mode got merged to the non-bitstream mode.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-12-13 18:51:32 +01:00
Marton Balint 1f721beeff avutil/tests/imgutils: add tests for av_image_fill_black()
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-12-13 18:51:32 +01:00
Anton Khirnov d119ae2fd8 fftools/ffmpeg: convert to a threaded architecture
Change the main loop and every component (demuxers, decoders, filters,
encoders, muxers) to use the previously added transcode scheduler. Every
instance of every such component was already running in a separate
thread, but now they can actually run in parallel.

Changes the results of ffmpeg-fix_sub_duration_heartbeat - tested by
JEEB to be more correct and deterministic.
2023-12-12 08:24:18 +01:00
Anton Khirnov 4b8a171beb fftools/ffmpeg_filter: make sub2video heartbeat more robust
Avoid making decisions based on current graph input state, which makes
the output dependent on the order in which the frames from different
inputs are interleaved.

Makes the output of fate-filter-overlay-dvdsub-2397 more correct - the
subtitle appears two frames later, which is closer to its PTS as stored
in the file.
2023-12-12 08:24:18 +01:00
sunyuechi 1c3620b2bb checkasm: test for abs_pow34
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-11 18:42:07 +02:00
Rémi Denis-Courmont b3825bbe45 riscv: test for assembler support
This should fix the build on LLVM 16 and earlier, at the cost of turning
all non-RVV optimisations off.
2023-12-08 17:21:09 +02:00
Paul B Mahol 3047f05a99 tests/fate: add asegment filter tests 2023-12-05 14:50:40 +01:00
Leo Izen b60d39fbe2
fate/jpegxl: add parser test for extboxes and small files
Add a fate test for the above commits fixing extremely small files or
files with extended box sizes.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-12-05 05:54:58 -05:00
Cosmin Stejerean 634216dc40 fate: Add tests for QOA decoder 2023-12-04 23:14:38 +01:00
Martin Storsjö 12598e72e3 checkasm: Fix the signature of float_to_fixed24
The len parameter was changed from unsigned int to size_t in
567c67c6c8.

This fixes crashes in the reference C code, when running checkasm
on aarch64.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-02 18:16:09 +02:00
sunyuechi d0ec826077 checkasm/ac3dsp: add float_to_fixed24 test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-01 20:26:48 +02:00
sunyuechi ea6817d2a7 checkasm: test for dcmul_add
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-11-27 17:55:24 +02:00
Rémi Denis-Courmont 7212466e73 checkasm/riscv: report an error upon SIGILL
Terminating the whole checkasm process is not very helpful. This will
report if an illegal instruction occurs while executing a tested
function. This is a common occurrence whilst developping RISC-V
assembler, due to the compatibility between vector configuration and
instruction done at run-time.
2023-11-23 19:04:07 +02:00
Rémi Denis-Courmont 286d674221 checkasm: add helper to report a fatal signal 2023-11-23 18:57:18 +02:00
James Almer 707e46dc54 test/checkasm: test llauddsp
Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-22 14:22:19 -03:00
Zhao Zhili 641f8a71fb fate/h264: move mp4toannexb_ticket5927 test to fate-h264
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-11-22 19:42:15 +08:00
Zhao Zhili aa3b857101 avcodec/h264_mp4toannexb_bsf: process new extradata
For fate-h264_mp4toannexb_ticket5927 and
fate-h264_mp4toannexb_ticket5927_2, they work by accident
previously. The sample file has two 'avc1' entries, and video
samples use the second one. It means packets should be decoded with
new extradata in side data. Before this patch, only extradata was
kept in the output, new extradata has been dropped. The output can
be decoded because the two extradata are almost the same, except
level indication. This patch fixed the issue, and add another
fate test.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-11-22 19:42:14 +08:00
Zhao Zhili d3aa0cd16f avcodec/h264_mp4toannexb_bsf: fix missing PS before IDR frames
If there is a single group of SPS/PPS before an IDR frame, but no
SPS/PPS after that, we will miss the chance to reset
idr_sps_seen/idr_pps_seen. No SPS/PPS are inserted afterwards.

This patch saves in-band SPS/PPS and insert them before IDR frames
when necessary.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-11-22 19:42:14 +08:00
Rémi Denis-Courmont 8a984aca59 checkasm/flacdsp: add LPC test 2023-11-18 22:01:59 +02:00
Rémi Denis-Courmont be1675035f checkasm/flacdsp: fix ls/rs/ms tests
decorrelate_ls, _rs and _ms are decorrelate[1], [2] and [3] respectively.
The code ended up testing indep ([0]) as twice, ms never, and misnaming
the other two.
2023-11-17 23:59:22 +02:00
Rémi Denis-Courmont 6720a509a7 checkasm: add lossless audio DSP 2023-11-16 16:53:44 +02:00
Rémi Denis-Courmont 6b708cd783 checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32 2023-11-15 16:51:07 +02:00
Anton Khirnov 889a022cce fftools/ffmpeg: rework keeping track of file duration for -stream_loop
Current code tracks min/max pts for each stream separately; then when
the file ends it combines them with last frame's duration to compute the
total duration of each stream; finally it selects the longest of those
durations as the file duration.

This is incorrect - the total file duration is the largest timestamp
difference between any frames, regardless of the stream.

Also change the way the last frame information is reported from decoders
to the muxer - previously it would be just the last frame's duration,
now the end timestamp is sent, which is simpler.

Changes the result of the fate-ffmpeg-streamloop-transcode-av test,
where the timestamps are shifted slightly forward. Note that the
matroska demuxer does not return the first audio packet after seeking
(due to buggy interaction betwen the generic code and the demuxer), so
there is a gap in audio.
2023-11-14 18:18:26 +01:00
Anton Khirnov a8d9d6b08d tests/fate: replace deprecated -vsync with -fps_mode 2023-11-14 18:18:26 +01:00
Anton Khirnov 23de85d1ec tests/fate/ffmpeg: replace deprecated -vbsf with -bsf:v 2023-11-14 18:18:26 +01:00
Rémi Denis-Courmont 20e6195c54 checkasm: test the noise case of sbrdsp.hf_apply_noise
The tested functions treat s_m[i] == 0 as a special case. Other than
that, the functions are slightly complicated vector additions.

This actually makes the zero case happen pseudorandomly.
2023-11-13 18:34:29 +02:00
Rémi Denis-Courmont 427347309b checkasm: test with random bw value
With a value of zero, the function is a glorified memory copy.
2023-11-12 22:33:11 +02:00
Niklas Haas 96d2a40b9e avcodec/pnm: explicitly tag color range
PGMYUV seems to be always limited range. This was a format originally
invented by FFmpeg at a time when YUVJ distinguished limited from full
range YUV, and this codec never appeared to output YUVJ in any
circumstance, so hard-coding limited range preserves the status quo.

The other formats are explicitly documented to be full range RGB/gray
formats. That said, don't tag them yet, due to outstanding bugs w.r.t
grayscale formats and color range handling.

This change in behavior updates a bunch of FATE tests in trivial ways
(added tagging being the only difference).
2023-11-09 12:53:35 +01:00
Marvin Scholz e900a559c2 fate: enhance tpad filter test
Adds another test that uses the start_duration and stop_duration
options instead of start and stop.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-11-09 11:11:00 +01:00
James Almer 04e53927ad avutil/channel_layout: add a 9.1.4 channel layout
Mapping to ITU-R BS.2051-3 "Sound System G" and ITU-R BS.1196-8 "Channel
Configuration 20".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-08 10:09:46 -03:00
James Almer b4169760b0 avutil/channel_layout: add a 7.2.3 channel layout
Mapping to ITU-R BS.2051-3 "Sound System F" and ITU-R BS.1196-8 "Channel
Configuration 15".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-08 10:09:46 -03:00
Anton Khirnov ad3df6bf35 lavf/smacker: export sample_aspect_ratio
Partially fixes #10617
2023-11-05 11:30:13 +01:00
Niklas Haas 96dfc4481b avfilter/drawutils: ban XYZ formats
These are not supported by the drawing functions at all, and were
incorrectly advertised as supported in the past.

Note: This check is added only to separate the logic change from the API
change in the following commit, and will be removed again after it
becomes redundant.
2023-10-31 15:43:30 +01:00
James Almer 35b06853d1 avutil/channel_layout: add a 3.1.2 channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
Will Wolcott e9397ae054 avutil/channel_layout: add a 7.1.4 channel layout
Mapping to ITU-R BS.2051-3 "Sound System J" and ITU-R BS.1196-8 "Channel
Configuration 19".

Signed-off-by: Will Wolcott <wwolcott@netflix.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer a41c4b923d avutil/channel_layout: add a 7.1.2 channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer 8d46cbce4f avutil/channel_layout: add a 5.1.4 channel layout
Mapping to ITU-R BS.2051-3 "Sound System D" and ITU-R BS.1196-8 "Channel
Configuration 16".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer 4b8404815d avutil/channel_layout: rename 7.1(top) channel layout to 5.1.2
This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
Configuration 14", and it being the first layout with top layer channels, it's
best to use a different scheme to properly convey the presence and amount of said
channels.
The new name will also be a better fit for the additions in the following commits.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer ef01ab2627 ffprobe: print the non-diegetic stream disposition flag
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-25 21:55:01 -03:00
Stefano Sabatini 2b0973dedb ffprobe: fix XML rendering, review XML layout
Fix rendering of int values within a side data element, which was
broken since commit d2d3a83ad9, where the side data element was
correctly marked as a variable fields element. Logic to render a
string variable was implemented already, but it was not implemented
for the int fields path, which was enabled by that commit.

Also, code and schema is changed in order to account for multiple
variable-fields elements - such as side data, contained within the
same parent. Previously it was assumed that a single variable-fields
element was contained within the parent, which was the case for tags,
but is not the case for side-data.

Previously data was rendered as:
<side_data_list>
    <side_data side_data_type="CPB properties" max_bitrate="0" min_bitrate="0" avg_bitrate="0" buffer_size="327680" vbv_delay="-1"/>
</side_data_list>

Now as:
<side_data_list>
   <side_data type="CPB properties">
       <side_datum key="side_data_type" value="CPB properties"/>
       <side_datum key="max_bitrate" value="0"/>
       <side_datum key="min_bitrate" value="0"/>
       <side_datum key="avg_bitrate" value="0"/>
       <side_datum key="buffer_size" value="49152"/>
       <side_datum key="vbv_delay" value="-1"/>
   </side_data>
</side_data_list>

Variable-fields elements are rendered as a containing element wrapping
generic key/values elements, enabling use of strict XML schema.

Fix trac issue:
https://trac.ffmpeg.org/ticket/10613
2023-10-20 18:42:01 +02:00
Zhao Zhili ade0612cfb fate/screen: workaround test failure on mac M1
The last frame is corrupted. It has different results on different
platform.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-10-18 23:01:51 +08:00
Anton Khirnov d2c416fdf1 fftools/ffmpeg_enc: merge -force_key_frames source/source_no_drop
Always use the functionality of the latter, which makes more sense as it
avoids losing keyframes due to vsync code dropping frames.

Deprecate the 'source_no_drop' value, as it is now redundant.
2023-10-10 12:41:31 +02:00
Anton Khirnov a07b2f5f11 tests/fate/ffmpeg: add tests for -force_key_frames source 2023-10-10 12:41:31 +02:00
James Almer d372c2f3d3 fftools/ffmpeg: stop injecting stream side data in packets
This is no longer needed as the side data is available for decoders in the
AVCodecContext.
The tests affected reflect the removal of useless CPB and Stereo 3D side
data in packets.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:11:19 -03:00
James Almer ae22271620 avcodec/decode: propagate global side data to frames
The changed references for fate-hevc-dv-rpu fate-mov-zombie happen because,
unlike ffmpeg and ffplay, ffprobe never injected packet side data, so the
display matrix side data at the container level is now present in the output
frames.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:11:18 -03:00
Stefano Sabatini d2d3a83ad9 ffprobe: introduce section type, use for the compact output
Also, avoid spurious end-of-line after side data entries, and improve
rendering of compact output, by adding an indication of the side data
type for each entry.

Also fixes issue:
http://trac.ffmpeg.org/ticket/9266
2023-10-06 00:17:02 +02:00
Stefano Sabatini 8eecd52d8b ffprobe: correct section name for side data piece 2023-10-06 00:17:01 +02:00
Anton Khirnov 9d4ca76c08 fftools/ffmpeg_enc: do not round frame durations prematurely
Changes the results of fate-idroq-video-encode and fate-lavf* tests,
where different frames now get duplicated by framerate conversion code.
2023-10-03 16:57:02 +02:00
Anton Khirnov 303f10d4dd fftools/ffmpeg_dec: disregard demuxer timestamps for NOTIMESTAMPS formats
In this case any timestamps are guessed by compute_pkt_fields() in
libavformat. Since we are decoding the stream, we have more accurate
information from the decoder and do not need any guesses.

Eliminates spurious PTS gaps in a number of FATE tests.

Also avoids dropping the majority of frames in fate-dirac*
2023-10-03 16:57:02 +02:00
Anton Khirnov cdfd15f4d8 lavc/mpeg4videodec: do not invent a framerate from guessed numbers
Improves timestamps for fate-m4v*
2023-10-03 16:57:02 +02:00
Andreas Rheinhardt 259e1d2bd7 avformat/matroskaenc: Write default duration for audio
This is easily possible for those codecs with a fixed frame-size
(in samples).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-02 12:22:20 +02:00
Andreas Rheinhardt 0c1103d4dc avformat/matroskaenc: Don't create wrong packet durations
We have to write an explicit BlockDuration element (and use
a BlockGroup instead of a SimpleBlock) in case the Track
has a DefaultDuration that is inconsistent with the duration
of the packet.

The matroska-h264-remux test uses a file with coded fields
where the duration of a Block is the duration of a field,
not of a frame, therefore this patch writes said BlockDuration
elements.

(When using a BlockGroup, one has to add ReferenceBlock elements
to distinguish keyframes from non-keyframes. Unfortunately,
the AV1 codec mapping [1] requires us to reference all references
and to really use the real references, which requires a lot of
effort for basically no gain. When BlockGroups are used with AV1,
the created files are most likely invalid, both before and after
this patch, but this patch makes this more likely to happen.)

[1]: https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec/av1.md

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-02 12:22:05 +02:00
Andreas Rheinhardt 6f7bf64dbc avcodec: Remove DCT, FFT, MDCT and RDFT
They were replaced by TX from libavutil; the tremendous work
to get to this point (both creating TX as well as porting
the users of the components removed in this commit) was
completely performed by Lynne alone.

Removing the subsystems from configure may break some command lines,
because the --disable-fft etc. options are no longer recognized.

Co-authored-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-01 02:25:09 +02:00
Paul B Mahol 3e7e5ec46b fate: add forgotten changes for GBRAP14 2023-09-28 20:07:48 +02:00
Paul B Mahol 29b673bdcf swscale: add GBRAP14 format support 2023-09-28 19:37:58 +02:00
Andreas Rheinhardt 0228e27ded checkasm/motion: Don't allocate AVCodecContext
Instead use one on the stack to avoid pulling in all
of libavcodec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-28 00:17:47 +02:00
Andreas Rheinhardt 80afcc8539 avfilter/bwdif: Add proper BWDIFDSPContext
This already avoids unnecessary indirectly included headers
in the arch-specific vf_bwdif_init.c files; it is also in
preparation for splitting the actual functions out of vf_bwdif.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-28 00:17:47 +02:00
Andreas Rheinhardt 8d5db120c2 tests/fate-run: Ensure that THREADS=random is actually random
From the documentation of GNU awk [1]:
"In most awk implementations, including gawk, rand() starts generating
numbers from the same starting number, or seed, each time you run awk.45
Thus, a program generates the same results each time you run it. The
numbers are random within one awk run but predictable from run to run.
This is convenient for debugging, but if you want a program to do
different things each time it is used, you must change the seed to a
value that is different in each run. To do this, use srand()."

This commit does exactly this.

[1]: https://www.gnu.org/software/gawk/manual/html_node/Numeric-Functions.html#index-rand_0028_0029-function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-25 22:02:24 +02:00
Paul B Mahol 3bef108fa9
libswresample/swresample: avoid s16p internal transfer format
Instead use float one by default for sample rate conversions.
The s16p internal transfer format produces visible and hearable
quantization artifacts.

Signed-off-by: Paul B Mahol <onemda@gmail.com>

for S8 we continue to use S16 as it should have enough precision
Fate is adjusted so bitexactness is maintained between mips/arm/x86
if more tests became bit-inexact on some platform, the same change
can be done to them

The use of higher precision and float intermediates inevitably
leads to more differences between platforms.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-09-25 21:41:35 +02:00
Fei Wang 63371cde9d lavc/av1: Add unit test for level handling
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2023-09-22 13:15:01 +08:00
Anton Khirnov 5d58a35f98 fftools/ffmpeg: deprecate the -top option
It is badly named (should have been -top_field_first, or at least -tff),
underdocumented and underspecified, and (most importantly) entirely
redundant with the setfield filter.
2023-09-18 17:16:06 +02:00
Anton Khirnov 43a0004b5c fftools/ffmpeg_enc: apply -top to individual encoded frames
Fixes #9339.
2023-09-18 17:15:53 +02:00
Andreas Rheinhardt a84fe06112 avcodec/idctdsp: Avoid inclusion of avcodec.h
Not every user of idctdsp.h wants to initialize an IDCTDSPContext;
e.g. the proresdsp only uses ff_init_scantable_permutation()
and the IDCT permutation enum; similarly for cavsdsp and wmv2dsp.
Using a forward declaration here avoids an avcodec.h dependency
in the relevant files.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-11 00:26:34 +02:00
Andreas Rheinhardt a234e5cd80 fate/mpegps: Fix argument order
Regression since fb548fba04.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-08 15:48:21 +02:00
James Almer fb548fba04 avcodec/av1dec: export pixel format even if no hardware decoder is present
And remove the AVOID_PROBING flag, given it's the last av1 decoder to be tested
either way.
This fixes a regression introduced in 1652f2492f,
where even if forcing the native av1 decoder, if another decoder was present,
like libdav1d or libaom-av1, they'd be used for probing and some fate tests
would have different results.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-09-08 09:42:25 -03:00
Paul B Mahol 929eb72876 fate: add forgotten rpza reference test 2023-09-07 22:57:01 +02:00
Paul B Mahol 74375305ef fate: add rpza encoder tests 2023-09-07 20:58:08 +02:00
Andreas Rheinhardt f32a83c4eb fate/matroska: Add test for remuxing non-rotation displaymatrix
This provides coverage for the case in which the displaymatrix
is ignored.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:28:27 +02:00
James Almer 1652f2492f avcodec/av1dec: don't set aspect ratio when it's not yet known
Makes the output of the native decoder consistent with external decoders like
libdav1d with fate-enhanced-flv-av1.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-09-06 14:37:15 -03:00
Paul B Mahol bfa43447fa fate: add OSQ test 2023-09-06 11:59:20 +02:00
Steven Liu 6c2f49e35f fate/enhanced-flv-vp9: add tests reference data 2023-09-05 15:01:34 +08:00
Steven Liu 62fb730762 tests/fate/flvenc: add av1 in enhanced flv test case
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-05 09:12:08 +08:00
Steven Liu 1a86cce51e tests/fate/flvenc: add vp9 in enhanced flv test case
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-05 09:10:46 +08:00
Paul B Mahol 182aef0198 fate: add rka test 2023-09-04 19:29:21 +02:00
Andreas Rheinhardt 091c41794d fate/ffmpeg: Add bitexact flag for ffmpeg-input-r test
Fixes the test when the non-bitexact MMXEXT versions of
the hpeldsp functions are used.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 14:38:56 +02:00
Andreas Rheinhardt f8503b4c33 avutil/internal: Don't auto-include emms.h
Instead include emms.h wherever it is needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Andreas Rheinhardt a39d6e81fa tests/checkasm/sw_scale: Avoid declare_func_emms where possible
This makes the test stricter because it is checked that the
MMX registers are not accidentally clobbered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Andreas Rheinhardt e7866e00c8 tests/checkasm/llvidencdsp: Don't use declare_func_emms
Only sub_media_pred has an MMXEXT version, so one can use
the version with the stricter check (that checks that
the MMX registers have not been clobbered) for sub_left_predict.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Andreas Rheinhardt 3f82b38516 tests/checkasm/hevc_*: Avoid using declare_func_emms where possible
Only the idct_dc and add_residual functions have MMX versions,
so one can use the version with the stricter check (that checks
that the MMX registers have not been clobbered) for all the other
checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Steven Liu 8b7a3c6f10 tests/fate/flvenc: add hevc in enhanced flv test case
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-04 14:02:40 +08:00
Lynne a810126501
wmavoice: convert DCT-I/DST-I to lavu/tx
This is the very last user of any lavc transform code.

This also *corrects* wmavoice decoding, as the previous DCT/DST
transforms were incorrect, bringing it closer to Microsoft's
own wmavoice decoder.
2023-09-01 23:59:11 +02:00
Leo Izen a49d7a1497
fate/jpegxl_anim: add demuxer fate test for jpegxl_anim
Adds a fate test for the jpegxl_anim demuxer, that should allow testing
for true positives and false positives for animated jpegxl files. Note
that two of the test cases are not animated, in order to help sort out
false positives.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-09-01 03:36:02 -04:00
Andreas Rheinhardt 884653ee5b avformat/matroskaenc: Don't add side-data to input stream
When muxing, the AVStreams' side-data is typically set
by the caller before avformat_write_header();
it is not documented to be else. Yet the Matroska muxer
added an AVStereo3D side data if certain metadata
was present:

Since commit 4d686fb721
(adding support for AVStereo3D stream side-data),
the Matroska muxer checked certain stream tags that
contain Matroska's StereoMode and (if they are present)
converted this value into an AVStereo3D struct that
gets attached to the AVStream (reusing a function from
the demuxer). Afterwards the AVStereo3D side data struct
(whether it has just been added by the muxer or not) gets
parsed and converted back into a Matroska StereoMode.

Besides being an API violation this change broke
StereoMode values without a corresponding AVStereo3D
(namely the anaglyph ones).

This commit fixes this: A StereoMode given via tags
is now used-as-is; if no such tag exists and an AVStereo3D
side data exists, it is converted into the corresponding
StereoMode (if possible). This approach also fixes
handling of the anaglyph ones; the changes to the
matroska-stereo_mode are due to this.

The new STEREOMODE_STEREO3D_MAPPING has been put to
good use for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-30 19:31:30 +02:00
Anton Khirnov 411ada649f fftools/ffmpeg_enc: only use fallback framerate when encoding CFR
When no output video framerate is specified by the user with -r or can
be inferred from the filtergraph, encoder setup will arbitrarily decide
that the framerate is 25fps. However, making up any framerate value for
VFR encoding is at best unnecessary.

Changes the results of the sub2video tests, where the input timebase is
now used instead of 1/25.
2023-08-30 11:53:50 +02:00
Michael Niedermayer b5273c619d
tests/fate: Add NoLegacy-cut.ape test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-28 01:10:14 +02:00
Matthias Dressel e41bd6e65e checkasm: hevc_sao: Fix a regression in hevc_sao_edge
check_func() might return NULL, in which case the function is not to be
benched. Introduced in cc679054c7.

Signed-off-by: Matthias Dressel <code@deadcode.eu>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-24 22:09:37 +03:00
Martin Storsjö 95433eb3aa fate/matroska: Stop using unicode in command line paramters
The fate-run.sh shell script exports LC_ALL=C before invoking the
test executables; this is probably done for consistency.

When executing Windows binaries with Wine, it normally handles
UTF-8 command line parameters just fine - but with LC_ALL set to
C, it treats them as plain ASCII.

As the unicode command line parameters wasn't the main thing
being tested here, just convert them to plain ASCII, for
portability. This fixes the test for all test configurations that
use Wine.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-22 22:09:40 +03:00
Andreas Rheinhardt f7715feb5d fate/matroska: Fix requirements of fate-matroska-alac-remux test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-13 16:47:12 +02:00
Andreas Rheinhardt 5d07757c70 fate/matroska: Add test for stereo 3D
Just mark a non-stereo file as stereo to test the code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-13 16:46:54 +02:00
Andreas Rheinhardt d53acf452f avformat/matroskaenc: Don't write \0 unnecessarily
Writing the duration SimpleTag is special: It's size is
reserved in advance via an EBML Void element (if seekable)
and this reserved space is overwritten when writing the trailer;
it does not use put_ebml_string().

The string to write is created via snprintf on a buffer
of size 20; this buffer is then written via put_ebml_binary()
with a size of 20.

EBML strings need not be zero-terminated; if not, they
are implicitly terminated by the element's length field.
snprintf() always zero-terminates the buffer, i.e.
the last byte can be discarded when using an EBML string.
This patch does this.

The FATE changes are as expected: One byte saved for every
track; the only exception is the matroska-qt-mode test:
An additional byte is saved because an additional byte
could be saved from the enclosing Tags length field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 23:56:35 +02:00
Andreas Rheinhardt b5968df9f0 avformat/matroskaenc: Don't reserve space for HDR10+ when unnecessary
Do it only for video (the only thing for type for which HDR10+
makes sense).

This effectively reverts changes to several FATE ref-files
made in bda44f0f39.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 23:56:35 +02:00
Andreas Rheinhardt 11623f36a8 fate/matroska: Add ALAC remux test
Provides coverage for the code transforming the ALAC extradata.
Also set creation_time metadata to test this, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 08:36:47 +02:00
Andreas Rheinhardt c797b6400d avformat/matroskaenc: Support rotations
Matroska supports orthogonal transformations (both pure rotations
as well as reflections) via its 3D-projection elements, namely
ProjectionPoseYaw (for a horizontal reflection) as well as
ProjectionPoseRoll (for rotations). This commit adds support
for this.

Support for this in the demuxer has been added in
937bb6bbc1 and
the sample used in the matroska-dovi-write-config8 FATE-test
includes a displaymatrix indicating a rotation which is now
properly written and read, thereby providing coverage for
the relevant code in the muxer as well as the demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 00:17:11 +02:00
Zhao Zhili 6b82f35041 fate/mov: add remux PCM to mp4 test
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-08-06 16:14:41 +08:00
Martin Storsjö 271c8229f8 tests: Correctly distinguish between SAMPLES and TARGET_SAMPLES for hls_fmp4_ac3.m3u8
This fixes the test when running in a cross test setup where the
samples are located at a different path between build host and
temote test target.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-04 21:51:17 +03:00
Jan Ekström b300552dfb avformat/mov: enable identifying TTML subtitle streams as such
The contents are full TTML XML documents. TTML writing tests'
results are updated as the streams are now properly identified
as TTML ones.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2023-07-28 15:31:56 +03:00
Jan Ekström 43e63ff20a avcodec: move content light level SEI handling to h2645_sei
This allows this common H.274 SEI to be parsed from both H.264
as well as HEVC, as well as probably from VVC in the future.

Generally attempts to keep the original code as similar as possible.

FATE test refererence changes only change the order of side data
export within a single frame. Nothing else seems to have changed.
2023-07-27 21:45:43 +03:00
Jan Ekström 33358b862c avcodec: move mastering display colour volume SEI handling to h2645_sei
This allows this common H.274 SEI to be parsed from both H.264
as well as HEVC, as well as probably from VVC in the future.

Generally attempts to keep the original code as similar as possible.

FATE test refererence changes only change the order of side data
export within a single frame. Nothing else seems to have changed.
2023-07-27 21:45:43 +03:00
Rémi Denis-Courmont f25ad0fe02 checkasm: improve Linux perf error message
Report the failing system call name, as is convention, rather than just
a rather unhelpful "syscall".
2023-07-22 21:35:15 +03:00
Anton Khirnov 45035154be tests/fate: fix mismatches between requested and actually used pixel formats 2023-07-20 20:30:13 +02:00
Tobias Rapp afaa345824 tests/fate: Add test for overlay filter using yuv444p10 output format 2023-07-20 16:49:20 +02:00
Rémi Denis-Courmont b6585eb04c lavu: add/use flag for RISC-V Zba extension
The code was blindly assuming that Zbb or V implied Zba. While the
earlier is practically always true, the later broke some QEMU setups,
as V was introduced earlier than Zba.
2023-07-19 19:29:35 +03:00
Rémi Denis-Courmont 98e4dd39c5 checkasm: test Zbb before V
Without this, Zbb functions get shadowed by V functions on devices
supporting both extensions, and never tested.
2023-07-19 19:29:35 +03:00
Rémi Denis-Courmont d8ea5f50e2 checkasm: print usage on invalid arguments
This checks that arguments are handled. If not, then this prints a
short usage notice and returns an error.
2023-07-17 18:48:42 +03:00
Anton Khirnov dff3a283cd fftools/ffmpeg: rework -enc_time_base handling
Read the timebase from FrameData rather than the input stream. This
should fix #10393 and generally be more reliable.

Replace the use of '-1' to indicate demuxing timebase with the string
'demux'. Also allow to request filter timebase with
'-enc_time_base filter'.
2023-07-15 11:02:11 +02:00
Anton Khirnov 1b45405d44 tests/fate-run: add testing with a random number of threads
Useful for discovering bugs that depend on a specific thread count.

Use like THREADS=randomX for a random thread count from 1 to X, with
X=16 when not specified. Note that the thread count is different for
every test.
2023-07-11 19:19:32 +02:00
Dai, Jianhui J 3b358f151d avformat/ivfenc: Set the "number of frames" in IVF header
Should set "number of frames" to bytes 24-27 of IVF header, not
duration.
It is described by [1], and confirmed by parsing all IVF files in [2].

This commit also updates the md5sum of refs to pass fate-cbs.

[1] Duck IVF - MultimediaWiki
https://wiki.multimedia.cx/index.php/Duck_IVF

[2] webm/vp8-test-vectors
https://chromium.googlesource.com/webm/vp8-test-vectors

Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2023-07-09 16:56:58 -04:00
James Almer 13ef5025e3 fate/cbs: add more VVC tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-07 11:56:37 -03:00
Anton Khirnov 9b625ab679 lavc/dvdec: export bitrate
Changes the result of fate-mxf-probe-dv25, where the bitrate is now
exported.

Also changes the result of fate-bsf-dv-error-marker, where the exported
bitrate is now different. Note that the codec layer bitrate does not
match the container bitrate, because container timing is 25fps, while
the DV profile is 50.
2023-07-07 12:12:52 +02:00
John Cox 697533e76d avfilter/vf_bwdif: Add a filter_line3 method for optimisation
Add an optional filter_line3 to the available optimisations.

filter_line3 is equivalent to filter_line, memcpy, filter_line

filter_line shares quite a number of loads and some calculations in
common with its next iteration and testing shows that using aarch64
neon filter_line3s performance is 30% better than two filter_lines
and a memcpy.

Adds a test for vf_bwdif filter_line3 to checkasm

Rounds job start lines down to a multiple of 4. This means that if
filter_line3 exists then filter_line will not sometimes be called
once at the end of a slice depending on thread count. The final slice
may do up to 3 extra lines but filter_edge is faster than filter_line
so it is unlikely to create any noticable thread load variation.

Signed-off-by: John Cox <jc@kynesim.co.uk>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-07-06 00:21:05 +03:00
John Cox 7ed7c00f55 tests/checkasm: Add test for vf_bwdif filter_edge
Signed-off-by: John Cox <jc@kynesim.co.uk>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-07-06 00:21:05 +03:00
John Cox 7caa8d6b91 tests/checkasm: Add test for vf_bwdif filter_intra
Signed-off-by: John Cox <jc@kynesim.co.uk>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-07-06 00:21:05 +03:00
Tomas Härdin 25a91824af Add SMC vsynth tests 2023-07-02 21:08:59 +02:00
James Almer 8a6d3482de fate/cbs: fix sample path for discard tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-02 12:53:23 -03:00
James Almer ab57b44527 fate/cbs: simplify the filter_unit discard tests
No need to generate intermediate files and probe them. We only care to know that the
output of the bsf excludes the frames in question, and a simple checksum is enough.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-01 19:41:12 -03:00
James Almer e4d4d616ba fate/cbs: run the VVC tests within the fate-cbs target
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-30 13:48:50 -03:00
James Almer 3fd7841ef1 fate/cbs: add VVC tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-30 08:26:38 -03:00
Romain Beauxis bcfcc19821 Add FATE test for timed id3 demux.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-06-29 17:33:01 +02:00
James Almer 10f1bbfe11 avcodec/j2kenc: use uint64_t type for the lambda value
Should fix integer overflows, and improve encoding results.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-24 14:39:04 -03:00
Anton Khirnov 83b3ff741b tests/fate/ffmpeg: silence the audio for fate-ffmpeg-streamloop-transcode-av
Fixed-point AAC decoder currently does not produce the same output on
all platforms. Until that is fixed, silence the audio stream using the
volume filter.

Also, actually use the aac_fixed decoder as was the original intent.
2023-06-21 10:07:41 +02:00
Tomas Härdin 8e53233f68 lavc/msrleenc: Add msrle encoder
Keyframes are marked automagically
2023-06-20 14:37:52 +02:00
James Almer e81eafcb97 avformat/evc: skip nalu header size bytes before parsing sps
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 17:21:19 -03:00
James Almer 4afee83d35 fate/lavf-container: add a test to remux raw evc into mp4
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 12:57:31 -03:00
Anton Khirnov 47a14b542e tests/fate: add a test for -streamloop with transcoding video+audio 2023-06-19 09:48:55 +02:00
Anton Khirnov 90a26e75a4 tests/fate: rename ffmpeg-streamloop to ffmpeg-streamloop-copy
Makes it clear that this tests -streamloop with streamcopy, to
distinguish it from further -streamloop tests added in future commits.
2023-06-19 09:48:55 +02:00
Martin Storsjö a33191ff7a fate/cbs: Fix the ffprobe dependency for Windows targets
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-19 09:25:32 +03:00
Zhao Zhili e349b45fa0 fate/cbs: add tests for discard_units
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-19 11:52:18 +08:00
Martin Storsjö 397cb623c8 aarch64: Add cpu flags for the dotprod and i8mm extensions
Set these available if they are available unconditionally for
the compiler.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:40:42 +03:00
Anton Khirnov ccf219e361 fftools/ffmpeg_enc: avoid breaking exactly integer timestamps in vsync code
The code will currently add a small offset to avoid exact midpoints, but
this can cause inexact results when a float timestamp is exactly
representable as an integer.

Fixes off-by-one in the first frame duration in multiple FATE tests.
2023-06-05 16:15:04 +02:00
Anton Khirnov 09af34dc91 tests/fate/ffmpeg: add tests for -max_error_rate 2023-06-05 16:15:04 +02:00
Lynne 77478f6793
av1dec: add Vulkan hwaccel 2023-05-29 00:42:00 +02:00
Lynne 5dc047716a
fate-source: exclude Apache-2 licensed files 2023-05-29 00:41:59 +02:00
Lynne 934525eae0
lsws: add in/out support for the new 12-bit 2-plane 422 and 444 pixfmts 2023-05-29 00:41:35 +02:00
Lynne 0bda3340a3
lavu: add 12-bit 2-plane 422 and 444 pixel formats 2023-05-29 00:41:35 +02:00