dnn-layer-mathbinary-test: Fix tests for cases with extra intermediate precision

This fixes tests on 32 bit x86 mingw with clang, which uses x87
fpu by default.

In this setup, while the get_expected function is declared to
return float, the compiler is (especially given the optimization
flags set) free to keep the intermediate values (in this case,
the return value from the inlined function) in higher precision.

This results in the situation where 7.28 (which actually, as
a float, ends up as 7.2800002098), multiplied by 100, is
728.000000 when really forced into a 32 bit float, but 728.000021
when kept with higher intermediate precision.

For the multiplication case, a more suitable epsilon would e.g.
be 2*FLT_EPSILON*fabs(expected_output), but just increase the
current hardcoded threshold for now.

Signed-off-by: Martin Storsjö <martin@martin.st>
1 file changed
tree: 16acb30f62c4783fab537ae3abcc92a6d76b9e5a
  1. .gitattributes
  2. .gitignore
  3. .mailmap
  4. .travis.yml
  5. CONTRIBUTING.md
  6. COPYING.GPLv2
  7. COPYING.GPLv3
  8. COPYING.LGPLv2.1
  9. COPYING.LGPLv3
  10. CREDITS
  11. Changelog
  12. INSTALL.md
  13. LICENSE.md
  14. MAINTAINERS
  15. Makefile
  16. README.md
  17. RELEASE
  18. compat/
  19. configure
  20. doc/
  21. ffbuild/
  22. fftools/
  23. libavcodec/
  24. libavdevice/
  25. libavfilter/
  26. libavformat/
  27. libavresample/
  28. libavutil/
  29. libpostproc/
  30. libswresample/
  31. libswscale/
  32. presets/
  33. tests/
  34. tools/
README.md

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.