mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge pull request #12799 from alalek:update_build_js
* js: update build script - support emscipten 1.38.12 (wasm is ON by default) - verbose build messages * js: use builtin Math functions * js: disable tracing code completelly
This commit is contained in:
committed by
GitHub
parent
72eccb7694
commit
f185640eda
@@ -37,6 +37,10 @@ namespace trace {
|
||||
//! @cond IGNORED
|
||||
#define CV_TRACE_NS cv::utils::trace
|
||||
|
||||
#if !defined(OPENCV_DISABLE_TRACE) && defined(__EMSCRIPTEN__)
|
||||
#define OPENCV_DISABLE_TRACE 1
|
||||
#endif
|
||||
|
||||
namespace details {
|
||||
|
||||
#ifndef __OPENCV_TRACE
|
||||
|
||||
@@ -1277,10 +1277,17 @@ void pow( InputArray _src, double power, OutputArray _dst )
|
||||
Cv64suf inf64, nan64;
|
||||
float* fbuf = 0;
|
||||
double* dbuf = 0;
|
||||
#ifndef __EMSCRIPTEN__
|
||||
inf32.i = 0x7f800000;
|
||||
nan32.i = 0x7fffffff;
|
||||
inf64.i = CV_BIG_INT(0x7FF0000000000000);
|
||||
nan64.i = CV_BIG_INT(0x7FFFFFFFFFFFFFFF);
|
||||
#else
|
||||
inf32.f = std::numeric_limits<float>::infinity();
|
||||
nan32.f = std::numeric_limits<float>::quiet_NaN();
|
||||
inf64.f = std::numeric_limits<double>::infinity();
|
||||
nan64.f = std::numeric_limits<double>::quiet_NaN();
|
||||
#endif
|
||||
|
||||
if( src.ptr() == dst.ptr() )
|
||||
{
|
||||
|
||||
@@ -27,16 +27,26 @@ float fastAtan2(float y, float x);
|
||||
#ifndef CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
namespace {
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
static inline float atan_f32(float y, float x)
|
||||
{
|
||||
float a = atan2(y, x) * 180.0f / CV_PI;
|
||||
if (a < 0.0f)
|
||||
a += 360.0f;
|
||||
if (a >= 360.0f)
|
||||
a -= 360.0f;
|
||||
return a; // range [0; 360)
|
||||
}
|
||||
#else
|
||||
static const float atan2_p1 = 0.9997878412794807f*(float)(180/CV_PI);
|
||||
static const float atan2_p3 = -0.3258083974640975f*(float)(180/CV_PI);
|
||||
static const float atan2_p5 = 0.1555786518463281f*(float)(180/CV_PI);
|
||||
static const float atan2_p7 = -0.04432655554792128f*(float)(180/CV_PI);
|
||||
|
||||
using namespace cv;
|
||||
|
||||
static inline float atan_f32(float y, float x)
|
||||
{
|
||||
float ax = std::abs(x), ay = std::abs(y);
|
||||
@@ -59,6 +69,7 @@ static inline float atan_f32(float y, float x)
|
||||
a = 360.f - a;
|
||||
return a;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CV_SIMD
|
||||
|
||||
@@ -363,7 +374,7 @@ void sqrt64f(const double* src, double* dst, int len)
|
||||
// Workaround for ICE in MSVS 2015 update 3 (issue #7795)
|
||||
// CV_AVX is not used here, because generated code is faster in non-AVX mode.
|
||||
// (tested with disabled IPP on i5-6300U)
|
||||
#if (defined _MSC_VER && _MSC_VER >= 1900)
|
||||
#if (defined _MSC_VER && _MSC_VER >= 1900) || defined(__EMSCRIPTEN__)
|
||||
void exp32f(const float *src, float *dst, int n)
|
||||
{
|
||||
CV_INSTRUMENT_REGION();
|
||||
|
||||
Reference in New Issue
Block a user