1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

283 Commits

Author SHA1 Message Date
Hendrik Leppkes
eb50a3d440 Merge commit '568a4323fbde03665b2b23a98068d02b39121812'
* commit '568a4323fbde03665b2b23a98068d02b39121812':
  checkasm: add synth_filter test

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 12:45:34 +01:00
Hendrik Leppkes
d882c0b9f9 Merge commit 'e71b747e9dc56cb84f8a06ec8214d5f3bd98bb6d'
* commit 'e71b747e9dc56cb84f8a06ec8214d5f3bd98bb6d':
  checkasm: add tests for dcadsp

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 12:38:46 +01:00
Hendrik Leppkes
0c7ade547a Merge commit '9d218d573f8088c606d873e80df572582e6773ef'
* commit '9d218d573f8088c606d873e80df572582e6773ef':
  checkasm: add float comparison util functions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 12:35:52 +01:00
Hendrik Leppkes
69ead86027 Merge commit '711781d7a1714ea4eb0217eb1ba04811978c43d1'
* commit '711781d7a1714ea4eb0217eb1ba04811978c43d1':
  x86: checkasm: check for or handle missing cleanup after MMX instructions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 11:55:44 +01:00
Hendrik Leppkes
e754c8e8ca Merge commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0'
* commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0':
  arm: add a cpu flag for the VFPv2 vector mode

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 11:01:29 +01:00
Janne Grunau
f0f54117c8 checkasm: x86: post commit review fixes
Check the full FPU tag word instead of only the lower half and simplify
the comparison.
Use upper-case function base name as macro name to instantiate both
checked_call variants.
2015-12-29 12:50:38 +01:00
Alexandra Hájková
2008f76054 dca: remove unused decode_hf function and quant_d tables
They were superseded with their integer equivalents. Rename integer
decode_hf to decode_hf.
2015-12-24 13:58:18 +01:00
Janne Grunau
489e6add44 checkasm: add fmtconvert tests 2015-12-21 18:58:46 +01:00
Janne Grunau
568a4323fb checkasm: add synth_filter test 2015-12-21 17:40:18 +01:00
Janne Grunau
e71b747e9d checkasm: add tests for dcadsp 2015-12-21 17:40:18 +01:00
Janne Grunau
9d218d573f checkasm: add float comparison util functions 2015-12-21 17:40:18 +01:00
Janne Grunau
711781d7a1 x86: checkasm: check for or handle missing cleanup after MMX instructions
Not every asm routine is expected clear the MMX state after returning.
It is however a requisite for testing floating point code in checkasm.
Annotate functions requiring cleanup with declare_func_emms() and issue
emms after the call. The remaining functions are checked for having  a
cleared MMX state after return.
2015-12-21 17:40:18 +01:00
Janne Grunau
e2710e790c arm: add a cpu flag for the VFPv2 vector mode
The vector mode was deprecated in ARMv7-A/VFPv3 and various cpu
implementations do not support it in hardware. Vector mode code will
depending the OS either be emulated in software or result in an illegal
instruction on cpus which does not support it. This was not really
problem in practice since NEON implementations of the same functions are
preferred. It will however become a problem for checkasm which tests
every cpu flag separately.

Since this is a cpu feature newer cpu do not support anymore the
behaviour of this flag differs from the other flags. It can be only
activated by runtime cpu feature selection.
2015-12-14 16:42:35 +01:00
Anton Khirnov
0cef06df07 checkasm: add HEVC MC tests 2015-12-05 21:11:21 +01:00
Timothy Gu
3d20f8e7c0 Add pixblockdsp checkasm tests 2015-11-07 18:46:55 -08:00
Rodger Combs
1e477a970f lavu: add AESNI CPU flag 2015-10-28 04:23:14 -05:00
Ronald S. Bultje
eb4b5ff738 vp9: add itxfm_add eob shortcuts to 10/12bpp functions.
These aren't quite as helpful as the ones in 8bpp, since over there,
we can use pmulhrsw, but here the coefficients have too many bits to
be able to take advantage of pmulhrsw. However, we can still skip
cols for which all coefs are 0, and instead just zero the input data
for the row itx. This helps a few % on overall decoding speed.
2015-10-13 11:06:01 -04:00
James Almer
285e41c34c checkasm: add alacdsp tests
Signed-off-by: James Almer <jamrial@gmail.com>
2015-10-06 20:25:49 -03:00
Henrik Gramner
ec85153f25 checkasm: Fix compilation with --disable-avcodec 2015-10-04 15:35:16 +02:00
Henrik Gramner
99982524f9 checkasm: Remove use of deprecated av_set_cpu_flags_mask() 2015-10-03 15:08:24 +02:00
Henrik Gramner
8bb376cf6b checkasm: Fix the function name sorting algorithm
The previous implementation was behaving incorrectly in some corner cases.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-10-03 13:38:03 +02:00
Henrik Gramner
69e456d7fb checkasm/vp9dsp: Fix iszero() to read the correct data 2015-09-28 18:50:13 +02:00
Ronald S. Bultje
0b227c6d47 checkasm: add vp9dsp.itxfm_add tests. 2015-09-28 10:51:53 -04:00
Henrik Gramner
19b28d047d checkasm: Fix the function name sorting algorithm
The previous implementation was behaving incorrectly in some corner cases.
2015-09-28 16:38:23 +02:00
Henrik Gramner
cc28552100 checkasm/x86: Correctly handle variadic functions
The System V ABI on x86-64 specifies that the al register contains an upper
bound of the number of arguments passed in vector registers when calling
variadic functions, so we aren't allowed to clobber it.

checkasm_fail_func() is a variadic function so also zero al before calling it.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-09-28 14:25:59 +02:00
Henrik Gramner
5405584b7b checkasm: Use a self-balancing tree
Tested functions are internally kept in a binary search tree for efficient
lookups. The downside of the current implementation is that the tree quickly
becomes unbalanced which causes an unneccessary amount of comparisons between
nodes. Improve this by changing the tree into a self-balancing left-leaning
red-black tree with a worst case lookup/insertion time complexity of O(log n).

Significantly reduces the recursion depth and makes the tests run around 10%
faster overall. The relative performance improvement compared to the existing
non-balanced tree will also most likely increase as more tests are added.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-09-28 11:16:33 +02:00
Henrik Gramner
7ca1de5b4f checkasm/x86: Correctly handle variadic functions
The System V ABI on x86-64 specifies that the al register contains an upper
bound of the number of arguments passed in vector registers when calling
variadic functions, so we aren't allowed to clobber it.

checkasm_fail_func() is a variadic function so also zero al before calling it.
2015-09-27 20:21:26 +02:00
James Almer
4e03f0ab08 checkasm/vp9dsp: add const to suppress "discards const qualifier" warnings
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-26 16:35:39 -03:00
James Almer
af990d72b7 checkasm/Makefile: add missing testclean target
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-26 16:35:34 -03:00
Henrik Gramner
2ab65b652d checkasm: Use a self-balancing tree
Tested functions are internally kept in a binary search tree for efficient
lookups. The downside of the current implementation is that the tree quickly
becomes unbalanced which causes an unneccessary amount of comparisons between
nodes. Improve this by changing the tree into a self-balancing left-leaning
red-black tree with a worst case lookup/insertion time complexity of O(log n).

Significantly reduces the recursion depth and makes the tests run around 10%
faster overall. The relative performance improvement compared to the existing
non-balanced tree will also most likely increase as more tests are added.
2015-09-26 15:11:11 +02:00
Ronald S. Bultje
7a4b97e946 checkasm: clip vp9 loopfilter test pixels inside allowed bitdepth range. 2015-09-26 06:42:33 -04:00
Rodger Combs
f559812a84 tests/checkasm: make randomize_buffers a function for easier debugging
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-26 02:47:53 +02:00
Michael Niedermayer
5ba40c3c71 tests/checkasm/vp9dsp: Revert first hunk of bddcf758d3
The change was wrong, also add a comment explaining it

Found-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-24 18:34:43 +02:00
Ronald S. Bultje
350e9c6765 vp9: fix loopfilter test code to address Hendrik's comments.
(I forgot to actually merge them into the patch I just pushed.)
2015-09-21 20:44:14 -04:00
Rodger Combs
df2a2643fe tests/checkasm: fix stack smash in check_loopfilter
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-20 20:26:09 +02:00
Michael Niedermayer
bddcf758d3 tests/checkasm/vp9dsp: Add () to protect macro arguments
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-20 11:37:57 +02:00
Ronald S. Bultje
b074367405 checkasm: add VP9 loopfilter tests.
The randomize_buffer() implementation assures that "most of the time",
we'll do a good mix of wide16/wide8/hev/regular/no filters for complete
code coverage. However, this is not mathematically assured because that
would make the code either much more complex, or much less random.
2015-09-20 10:33:04 +02:00
James Almer
784792788b checkasm: add jpeg2000dsp rct_int tests
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-20 00:49:35 -03:00
James Almer
763ffa2029 checkasm: add flacdsp decorrelate tests
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-17 15:33:07 -03:00
Henrik Gramner
781a25e9c4 checkasm: v210: Fix array overwrite 2015-09-17 10:33:06 +02:00
Michael Niedermayer
a860adb49c tests/checkasm/vp9dsp: Use snprintf() for safetey
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-16 14:19:37 +02:00
Henrik Gramner
6115966ad3 checkasm: v210: Fix array overwrite 2015-09-16 13:50:09 +02:00
Henrik Gramner
985e7d8cc1 checkasm: v210: s/Libav/FFmpeg/ 2015-09-16 13:48:43 +02:00
Ronald S. Bultje
bbd44e124a checkasm: add vp9 intra pred tests. 2015-09-15 16:43:29 -04:00
Ronald S. Bultje
084451e1e4 checkasm: add vp9 MC tests. 2015-09-15 16:43:28 -04:00
Hendrik Leppkes
8537e24927 Merge commit '3cdda78deb19b39dbbf8961ae0aec44dbb19bf6d'
* commit '3cdda78deb19b39dbbf8961ae0aec44dbb19bf6d':
  checkasm: add unit tests for v210enc

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 14:30:00 +02:00
Henrik Gramner
3cdda78deb checkasm: add unit tests for v210enc
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-06 10:36:24 +02:00
Henrik Gramner
c457bdebe7 checkasm: Fix floating point arguments on 64-bit Windows
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-28 09:54:54 +02:00
Henrik Gramner
33a58d7bf4 checkasm: Fix floating point arguments on 64-bit Windows 2015-08-25 19:34:46 +02:00
Henrik Gramner
515b69f8f8 checkasm: Explicitly declare function prototypes
Now we no longer have to rely on function pointers intentionally
declared without specified argument types.

This makes it easier to support functions with floating point parameters
or return values as well as functions returning 64-bit values on 32-bit
architectures. It also avoids having to explicitly cast strides to
ptrdiff_t for example.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-20 19:22:34 +02:00
Henrik Gramner
e13da244f4 checkasm: x86: properly save rdx/edx in checked_call()
If the return value doesn't fit in a single register rdx/edx can in some
cases be used in addition to rax/eax.

Doesn't affect any of the existing checkasm tests but might be useful later.

Also comment the relevant code a bit better.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-20 19:22:06 +02:00
Henrik Gramner
e6b8797b82 checkasm: x86: properly save rdx/edx in checked_call()
If the return value doesn't fit in a single register rdx/edx can in some
cases be used in addition to rax/eax.

Doesn't affect any of the existing checkasm tests but might be useful later.

Also comment the relevant code a bit better.
2015-08-19 16:17:35 +02:00
Henrik Gramner
18b101ff59 checkasm: Explicitly declare function prototypes
Now we no longer have to rely on function pointers intentionally
declared without specified argument types.

This makes it easier to support functions with floating point parameters
or return values as well as functions returning 64-bit values on 32-bit
architectures. It also avoids having to explicitly cast strides to
ptrdiff_t for example.
2015-08-19 16:17:35 +02:00
Henrik Gramner
8f4a06faf4 checkasm: Remove unnecessary include
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:00:53 +02:00
Henrik Gramner
5e8e121fcc checkasm: Remove unnecessary include 2015-08-05 23:21:28 +02:00
Michael Niedermayer
1919827f2c Merge commit 'bf0cef5c3a114df452e5476167634dd8f51eb448'
* commit 'bf0cef5c3a114df452e5476167634dd8f51eb448':
  checkasm: Include io.h for isatty, if available

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 12:23:54 +02:00
Martin Storsjö
bf0cef5c3a checkasm: Include io.h for isatty, if available
configure does check for isatty, and checkasm properly checks
HAVE_ISATTY, but on some platforms (e.g. WinRT), io.h needs to be
included for isatty to be available.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-07-30 09:27:09 +03:00
Henrik Gramner
65c1480152 checkasm: Modify report format
Makes it a bit more clear where each test belongs.

Suggested by Anton Khirnov.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-27 07:45:11 +02:00
Michael Niedermayer
b940145c67 Merge commit '65c14801527068fcaf729eeffc142ffd4682a21a'
* commit '65c14801527068fcaf729eeffc142ffd4682a21a':
  checkasm: Modify report format

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 12:27:12 +02:00
Michael Niedermayer
ce466275f8 Merge commit '4d0d55cd623bcd504867f948849380f6b4060b4d'
* commit '4d0d55cd623bcd504867f948849380f6b4060b4d':
  checkasm: Use LOCAL_ALIGNED

See: f467fc02b4
See: 9e83ac6114
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-26 11:39:58 +02:00
Michael Niedermayer
4d0d55cd62 checkasm: Use LOCAL_ALIGNED
Fixes alignment issues and bus errors.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-07-26 10:36:22 +03:00
Michael Niedermayer
f467fc02b4 tests/checkasm/h264pred: Use LOCAL_ALIGNED_16()
Fixes alignment issue and bus errors

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-23 00:44:02 +02:00
Michael Niedermayer
9e83ac6114 tests/checkasm/h264qpel: Use LOCAL_ALIGNED_16()
Fixes alignment issue and bus errors

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-23 00:35:18 +02:00
Michael Niedermayer
e1b5a2e46e Merge commit 'e605bf3b590d295f215fcc9fd58eb11be55b68cb'
* commit 'e605bf3b590d295f215fcc9fd58eb11be55b68cb':
  checkasm: remove empty array initializer list in h264pred test

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-22 16:38:16 +02:00
Michael Niedermayer
c1692439e0 Merge commit '3ae0e721c7b6e0483801b9039b3d140e3b68b7f5'
* commit '3ae0e721c7b6e0483801b9039b3d140e3b68b7f5':
  checkasm: Always link statically

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-22 16:30:37 +02:00
Janne Grunau
e605bf3b59 checkasm: remove empty array initializer list in h264pred test
Fixes MSVC compilation.
2015-07-22 12:06:32 +02:00
Luca Barbato
3ae0e721c7 checkasm: Always link statically
Checkasm needs to use internal symbols that should not be made public.
2015-07-21 23:22:42 +02:00
Michael Niedermayer
593731efa8 tests/checkasm/Makefile: Fix checkasm with SDL
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 15:55:05 +02:00
Michael Niedermayer
e6b01480e5 Merge commit '82e6ac85ff9aa7631b8c01521b3d6b5ca0bc8014'
* commit '82e6ac85ff9aa7631b8c01521b3d6b5ca0bc8014':
  checkasm: test all architectures with optimisations

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-18 02:31:14 +02:00
Michael Niedermayer
78274b19f1 Merge commit '6cc4d3e9a982e926494f4b919d9733fe29774acf'
* commit '6cc4d3e9a982e926494f4b919d9733fe29774acf':
  checkasm: exit with status 0 instead of 1 if there are no tests to perform

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-18 02:22:43 +02:00
Michael Niedermayer
b1861f18b6 Merge commit 'fc56868399213d3e9be19bdebeb64df233b39a7e'
* commit 'fc56868399213d3e9be19bdebeb64df233b39a7e':
  cosmetics: Reformat checkasm tests

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-18 01:57:04 +02:00
Janne Grunau
82e6ac85ff checkasm: test all architectures with optimisations 2015-07-18 01:06:45 +02:00
Henrik Gramner
6cc4d3e9a9 checkasm: exit with status 0 instead of 1 if there are no tests to perform 2015-07-18 01:06:44 +02:00
Michael Niedermayer
cb33f8d0f4 checkasm: Give macro a body to avoid potential unexpected syntax issues 2015-07-18 01:06:44 +02:00
Michael Niedermayer
72d1409e23 Merge commit 'd37f23263584774e1798e9ac909a398304a05091'
* commit 'd37f23263584774e1798e9ac909a398304a05091':
  checkasm: Add unit tests for bswapdsp

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-17 23:26:59 +02:00
Luca Barbato
fc56868399 cosmetics: Reformat checkasm tests 2015-07-17 21:29:20 +02:00
Henrik Gramner
d37f232635 checkasm: Add unit tests for bswapdsp
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-17 20:03:55 +02:00
Henrik Gramner
2cb34f82b9 checkasm: Add unit tests for h264qpel
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-15 19:47:07 +02:00
Michael Niedermayer
a39512ba9e tests/checkasm/checkasm: Give macro a body to avoid potential unexpected syntax issues
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-16 04:35:14 +02:00
Michael Niedermayer
cbd4a1dbde Merge commit '2cb34f82b92c15b811f5c03dc7f61a4baf6e02e3'
* commit '2cb34f82b92c15b811f5c03dc7f61a4baf6e02e3':
  checkasm: Add unit tests for h264qpel

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-15 22:44:28 +02:00
Michael Niedermayer
7c944b0a36 tests/checkasm/x86/Makefile: Use ASMSTRIPFLAGS for asm
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-13 03:15:44 +02:00
Michael Niedermayer
f14fc55969 Merge commit '8bc67ec2c0d2b5444d51a1bed1d50f0e10d92717'
* commit '8bc67ec2c0d2b5444d51a1bed1d50f0e10d92717':
  Checkasm: assembly testing and benchmarking tool

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12 21:03:06 +02:00
Henrik Gramner
8bc67ec2c0 Checkasm: assembly testing and benchmarking tool
It provides the following features:
 * verify correctness by comparing output to the C version.
 * detect failure to save and restore clobbered callee-saved registers.
 * detect 32-bit parameters being used as if they were 64-bit in x86-64
   (the upper halves are not guaranteed to be zero - but in practice
   they very often are, which makes those bugs hard to spot otherwise).
 * easy benchmarking.

Compile by running 'make checkasm'.
Execute by running 'tests/checkasm/checkasm'.

Optional arguments are '--bench' to run benchmarks for all functions,
'--bench=<pattern>' to run benchmarks for all functions that starts with
<pattern>, and '<integer>' to seed the PRNG for reproducible results.

Contains unit tests for most h264pred functions to get started, more tests
can be added afterwards using those as a reference.

Loosely based on code from x264. Currently only supports x86 and x86-64,
but additional architectures shouldn't be too much of an obstacle to add.

Note that functions with floating point parameters or floating point
return values are not supported. Some compiler-specific features or
preprocessor hacks would likely be required to add support for that.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2015-07-12 16:39:07 +02:00