Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-09-20fate/ffmpeg: Set max_delay for shortest-subAndreas Rheinhardt
The aim of this test is to show the interleavement of the file generated in the first pass; so make the interleavement queue in the framecrc muxer in the second pass as small as possible so that the framecrc muxer does not fix wrong interleavement of the input file behind our backs. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-20fate/ffmpeg: Use transcode instead of enc_dec in shortest-sub testAndreas Rheinhardt
enc_dec is designed for raw input and output and computes the PSNR between these two. The input of the shortest-sub test is the idx file of a vobsub sub+idx combination and the output is the output of framecrc of said vobsub subtitle muxed into Matroska together with a synthesized video. Calculating the PSNR between these two files makes no sense, therefore switch to a transcode test, where the ref file file contains the output of framecrc directly, making the interleavement better visible in the ref file at the cost of a larger ref file (>400 lines). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-20fate/mxf: add JPEG 2000 testPierre-Anthony Lemieux
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-20fate/mxf: Add ProRes remux testAndreas Rheinhardt
Also covers writing mastering display metadata. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-20tests/mxf: Fix test requirementsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-20tests/checkasm: add a test for VorbisDSPContextJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-19avcodec/aptxenc: Process data in complete blocks of four samples onlyAndreas Rheinhardt
Do this by setting AVCodecInternal.pad_samples. This prevents reading into the frame's padding and writing into the packet's padding. This actually happened in our FATE tests (where the number of samples is 2 mod 4), which therefore needed to be updated. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-19avcodec/utils: Support APTX (HD) in av_get_audio_frame_duration()Andreas Rheinhardt
APTX decodes four bytes of input to four stereo samples; APTX HD does the same with six bytes of input. So it can be easily supported in av_get_audio_frame_duration(). This fixes invalid durations and (derived) timestamps of demuxed APTX HD packets and therefore fixed the timestamp in the aptx-hd FATE test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-19fate/audio: Add tests for APTX (HD)Andreas Rheinhardt
We have de- and encoders for APTX and APTX HD, yet not FATE tests. This commit therefore adds a transcoding test to utilize them. Furthermore, during creating these tests it turned out that the duration is set incorrectly for APTX HD. This will be fixed in a future commit. (Thanks to Andriy Gelman for finding an issue in an earlier version that used a 192kHz input sample which does not work reliably accross platforms.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-18fate/lavf-audio: Add dfpwm testAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-18lavu/pixdesc: favour formats where depth and subsampling exactly matchPhilip Langdale
Since introducing the various packed formats used by VAAPI (and p012), we've noticed that there's actually a gap in how av_find_best_pix_fmt_of_2 works. It doesn't actually assign any value to having the same bit depth as the source format, when comparing against formats with a higher bit depth. This usually doesn't matter, because av_get_padded_bits_per_pixel() will account for it. However, as many of these formats use padding internally, we find that av_get_padded_bits_per_pixel() actually returns the same value for the 10 bit, 12 bit, 16 bit flavours, etc. In these tied situations, we end up just picking the first of the two provided formats, even if the second one should be preferred because it matches the actual bit depth. This bug already existed if you tried to compare yuv420p10 against p016 and p010, for example, but it simply hadn't come up before so we never noticed. But now, we actually got a situation in the VAAPI VP9 decoder where it offers both p010 and p012 because Profile 3 could be either depth and ends up picking p012 for 10 bit content due to the ordering of the testing. In addition, in the process of testing the fix, I realised we have the same gap when it comes to chroma subsampling - we do not favour a format that has exactly the same subsampling vs one with less subsampling when all else is equal. To fix this, I'm introducing a small score penalty if the bit depth or subsampling doesn't exactly match the source format. This will break the tie in favour of the format with the exact match, but not offset any of the other scoring penalties we already have. I have added a set of tests around these formats which will fail without this fix.
2022-09-13fate/spdif: Add spdif testsAndreas Rheinhardt
These tests test both the demuxer as well as the muxer wherever possible. It is not always possible due to the fact that the muxer supports more codecs than the demuxer. The spdif demuxer does currently not set the need_parsing flag. If one were to set this to AVSTREAM_PARSE_FULL, the test results would change as follows: - For spdif-aac-remux, the packets are currently padded to 16bits, i.e. if the actual packet size is odd, there is a padding byte. The parser splits this byte away into a one byte packet of its own. Insanely, these one byte packets get the same duration as normal packets, i.e. timing is ruined. - The DCA-remux tests get proper duration/timestamps. - In the spdif-mp2-remux test the demuxer marks the stream as being MP2; the parser sets it to MP3 and this triggers the "Codec change in IEC 61937" codepath; this test therefore returns only two packets with the parser. - For spdif-mp3-remux some bytes end up in different packets: Some input packets of this file have an odd length (417B instead of 418B like all the other packets) and are padded to 418B. Without a parser, all returned packets from the spdif-demuxer are 418B. With a parser, the packets that were originally 417B are 417B again, but the padding byte has not been discarded, but added to the next packet which is now 419B. This fixes "Multiple frames in a packet" warning and avoids an "Invalid data found when processing input" error when decoding. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-12fate/subtitles: Add PGS remux testAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-12fate/id3v2: Add test for reading and writing UTF-16 BOM tagsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-10swscale/output: add support for Y210LE and Y212LEPhilip Langdale
2022-09-10swscale/output: add support for XV30LEPhilip Langdale
2022-09-10swscale/output: add support for XV36LEPhilip Langdale
2022-09-10swscale/output: add support for P012Philip Langdale
This generalises the existing P010 support.
2022-09-10fate/matroska: Add test for updating AV1 extradataAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-10tests/fate-run: Allow to set input options for encoding passAndreas Rheinhardt
This will be useful in the next commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-09avformat/mov: don't read duration from mvhd atomJames Almer
This duration is equal to the longest duration in all track's tkhd atoms, which may be comprised of the sum of all edit lists in each track. Empty edit lists in tracks represent start_time, and the actual media duration is stored in the mdhd atom. This change lets the generic demux code derive the longest track duration taken from mdhd atoms, so the correct duration and start_time combination will be reported. Should fix ticket #9775. Reviewed-by: zhilizhao(赵志立) <quinkblack@foxmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-06checkasm/tx: add checkasm support for the iMDCTLynne
2022-09-06ref/fate/ffprobe_xsd: Change ref fileAndreas Rheinhardt
Forgotten in 5c16df1b92c519238e10664eeab3adb3b9016edd, because neither I nor patchwork ran fate with xmllint. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Write CodecDelay for codecs != OpusAndreas Rheinhardt
The field is not specific to Opus. The mp2fixed encoder signals initial_padding and is used by both the matroska-encoding-delay test as well as the lavf-mkv tests which necessitated several FATE ref changes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Use custom min timestampAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Actually apply timestamp offset for OpusAndreas Rheinhardt
Matroska generally requires timestamps to be nonnegative, but there is an exception: Data that corresponds to encoder delay and is not supposed to be output anyway can have a negative timestamp. This is achieved by using the CodecDelay header field: The demuxer has to subtract this value from the raw (nonnegative) timestamps of the corresponding track. Therefore the muxer has to add this value first to write this raw timestamp. Support for writing CodecDelay has been added in FFmpeg commit d92b1b1babe69268971863649c225e1747358a74 and in Libav commit a1aa37dd0b96710d4a17718198a3f56aea2040c1. The former simply wrote the header field and did not apply any timestamp offsets, leading to desynchronisation (if one uses multiple tracks). The latter applied it at two places, but not at the one where it actually matters, namely in mkv_write_block(), leading to the same desynchronisation as with the former commit. It furthermore used the wrong stream timebase to convert the delay to the stream's timebase, as the conversion used the timebase from before avpriv_set_pts_info(). When the latter was merged in 82e4f39883932c1b1e5c7792a1be12dec6ab603d, it was only done in a deactivated state that still did not offset the timestamps when muxing due to "assertion failures and av sync errors". a1aa37dd0b96710d4a17718198a3f56aea2040c1 made it definitely more likely to run into assertion failures (namely if the relative block timestamp doesn't fit into an int16_t). Yet all of the above issues have been fixed (in commits 962d63157322466a9a82f9f9d84c1b6f1b582f65, 5d3953a5dcfd5f71391b7f34908517eb6f7e5146 and 4ebeab15b037a21f195696cef1f7522daf42f3ee. This commit therefore enables applying CodecDelay, fixing ticket #7182. There is just one slight regression from this: If one has input with encoder delay where the first timestamp is negative, but the pts of the part of the data that is actually intended to be output is nonnegative, then the timestamps will currently by default be shifted to make them nonnegative before they reach the muxer; the muxer will then ensure that the shifted timestamps are retained. Before this commit, the muxer did not ensure this; instead the timestamps that the demuxer will output were shifted and if the first timestamp of the actually intended output was zero before shifting, then this unintentional shift just cancels the shift performed before the packet reached the muxer. (But notice that this only applies if all the tracks use the same CodecDelay, or the relative sync between tracks will be impaired.) This happens in the matroska-opus-remux and matroska-ogg-opus-remux FATE tests. Future commits will forward the information that the Matroska muxer has a limited capability to handle negative timestamps so that the shifting in libavformat can take advantage of it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Only write DiscardPadding if nonzeroAndreas Rheinhardt
It is possible for the trailing padding to be zero, namely e.g. if the AV_PKT_DATA_SKIP_SAMPLES side data is used for leading padding. Matroska supports this (use a negative DiscardPadding), but players do not; at least Firefox refuses to play such a file. So for now only write DiscardPadding if it is trailing padding and nonzero. The fate-matroska-ogg-opus-remux was affected by this. (I wish CodecDelay would not exist and DiscardPadding would be used to instead trim the codec delay away (with the Block timestamp corresponding to the time at which the actually output audio is output).) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05fate/matroska: Add tests for muxing with initial_paddingAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05fftools/ffprobe: Report initial and trailing paddingAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05lavc/dv: remove ff_dvvideo_init()Anton Khirnov
The function contains only two assignments, setting DVVideoContext.avctx and AVCodecContext.chroma_sample_location. However, the decoder does not use the former, and the encoder should not be setting the latter. Therefore move the first assignment to dvenc and the second to dvdec. Make the encoder warn if the user-signalled chroma sample location does not match the supported one, and return an error on higher compliance levels.
2022-09-04lavu/pixfmt: Add P012, Y212, XV30, and XV36 formatsPhilip Langdale
These are the formats we want/need to use when dealing with the Intel VAAPI decoder for 12bit 4:2:0, 12bit 4:2:2, 10bit 4:4:4 and 12bit 4:4:4 respectively. As with the already supported Y210 and YUVX (XVUY) formats, they are based on formats Microsoft picked as their preferred 4:2:2 and 4:4:4 video formats, and Intel ran with it. P12 and Y212 are simply an extension of 10 bit formats to say 12 bits will be used, with 4 unused bits instead of 6. XV30, and XV36, as exotic as they sound, are variants of Y410 and Y412 where the alpha channel is left formally undefined. We prefer these over the alpha versions because the hardware cannot actually do anything with the alpha channel and respecting it is just overhead. Y412/XV46 is a normal looking packed 4 channel format where each channel is 16bits wide but only the 12msb are used (like P012). Y410/XV30 packs three 10bit channels in 32bits with 2bits of alpha, like A/X2RGB10 style formats. This annoying layout forced me to define the BE version as a bitstream format. It seems like our pixdesc infrastructure can handle the LE version being byte-defined, but not when it's reversed. If there's a better way to handle this, please let me know. Our existing X2 formats all have the 2 bits at the MSB end, but this format places them at the LSB end and that seems to be the root of the problem.
2022-08-26libswscale: add support for VUYX formatPhilip Langdale
As we already have support for VUYA, I figured I should do the small amount of work to support VUYX as well. That means a little refactoring to share code.
2022-08-26lavu/pixfmt: Introduce VUYX formatPhilip Langdale
This is the alphaless version of VUYA that I introduced recently. After further discussion and noting that the Intel vaapi driver explicitly lists XYUV as a support format for encoding and decoding 8bit 444 content, we decided to switch our usage and avoid the overhead of having a declared alpha channel around. Note that I am not removing VUYA, as this turned out to have another use, which was to replace the need for v408enc/dec when dealing with the format. The vaapi switching will happen in the next change
2022-08-19avutil/half2float: adjust conversion of NaNTimo Rothenpieler
IEEE-754 differentiates two different kind of NaNs. Quiet and Signaling ones. They are differentiated by the MSB of the mantissa. For whatever reason, actual hardware conversion of half to single always sets the signaling bit to 1 if the mantissa is != 0, and to 0 if it's 0. So our code has to follow suite or fate-testing hardware float16 will be impossible.
2022-08-19checkasm: sw_scale: Produce more realistic test filter coefficients for yuv2yuvXMartin Storsjö
This avoids triggering overflows in the filters, and avoids stray test failures in the approximate functions on x86; due to rounding differences, one implementation might overflow while another one doesn't. Signed-off-by: Martin Storsjö <martin@martin.st>
2022-08-18avcodec/h263dec: Remove redundant code to set cur_pic_ptrAndreas Rheinhardt
It is done later in ff_mpv_frame_start() (and nobody uses current_picture_ptr between setting it in ff_mpv_frame_start()). (The reason the vsynth*-h263-obmc ref files change is because the call to ff_find_unused_picture() now happens after the older pictures have been unreferenced in ff_mpv_frame_start(), so that their slots in the picture array can be immediately reused; the obmc code is somehow buggy and changes its output depending on the earlier contents of the motion_val buffer.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-18checkasm/sw_scale: hscale does not requires cpuflag test.Alan Kelly
This is done in ff_shuffle_filter_coefficients. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-08-18libswscale: Enable hscale_avx2 for all input sizes.Alan Kelly
ff_shuffle_filter_coefficients shuffles the tail as required. Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-08-17checkasm: motion: Test different h parametersMartin Storsjö
Previously, the checkasm test always passed h=8, so no other cases were tested. Out of the me_cmp functions, in practice, some functions are hardcoded to always assume a 8x8 block (ignoring the h parameter), while others do use the parameter. For those with hardcoded height, both the reference C function and the assembly implementations ignore the parameter similarly. The documentation for the functions indicate that heights between w/2 and 2*w, within the range of 4 to 16, should be supported. This patch just tests random heights in that range, without knowing what width the current function actually uses. Signed-off-by: Martin Storsjö <martin@martin.st>
2022-08-16checkasm: Provide enough alignment in the new yuv2plane1 testMartin Storsjö
This fixes the checkasm test in some setups on x86. Signed-off-by: Martin Storsjö <martin@martin.st>
2022-08-16checkasm/hevc_add_res: add 12bit testJ. Dekker
Also fix the bug where in every other byte only the lower 2 bits were used in the 8bit test. Signed-off-by: J. Dekker <jdek@itanimul.li>
2022-08-16checkasm: updated tests for sw_scaleSwinney, Jonathan
Change the reference to exactly match the C reference in swscale, instead of exactly matching the x86 SIMD implementations (which differs slightly). Test with and without SWS_ACCURATE_RND - if this flag isn't set, the output must match the C reference exactly, otherwise it is allowed to be off by 2. Mark a couple x86 functions as unavailable when SWS_ACCURATE_RND is set - apparently this discrepancy hasn't been noticed in other exact tests before. Add a test for yuv2plane1. Signed-off-by: Jonathan Swinney <jswinney@amazon.com> Signed-off-by: Martin Storsjö <martin@martin.st>
2022-08-13lavu/pixfmt: add packed RGBA float16 formatTimo Rothenpieler
This is the default format of the Windows compositor and what DXGI Desktop Duplication will give you for any kind of HDR output.
2022-08-10avcodec/wmv2dec: Zero mb_type array for I picturesAndreas Rheinhardt
Up until now, ff_wmv2_decode_secondary_picture_header() only set the mb_type array for non I-pictures, so that the decoding process uses the earlier values of this array; this affects the output of the wmv8-x8intra FATE-test (which this patch therefore updates). These earlier values were set when decoding earlier frames or when the buffer was initially zero-allocated. A consequence of this is that the output of this test would be random if ff_find_unused_picture() would select the unused picture to return at random. Furthermore decoding from a keyframe onwards depends upon the earlier state of the decoder. This patch therefore zeroes said array when decoding an I picture. (It is not claimed that zero is the right value to fill the array with. I just don't know.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-09avcodec/mpegpicture: Move mb_var, mc_mb_var and mb_mean to MpegEncCtxAndreas Rheinhardt
These tables are only used by encoders and only for the current picture; ergo they need not be put into the picture at all, but rather into the encoder's context. They also don't need to be refcounted, because there is only one owner. In contrast to this, the earlier code refcounts them which incurs unnecessary overhead. These references are not unreferenced in ff_mpeg_unref_picture() (they are kept in order to have something like a buffer pool), so that several buffers are kept at the same time, although only one is needed, thereby wasting memory. The code also propagates references to other pictures not part of the pictures array (namely the copy of the current/next/last picture in the MpegEncContext which get references of their own). These references are not unreferenced in ff_mpeg_unref_picture() (the buffers are probably kept in order to have something like a pool), yet if the current picture is a B-frame, it gets unreferenced at the end of ff_mpv_encode_picture() and its slot in the picture array will therefore be reused the next time; but the copy of the current picture also still has its references and therefore these buffers will be made duplicated in order to make them writable in the next call to ff_mpv_encode_picture(). This is of course unnecessary. Finally, ff_find_unused_picture() is supposed to just return any unused picture and the code is supposed to work with it; yet for the vsynth*-mpeg4-adap tests the result depends upon the content of these buffers; given that this patchset changes the content of these buffers (the initial content is now the state of these buffers after encoding the last frame; before this patch the buffers used came from the last picture that occupied the same slot in the picture array) their ref-files needed to be changed. This points to a bug somewhere (if one removes the initialization, one gets uninitialized reads in adaptive_quantization in ratecontrol.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08checkasm: Silence warnings about unused return value from read()Martin Storsjö
This codepath is enabled by default on arm, if the linux perf API is available, unless disabled with --disable-linux-perf. Signed-off-by: Martin Storsjö <martin@martin.st>
2022-08-08swscale/output: fix reading chroma values when generating vuya outputJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07fate: fix reference file for fate-pixfmt_bestJames Almer
Missed in 85c59bd6de88aafa7b5682d7b71ff1adefe21a9e Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07avformat/riff: map AYUV fourcc to RAWVIDEO decoderJames Almer
There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07swscale/output: add VUYA output supportJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>