summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* fftools/ffmpeg: deprecate -filter_scriptAnton Khirnov2024-01-202-4/+4
| | | | It is equivalent to -/filter.
* fftools/ffmpeg: deprecate -filter_complex_scriptAnton Khirnov2024-01-204-20/+20
| | | | It is equivalent to -/filter_complex.
* fftools/ffmpeg_demux: implement -bsf for inputAnton Khirnov2024-01-192-0/+23
| | | | | Previously bitstream filters could only be applied right before muxing, this allows to apply them right after demuxing.
* avutil/eval: Use even better PRNGMichael Niedermayer2024-01-162-105/+105
| | | | | | | | | | | | | | | | | | 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 <[email protected]>
* checkasm: Test whether the native FFmpeg timers workMartin Storsjö2024-01-151-1/+11
| | | | | | | | | | | | | | | 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ö <[email protected]>
* fate/mov: add dependencies to heif testsJames Almer2024-01-151-4/+8
| | | | Signed-off-by: James Almer <[email protected]>
* fate/subtitles: add missing ref for fate-sub-rcwtJames Almer2024-01-151-0/+2
| | | | Signed-off-by: James Almer <[email protected]>
* avformat/mov: improve HEIF parsingJames Almer2024-01-152-2/+2
| | | | | | | | | | | | 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 <[email protected]> Signed-off-by: James Almer <[email protected]>
* checkasm/svqenc: add ssd_int8_vs_int16 testsunyuechi2024-01-155-0/+74
| | | | Signed-off-by: Rémi Denis-Courmont <[email protected]>
* libavformat: add RCWT closed caption muxexMarth642024-01-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Marth64 <[email protected]> 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).
* checkasm: Generalize crash handlingMartin Storsjö2024-01-113-44/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the riscv specific handling from 7212466e735aa187d82f51dadbce957fe3da77f0 (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ö <[email protected]>
* avcodec/proresenc_anatoliy: do not write into chroma reserved bitfieldsClément Bœsch2024-01-1016-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* avcodec/proresenc_anatoliy: do not write into alpha reserved bitfieldsClément Bœsch2024-01-1016-16/+16
| | | | | | | | 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.
* avcodec/proresenc_kostya: do not write into alpha reserved bitfieldsClément Bœsch2024-01-104-4/+4
| | | | | | | | | 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.
* avcodec/proresenc_anatoliy: use a compatible bitstream versionClément Bœsch2024-01-108-8/+8
| | | | | | | | | | | | 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.
* fate/mov: force the native av1 decoder for the avif testsJames Almer2024-01-093-4/+4
| | | | Signed-off-by: James Almer <[email protected]>
* avformat/mov: Add support for demuxing still HEIC imagesVignesh Venkatasubramanian via ffmpeg-devel2024-01-093-0/+28
| | | | | | | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: James Almer <[email protected]>
* fate/mov: enable the AVIF testsJames Almer2024-01-091-8/+4
| | | | | | The samples were uploaded long ago, but this was forgotten. Signed-off-by: James Almer <[email protected]>
* fate: Add fsync filter testsThilo Borgmann2024-01-056-1/+149
|
* avcodec/hevc_parser: fix missing zero_byte at frame beginningZhao Zhili2024-01-051-1/+1
| | | | | | | 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 <[email protected]>
* avfilter: add negotiation API for color space/rangeNiklas Haas2023-12-311-2/+2
| | | | | | | | | | | | | | | | | | | 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.
* tests/dca: remove usage of deprecated request_channel_layout optionJames Almer2023-12-281-6/+6
| | | | Signed-off-by: James Almer <[email protected]>
* tests/truehd: remove usage of deprecated request_channel_layout optionJames Almer2023-12-281-1/+1
| | | | Signed-off-by: James Almer <[email protected]>
* avformat/riffenc: don't force WAVEFORMATEXTENSIBLE for flt/dbl LPCMGyan Doshi2023-12-284-58/+58
| | | | | | | | | | | | 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.
* avcodec/takdsp: fix const correctnessJames Almer2023-12-221-3/+3
| | | | Signed-off-by: James Almer <[email protected]>
* checkasm/takdsp: add decorrelate_sf testJames Almer2023-12-221-3/+32
| | | | Signed-off-by: James Almer <[email protected]>
* checkasm: Fix the takdsp testsMartin Storsjö2023-12-221-9/+10
| | | | | | | | | | | | | | | | | | | | 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ö <[email protected]>
* Add new vf_tiltandshift filterVittorio Giovara2023-12-212-0/+57
| | | | Signed-off-by: Vittorio Giovara <[email protected]>
* checkasm/takdsp: add decorrelate_sm testsunyuechi2023-12-211-0/+29
| | | | Signed-off-by: Rémi Denis-Courmont <[email protected]>
* checkasm/takdsp: add decorrelate_sr testsunyuechi2023-12-211-0/+27
| | | | Signed-off-by: Rémi Denis-Courmont <[email protected]>
* checkasm/takdsp: add decorrelate_ls testsunyuechi2023-12-215-0/+74
| | | | Signed-off-by: Rémi Denis-Courmont <[email protected]>
* checkasm: Remove unnecessary const on scalar parametersMartin Storsjö2023-12-212-6/+6
| | | | | | | | | | | | | | | | | | | | | 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ö <[email protected]>
* fate: Allow running multiple rounds of tests with differing settingsMartin Storsjö2023-12-192-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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ö <[email protected]>
* fate: Allow overriding what targets to make for running the testsMartin Storsjö2023-12-191-1/+2
| | | | | | | | | | | | 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ö <[email protected]>
* swr/swresample: avoid reapplication of firstptsGyan Doshi2023-12-182-0/+27
| | | | | | | | | | | | | | | | | | | | | | 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.
* fate/jpegxl: add multiframe permuted TOC image parser testLeo Izen2023-12-152-0/+14
| | | | | | | | | 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 <[email protected]>
* tests/fate: add pixelize filter testsPaul B Mahol2023-12-144-0/+12
| | | | | Signed-off-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* tests/fate: add median filter testPaul B Mahol2023-12-142-0/+4
| | | | | Signed-off-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avutil/imgutils: add support for 32bit pixel format for av_image_fill_black()Marton Balint2023-12-131-12/+12
| | | | Signed-off-by: Marton Balint <[email protected]>
* avutil/imgutils: fix av_image_fill_black() for some pixel formatsMarton Balint2023-12-131-7/+7
| | | | | | | | | | | - 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 <[email protected]>
* avutil/tests/imgutils: add tests for av_image_fill_black()Marton Balint2023-12-131-0/+217
| | | | Signed-off-by: Marton Balint <[email protected]>
* fftools/ffmpeg: convert to a threaded architectureAnton Khirnov2023-12-121-21/+13
| | | | | | | | | | 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.
* fftools/ffmpeg_filter: make sub2video heartbeat more robustAnton Khirnov2023-12-122-5/+7
| | | | | | | | | | 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.
* checkasm: test for abs_pow34sunyuechi2023-12-115-1/+77
| | | | Signed-off-by: Rémi Denis-Courmont <[email protected]>
* riscv: test for assembler supportRémi Denis-Courmont2023-12-083-3/+6
| | | | | This should fix the build on LLVM 16 and earlier, at the cost of turning all non-RVV optimisations off.
* tests/fate: add asegment filter testsPaul B Mahol2023-12-055-0/+1115
|
* fate/jpegxl: add parser test for extboxes and small filesLeo Izen2023-12-052-0/+17
| | | | | | | Add a fate test for the above commits fixing extremely small files or files with extended box sizes. Signed-off-by: Leo Izen <[email protected]>
* fate: Add tests for QOA decoderCosmin Stejerean2023-12-045-0/+196
|
* checkasm: Fix the signature of float_to_fixed24Martin Storsjö2023-12-021-1/+1
| | | | | | | | | | The len parameter was changed from unsigned int to size_t in 567c67c6c8cb9be083f56198bfa979e4bda84c99. This fixes crashes in the reference C code, when running checkasm on aarch64. Signed-off-by: Martin Storsjö <[email protected]>
* checkasm/ac3dsp: add float_to_fixed24 testsunyuechi2023-12-015-0/+76
| | | | Signed-off-by: Rémi Denis-Courmont <[email protected]>