aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/tests
Commit message (Collapse)AuthorAgeFilesLines
* avutil/frame: add helper for adding side data to arrayJan Ekström2024-03-201-0/+103
| | | | | Additionally, add an API test to check that the no-duplicates addition works after duplicates have been inserted.
* avutil/channel_layout: add specific text versions for unknown and unused ↵Marton Balint2024-03-161-0/+2
| | | | | | channels Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/tests/channel_layout: add some av_channel_from_string and ↵Marton Balint2024-03-161-0/+26
| | | | | | | | | av_channel_layout_from_string tests We lacked tests which supposed to fail, and there are some which should fail but right now it does not. This will be fixed in a later commit. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/tests/channel_layout: make printing results part of the testsMarton Balint2024-03-161-185/+98
| | | | | | | | | | Deduplicates a lot of code. Some minor differences (mostly white space and inconsistent use of quotes) are expected in the fate tests, there was no point aiming for exactly the same formatting. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/opt: add array optionsAnton Khirnov2024-03-081-0/+49
|
* avutil/tests/pixelutils: Remove dead codeAndreas Rheinhardt2024-02-211-8/+0
| | | | | | Forgotten in e6b125e3be19fb341fd9a759ad0af3b39ba35e0c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/channel_layout: add tests for av_channel_order_retypeMarton Balint2024-02-181-0/+63
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12Wu Jianhua2023-12-211-0/+2
| | | | | Signed-off-by: Wu Jianhua <toqsxw@outlook.com> Signed-off-by: Tong Wu <tong1.wu@intel.com>
* riscv: Tweak names of cpu flags, print flags in libavutil/tests/cpuMartin Storsjö2023-12-171-0/+10
| | | | | | | | | | | | | | | | The names of the cpu flags, when parsed from a string with av_parse_cpu_caps, are parsed by the libavutil eval functions. These interpret dashes as subtractions. Therefore, these previous cpu flag names haven't been possible to set. Use the official names for these extensions, as the previous ad-hoc names wasn't parseable. libavutil/tests/cpu tests that the cpu flags can be set, and prints the detected flags. Acked-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/tests/imgutils: add tests for av_image_fill_black()Marton Balint2023-12-131-9/+52
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/tests/imgutils: factorize basic tests to new functionMarton Balint2023-12-131-29/+39
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/mem: Don't include avutil.hAndreas Rheinhardt2023-09-073-0/+6
| | | | | | | | | It is not necessary at all. So remove it. This also breaks an inclusion cycle mem.h->avutil.h->common.h->mem.h. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/channel_layout: Test av_channel_layout_copy()Andreas Rheinhardt2023-08-101-1/+11
| | | | | | | | | | Specifically, test copying a channel layout with custom order, so that the allocation codepath of av_channel_layout_copy() is executed. Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/channel_layout: Don't include lavu/channel_layout.cAndreas Rheinhardt2023-08-101-1/+7
| | | | | | | | | This test does not need access to the internals of said compilation unit. Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/channel_layout: Also test non-AVBPrint variantsAndreas Rheinhardt2023-08-101-18/+90
| | | | | | Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/tests/cpu: stop processing the thread countAnton Khirnov2023-07-111-6/+2
| | | | | | Just print it as it is. Needed by the following commit.
* avutil/softfloat: fix av_sincos_sf()Michael Niedermayer2023-06-231-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aarch64: Add cpu flags for the dotprod and i8mm extensionsMartin Storsjö2023-06-061-0/+2
| | | | | | | Set these available if they are available unconditionally for the compiler. Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>