summaryrefslogtreecommitdiff
path: root/libavutil/tests
Commit message (Collapse)AuthorAgeFilesLines
* lavu/hwcontext_vaapi: Add Windows/VAAPI support with vaGetDisplayWin32Sil Vilerino2023-04-241-1/+1
| | | | | | | | | | | | Libva 2.17+ adds a new libva-win32 node and Mesa 22.3 adds a VAAPI driver based on Direct3D 12 for Windows. Both of them are available at: https://www.nuget.org/packages/Microsoft.Direct3D.VideoAccelerationCompatibilityPack Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/ Signed-off-by: Sil Vilerino <sivileri@microsoft.com> Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
* avutil/{color_utils, csp}: merge color_utils into csp and expose APILeo Izen2023-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | libavutil/color_utils contains some avpriv_ symbols that map enum AVTransferCharacteristic values to gamma-curve approximations and to the actual transfer functions to invert them (i.e. -> linear). There's two issues with this: (1) avpriv is evil and should be avoided whenever possible (2) libavutil/csp.h exposes a public API for handling color that already handles primaries and matricies I don't see any reason this API has to be private, so this commit takes the functionality from avutil/color_utils and merges it into avutil/csp with an exposed av_ API rather than the previous avpriv_ API. Every reference to the previous API has been updated to point to the new one. color_utils.h has been deleted as well. This should not break any applications as it only contained avpriv_ symbols in the first place, so nothing in that header could be referenced by other applications. Signed-off-by: Leo Izen <leo.izen@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avutil: remove FF_API_D2STRJames Almer2023-02-091-16/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/dict: Explicitly test av_dict_iterate()Andreas Rheinhardt2022-12-071-5/+25
| | | | | | | | This commit tests it in a way that automatically checks that using av_dict_iterate() is equivalent to using av_dict_get() with key "" and AV_DICT_IGNORE_SUFFIX. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: use av_dict_iterateMarvin Scholz2022-12-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/cpu: print the avx512icl flagJames Darnley2022-11-041-0/+1
|
* avutil/tests/pixelutils: Test that all non-hw pix fmts have componentsAndreas Rheinhardt2022-09-301-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/pixelutils: Use av_assert0 instead for test toolsAndreas Rheinhardt2022-09-301-1/+1
| | | | | | These are test tools, so they should be picky. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/pixdesc: Move ff_check_pixfmt_descriptors() to its only userAndreas Rheinhardt2022-09-301-1/+52
| | | | | | | Namely to lavu/tests/pixelutils.c. This way, this function will not be included into actual binaries any more. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/dict: Error out in case of key == NULLAndreas Rheinhardt2022-09-191-3/+9
| | | | | | | | | | | | | | | | | | | Up until now, using NULL as key in av_dict_get() on a non-empty AVDictionary would crash; using NULL as key in av_dict_set() would also crash for a non-empty AVDictionary unless AV_DICT_MULTIKEY was set; in case the dictionary was initially empty or AV_DICT_MULTIKEY was set, it was even possible for av_dict_set() to succeed when adding a NULL key, namely when one uses a value != NULL and the AV_DICT_DONT_STRDUP_VAL flag. Using av_dict_get() on such an AVDictionary will usually lead to crashes, though. Fix this by actually checking for key in both functions; error out if they are NULL. While just at it, also stop relying on av_strdup(NULL) to return NULL in av_dict_set(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/pixdesc: favour formats where depth and subsampling exactly matchPhilip Langdale2022-09-171-19/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* avutil/tests/.gitignore: Add channel_layout testtoolAndreas Rheinhardt2022-09-051-0/+1
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/pixfmt: Introduce VUYX formatPhilip Langdale2022-08-251-0/+1
| | | | | | | | | | | | | | 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
* avutil/test/pixfmt_best: test the VUYA pixel formatJames Almer2022-08-071-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/uuid: add uuid testsPierre-Anthony Lemieux2022-06-122-0/+142
|
* libavutil/tests/md5: Remove 'volatile workaround' to avoid warningssoftworkz2022-06-081-2/+2
| | | | | | | | | | | Those are always showing up on Patchwork when FATE tests are failing, covering some possibly more useful information. The volatile keyword was used as a workaround for an eight year old clang version. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/tests/channel_layout: also test ambisonic layouts in ↵James Almer2022-03-251-0/+6
| | | | | | av_channel_layout_subset() Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test av_channel_layout_check()James Almer2022-03-251-2/+4
| | | | | | Should increase test coverage Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test the output of av_channel_layout_subset()James Almer2022-03-251-0/+18
| | | | | | Should increase test coverage a bit Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test the output of av_channel_layout_standard()James Almer2022-03-251-1/+20
| | | | | | Should increase test coverage. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test generating a custom layout using ambisonic ↵James Almer2022-03-251-0/+2
| | | | | | | | channels and a non diegetic channel with a custom name Should increase test coverage a bit Signed-off-by: James Almer <jamrial@gmail.com>
* channel_layout: add support for AmbisonicVittorio Giovara2022-03-151-0/+40
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavu: support AVChannelLayout AVOptionsAnton Khirnov2022-03-151-4/+4
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* fate: add a channel_layout API testJames Almer2022-03-151-0/+266
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt2022-02-242-0/+6
| | | | | | | | | | Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/avassert: Don't include avutil.hAndreas Rheinhardt2022-02-242-0/+3
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/display: Don't include avutil.hAndreas Rheinhardt2022-02-241-0/+1
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/log: Don't include avutil.hAndreas Rheinhardt2022-02-243-0/+10
| | | | | | | | | | | | It has been included since af5f434f8c0fb3b4ee3b206ebc1946ca660a8abe for deprecation reasons, but removing it has been forgotten after it had served is purpose. So remove it. For convenience, include version.h instead as LIBAVUTIL_VERSION_INT is supposed to be used when creating AVClasses. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/fifo: add a test for _cb functionsAnton Khirnov2022-02-151-0/+101
| | | | | Makes an auto-growing FIFO and performs a sequence of randomly-sized writes/peeks/reads.
* lavu/tests/fifo: switch to the new APIAnton Khirnov2022-02-071-26/+21
|
* avutil/tests/adler32: Remove unnecessary volatileAndreas Rheinhardt2022-01-291-2/+1
| | | | | | And use an ordinary stack variable. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/fifo: deprecate av_fifo_peek2()Anton Khirnov2022-01-101-8/+0
| | | | | | It returns a pointer inside the fifo's buffer, which cannot be safely used without accessing AVFifoBuffer internals. It is easier and safer to use av_fifo_generic_peek_at().
* avutil/tests/cpu: add slowgatherJames Almer2021-12-211-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/twofish: Fixed decryptionSebastian Kirmayer2021-12-191-3/+12
| | | | | | | | | | The previous implementation swapped the two halves of the plaintext. The existing tests only decrypted data with a plaintext of all zeroes, which is not affected by swapping the halves. Tests which detect the old buggy behavior have been added. Signed-off-by: Sebastian Kirmayer <ffmpeg@kirmayer.eu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: [loongarch] Add support for loongarch SIMD.Shiyou Yin2021-12-151-0/+3
| | | | | | | | | | | LSX and LASX is loongarch SIMD extention. They are enabled by default if compiler support it, and can be disabled with '--disable-lsx' '--disable-lasx'. Change-Id: Ie2608ea61dbd9b7fffadbf0ec2348bad6c124476 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/tests/opt: Set AVClass.versionAndreas Rheinhardt2021-09-271-0/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-221-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove unnecessary mem.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/audio_ffio: add missing headerMatthieu Patou2021-06-131-0/+1
| | | | | | | Needed for HAVE_BIGENDIAN Suggested-by: ffmpeg@fb.com Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/lzo: remove timer macrosJames Almer2021-06-131-2/+0
| | | | | Suggested-by: ffmpeg@fb.com Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov2021-01-012-0/+2
| | | | They are not properly namespaced and not intended for public use.
* lavu: move LOCAL_ALIGNED from internal.h to mem_internal.hAnton Khirnov2021-01-011-0/+1
| | | | That is a more appropriate place for it.
* lavu/avstring: deprecate av_d2str().Nicolas George2020-08-211-0/+4
| | | | | It is no longer used in our code base and does not seem to be used much in other projects.
* tests/imgutils: test the output of av_image_fill_* functionsJames Almer2020-07-301-0/+38
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil: Detect MMI and MSA flags for MIPSJiaxun Yang2020-07-231-0/+3
| | | | | | | | | | | | | | | Add MMI & MSA runtime detection for MIPS. Basically there are two code pathes. For systems that natively support CPUCFG instruction or kernel emulated that instruction, we'll sense this feature from HWCAP and report the flags according to values grab from CPUCFG. For systems that have no CPUCFG (or not export it in HWCAP), we'll parse /proc/cpuinfo instead. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/tests/opt: add av_opt_get/av_opt_set testsMarton Balint2019-12-271-0/+41
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/tests/opt: add tests for AV_OPT_TYPE_DICTMarton Balint2019-12-271-0/+5
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil: Add NV24 and NV42 pixel formatsPhilip Langdale2019-05-121-0/+1
| | | | | | | | | | | | | These are the 4:4:4 variants of the semi-planar NV12/NV21 formats. These formats are not used much, so we've never had a reason to add them until now. VDPAU recently added support HEVC 4:4:4 content and when you use the OpenGL interop, the returned surfaces are in NV24 format, so we need the pixel format for media players, even if there's no direct use within ffmpeg. Separately, there are apparently webcams that use NV24, but I've never seen one.
* avutil/tests/random_seed: seeds[] is uint32_t, therefore use PRIX32 macroPeter Ross2018-12-161-1/+1
| | | | squelch format type warning
* avutil/tests/parseutils: add some big duration testsMarton Balint2018-10-071-0/+4
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>