Commit Graph

301 Commits

Author SHA1 Message Date
Limin Wang c748bd77dc tests: fix warning ISO C90 forbids mixed declarations and code
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-09-10 20:34:51 +08:00
Carl Eugen Hoyos b61376bdee lavfi/hflip: Support Bayer pixel formats.
Fixes part of ticket #8819.
2020-08-25 01:29:24 +02:00
Jiaxun Yang e387fcd01c libavutil: Detect MMI and MSA flags for MIPS
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>
2020-07-23 17:21:58 +02:00
James Almer 55e1bc39cb checkasm/vf_blend: use the correct depth parameters to initialize the blend modes
This effectively enables the tests that until now were just running
the C version alone.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-12 11:30:23 -03:00
Jun Zhao 7f76f20fa0 checkasm: sw_rgb: Fix mixed declaration and code
Fix mixed declaration and code.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-06-01 23:28:07 +08:00
Andreas Rheinhardt 57e570b508 checkasm/sw_scale: Fix stack-buffer-overflow
A buffer whose size is not a multiple of four has been initialized using
consecutive writes of 32bits. This results in a stack-buffer-overflow
reported by ASAN in the checkasm-sw_scale FATE-test.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-20 23:18:50 +02:00
Martin Storsjö 9c326af1d0 checkasm: swscale: Fix running the hscale test on 32 bit x86
This function doesn't call emms.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-16 08:16:12 +03:00
Martin Storsjö eba1ebd9bf checkasm: sw_rgb: Add a test for interleaveBytes
Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 23:38:01 +03:00
Martin Storsjö 5bdffced0a checkasm: pixblockdsp: Add tests for get_pixels_unaligned and diff_pixels_unaligned
Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 23:37:27 +03:00
Martin Storsjö ed7d73355e checkasm: aarch64: Check for stack overflows
Also fill x8-x17 with garbage before calling the function.

Figure out the number of stack parameters and make sure that the
value on the stack after those is untouched.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 21:22:36 +03:00
Martin Storsjö 6cb2d4d94b checkasm: arm: Check for stack overflows
Figure out the number of stack parameters and make sure that the
value on the stack after those is untouched.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 21:22:34 +03:00
Martin Storsjö 3f266cf49e checkasm: arm: Don't use blx to call checkasm_fail_func
We should just use a normal bl here, and the linker will add the 'x'
bit if necessary.

This fixes calling the checkasm_fail_func on windows, where the
code is built in thumb mode (and the linker doesn't clear the 'x'
bit in the blx instruction).

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 21:22:32 +03:00
Martin Storsjö 89cf9e1fb6 checkasm: arm: Make the indentation consistent with other files
This makes it easier to share code with e.g. the dav1d implementation
of checkasm.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 21:22:27 +03:00
Josh de Kock 5913cd4e6c checkasm: add hscale test
This tests the hscale 8bpp to 14/18bpp functions with different filter
sizes.

Signed-off-by: Josh de Kock <josh@itanimul.li>
2020-05-15 10:29:30 +01:00
Martin Storsjö 3ce1b2bf8d checkasm: add function to check and diff memory
This was ported from dav1d (c950e7101bdf5f7117bfca816984a21e550509f0).

Signed-off-by: Josh de Kock <josh@itanimul.li>
2020-05-15 10:29:30 +01:00
Linjie Fu ddf6ca3a0e tests/checkasm: add overflow test for hevc_add_res
Add overflow test for hevc_add_res when int16_t coeff = -32768.

The result of C is good, while ASM is not.

To verify:
    make fate-checkasm-hevc_add_res
    ffmpeg/tests/checkasm/checkasm --test=hevc_add_res

./checkasm --test=hevc_add_res
checkasm: using random seed 679391863
MMXEXT:
    hevc_add_res_4x4_8_mmxext (hevc_add_res.c:69)
  - hevc_add_res.add_residual [FAILED]
SSE2:
    hevc_add_res_8x8_8_sse2 (hevc_add_res.c:69)
    hevc_add_res_16x16_8_sse2 (hevc_add_res.c:69)
    hevc_add_res_32x32_8_sse2 (hevc_add_res.c:69)
  - hevc_add_res.add_residual [FAILED]
AVX:
    hevc_add_res_8x8_8_avx (hevc_add_res.c:69)
    hevc_add_res_16x16_8_avx (hevc_add_res.c:69)
    hevc_add_res_32x32_8_avx (hevc_add_res.c:69)
  - hevc_add_res.add_residual [FAILED]
AVX2:
    hevc_add_res_32x32_8_avx2 (hevc_add_res.c:69)
  - hevc_add_res.add_residual [FAILED]
checkasm: 8 of 14 tests have failed

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-27 10:57:40 +01:00
Linjie Fu 69b9548dd6 checkasm/hevc_add_res: prepare test data only if the fuction is not tested
check_func will return NULL for functions that have already been tested. If
the func is tested and skipped (which happens several times), there is no
need to prepare data(randomize_buffers and memcpy).

Move relative code in compare_add_res(), prepare data and do check only if
the function is not tested.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-27 10:57:40 +01:00
Martin Storsjö 5181f491ee checkasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon for sum_square
Signed-off-by: Martin Storsjö <martin@martin.st>
2020-02-08 23:00:21 +02:00
Martin Storsjö cbb254cb4c checkasm: Check HAVE_GETSTDHANDLE here as well
This was missed in 63418e374f.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-01-24 22:17:18 +02:00
Martin Storsjö aad0e26f93 checkasm: aacpsdsp: Tolerate extra intermediate precision in stereo_interpolate
The stereo_interpolate functions add h_step to the values h
BUF_SIZE times. Within the stereo_interpolate C functions, the
values h (h0-h3, h00-h13) are declared as local float variables,
but the compiler is free to keep them in a register with extra
precision.

If the accumulation is rounded to 32 bit float precision after
each step, the less significant bits of h_step end up ignored
and the sum can deviate, affecting the end result more than
the currently set EPS.

By clearing the log2(BUF_SIZE) lower bits of h_step, we make sure
that the accumulation shouldn't differ significantly, regardless
of any extra precision in the accmulating register/variable.

This fixes the aacpsdsp checkasm test when built with clang for
mingw/x86_32.

Signed-off-by: Martin Storsjö <martin@martin.st>
2019-12-18 15:15:29 +02:00
Martin Storsjö f58bda642d checkasm: af_afir: Use a dynamic tolerance depending on values
As the values generated by av_bmg_get can be arbitrarily large
(only the stddev is specified), we can't use a fixed tolerance.
Calculate a dynamic tolerance (like in float_dsp from 38f966b222),
based on the individual steps of the calculation.

This fixes running this test with certain seeds, when built with
clang for mingw/x86_32.

Signed-off-by: Martin Storsjö <martin@martin.st>
2019-12-12 23:57:08 +02:00
Martin Storsjö 8f70e261fa checkasm: float_dsp: Scale FLT/DBL_EPSILON sufficiently when comparing
As the values generated by av_bmg_get can be arbitrarily large
(only the stddev is specified), we can't use a fixed tolerance.

This matches what was done for test_vector_dmul_scalar in
38f966b222.

This fixes the float_dsp checkasm test for some seeds, when built
with clang for mingw/x86_32.

Signed-off-by: Martin Storsjö <martin@martin.st>
2019-12-11 22:19:45 +02:00
Ting Fu 9691e2a426 checkasm/vf_eq: add test for vf_eq
Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2019-09-26 08:10:31 +08:00
James Almer 1d86e4b3eb checkasm/opusdsp: declare opus_deemphasis as a function returning a float
Fixes ticket #8175

Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-18 11:42:06 -03:00
Lynne 4ce1e13b54 checkasm: add opusdsp tests 2019-09-11 03:28:22 +01:00
Ruiling Song 8f4963ad25 checkasm/vf_gblur: add test for horiz_slice simd
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2019-06-12 08:54:05 +08:00
James Darnley 76c370af64 checkasm: add test for v210dec 2019-05-02 19:21:37 +02:00
James Almer 0dda0f3bdb Merge commit 'f8abf7d4dfa0504f7f65e4f1fd9d22e01cb371cc'
* commit 'f8abf7d4dfa0504f7f65e4f1fd9d22e01cb371cc':
  checkasm/h264: test 4:2:2 chroma loop filter functions

Merged-by: James Almer <jamrial@gmail.com>
2019-03-14 16:31:41 -03:00
James Almer 06476249cd Merge commit '7e5bde93a1e7641e1622814dafac0be3f413d79b'
* commit '7e5bde93a1e7641e1622814dafac0be3f413d79b':
  build: Rename OBJDIRS variable to OUTDIRS

Merged-by: James Almer <jamrial@gmail.com>
2019-03-10 19:31:13 -03:00
Janne Grunau f8abf7d4df checkasm/h264: test 4:2:2 chroma loop filter functions 2019-02-27 21:57:05 +01:00
James Almer f32d293955 Merge commit 'd7f4f5c4a18a0c9e62635cfa6fe8a9302b413c01'
* commit 'd7f4f5c4a18a0c9e62635cfa6fe8a9302b413c01':
  checkasm/h264: add loop filter tests

Merged-by: James Almer <jamrial@gmail.com>
2019-02-20 15:28:25 -03:00
Diego Biurrun 7e5bde93a1 build: Rename OBJDIRS variable to OUTDIRS
These directories are not just for object files.
2019-02-16 13:09:35 +01:00
Carl Eugen Hoyos 608572ce84 tests/checkasm/checkasm: Do not define an unused function.
Fixes the following warning:
tests/checkasm/checkasm.c:615:12: warning: 'bench_init_ffmpeg' defined but not used
2019-01-31 20:16:17 +01:00
Janne Grunau d7f4f5c4a1 checkasm/h264: add loop filter tests 2019-01-26 12:05:10 +01:00
James Almer f477ee3e89 checkasm/af_afir: relax the max allowed absolute difference
Should fix failures on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-01-13 15:00:20 -03:00
James Almer ba89dc27b5 checkasm: add an af_afir test
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-01-03 10:12:18 -03:00
James Almer 93bf1dcaec checkasm/float_dsp: add test for vector_dmul
Signed-off-by: James Almer <jamrial@gmail.com>
2018-09-14 12:51:55 -03:00
Andrey Semashev d7eb8d8475 lavfi/tests: Fix 16-bit vf_blend test to avoid memory not aligned to 2 bytes
Generic C implementation of vf_blend performs reads and writes of 16-bit
elements, which requires the buffers to be aligned to at least 2-byte
boundary.

Also, the change fixes source buffer overrun caused by src_offset being
added to to test handling of misaligned buffers.

Fixes: #7226

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-30 02:42:10 +02:00
Clément Bœsch 2940af9389 tests/checkasm/nlmeans: fix invalid read/write on ii buffer 2018-05-18 19:12:11 +02:00
Jun Zhao b30575bc98 checkasm/sw_rgb: fix the function declaration warning
fix the warning: "function declaration isn’t a prototype", in C
int foo() and int foo(void) are different functions. int foo()
accepts an arbitrary number of arguments, while int foo(void) accepts 0
arguments.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-05-10 19:28:51 +08:00
Clément Bœsch f679711c1b checkasm: add vf_nlmeans test for ssd_integral_image 2018-05-08 10:28:06 +02:00
Martin Vignali 07a566e7d6 swscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422
and checkasm test
2018-04-22 19:15:32 +02:00
Michael Niedermayer 18d6ff2b42 tests/checkasm/checkasm: Provide verbose failure information on float_near_abs_eps() failures
This will make understanding failures and adjusting EPS easier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-14 15:54:06 +02:00
Martin Vignali 595505083a checkasm/vf_blend : add test for 16 bit version of
grainextract
grainmerge
average
extremity
negation
2018-04-05 21:46:19 +02:00
Josh de Kock cda43940da checkasm/Makefile: add EXTRALIBS-libavformat
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-03-31 23:20:16 +01:00
Martin Vignali a9a7ed4f27 checkasm/swscale : add test for rgb shuffle_bytes func 2018-03-24 20:22:12 +01:00
Yingming Fan e5b4cd4c4a checkasm/hevc_idct : update test bit depth from 8 9 and 10 to 8 10 and 12
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-19 00:56:01 -03:00
Yingming Fan 80798e3857 checkasm/hevc_sao : add hevc_sao for checkasm
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-07 23:53:32 -03:00
Martin Vignali c0919c4985 checkasm/vf_blend : add test for blend_simple_16, phoenix_16 and difference_16 2018-02-24 21:44:23 +01:00
Martin Vignali e3fc36a84c checkasm/vf_blend : add depth param in order to add test for 16 bit version 2018-02-24 21:44:09 +01:00