fixed IPP related warnings

This commit is contained in:
Ilya Lavrenov 2014-05-07 17:33:34 +04:00
parent b1a28a52fa
commit 19a2495067
7 changed files with 103 additions and 91 deletions

View File

@ -97,6 +97,13 @@ CV_INLINE IppiSize ippiSize(int width, int height)
IppiSize size = { width, height }; IppiSize size = { width, height };
return size; return size;
} }
CV_INLINE IppiSize ippiSize(const cv::Size & _size)
{
IppiSize size = { _size.width, _size.height };
return size;
}
#endif #endif
#ifndef IPPI_CALL #ifndef IPPI_CALL

View File

@ -533,7 +533,7 @@ static void add8u( const uchar* src1, size_t step1,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAdd_8u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz, 0), ippiAdd_8u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz), 0),
(vBinOp8<uchar, OpAdd<uchar>, IF_SIMD(_VAdd8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpAdd<uchar>, IF_SIMD(_VAdd8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -549,7 +549,7 @@ static void add16u( const ushort* src1, size_t step1,
ushort* dst, size_t step, Size sz, void* ) ushort* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAdd_16u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz, 0), ippiAdd_16u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz), 0),
(vBinOp16<ushort, OpAdd<ushort>, IF_SIMD(_VAdd16u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp16<ushort, OpAdd<ushort>, IF_SIMD(_VAdd16u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -558,7 +558,7 @@ static void add16s( const short* src1, size_t step1,
short* dst, size_t step, Size sz, void* ) short* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAdd_16s_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz, 0), ippiAdd_16s_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz), 0),
(vBinOp16<short, OpAdd<short>, IF_SIMD(_VAdd16s)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp16<short, OpAdd<short>, IF_SIMD(_VAdd16s)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -574,7 +574,7 @@ static void add32f( const float* src1, size_t step1,
float* dst, size_t step, Size sz, void* ) float* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAdd_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiAdd_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp32f<OpAdd<float>, IF_SIMD(_VAdd32f)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp32f<OpAdd<float>, IF_SIMD(_VAdd32f)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -590,7 +590,7 @@ static void sub8u( const uchar* src1, size_t step1,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiSub_8u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz, 0), ippiSub_8u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz), 0),
(vBinOp8<uchar, OpSub<uchar>, IF_SIMD(_VSub8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpSub<uchar>, IF_SIMD(_VSub8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -606,7 +606,7 @@ static void sub16u( const ushort* src1, size_t step1,
ushort* dst, size_t step, Size sz, void* ) ushort* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiSub_16u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz, 0), ippiSub_16u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz), 0),
(vBinOp16<ushort, OpSub<ushort>, IF_SIMD(_VSub16u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp16<ushort, OpSub<ushort>, IF_SIMD(_VSub16u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -615,7 +615,7 @@ static void sub16s( const short* src1, size_t step1,
short* dst, size_t step, Size sz, void* ) short* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiSub_16s_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz, 0), ippiSub_16s_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz), 0),
(vBinOp16<short, OpSub<short>, IF_SIMD(_VSub16s)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp16<short, OpSub<short>, IF_SIMD(_VSub16s)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -631,7 +631,7 @@ static void sub32f( const float* src1, size_t step1,
float* dst, size_t step, Size sz, void* ) float* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiSub_32f_C1R(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz), ippiSub_32f_C1R(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz)),
(vBinOp32f<OpSub<float>, IF_SIMD(_VSub32f)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp32f<OpSub<float>, IF_SIMD(_VSub32f)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -668,7 +668,7 @@ static void max8u( const uchar* src1, size_t step1,
#endif #endif
// IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); // IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
// ippiMaxEvery_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (IppiSize&)sz), // ippiMaxEvery_8u_C1R(src1, (int)step1, src2, (int)step2, dst, ippiSize(sz)),
// (vBinOp8<uchar, OpMax<uchar>, IF_SIMD(_VMax8u)>(src1, step1, src2, step2, dst, step, sz))); // (vBinOp8<uchar, OpMax<uchar>, IF_SIMD(_VMax8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -702,7 +702,7 @@ static void max16u( const ushort* src1, size_t step1,
#endif #endif
// IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); // IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
// ippiMaxEvery_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (IppiSize&)sz), // ippiMaxEvery_16u_C1R(src1, (int)step1, src2, (int)step2, dst, ippiSize(sz)),
// (vBinOp16<ushort, OpMax<ushort>, IF_SIMD(_VMax16u)>(src1, step1, src2, step2, dst, step, sz))); // (vBinOp16<ushort, OpMax<ushort>, IF_SIMD(_VMax16u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -742,7 +742,7 @@ static void max32f( const float* src1, size_t step1,
vBinOp32f<OpMax<float>, IF_SIMD(_VMax32f)>(src1, step1, src2, step2, dst, step, sz); vBinOp32f<OpMax<float>, IF_SIMD(_VMax32f)>(src1, step1, src2, step2, dst, step, sz);
#endif #endif
// IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); // IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
// ippiMaxEvery_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (IppiSize&)sz), // ippiMaxEvery_32f_C1R(src1, (int)step1, src2, (int)step2, dst, ippiSize(sz)),
// (vBinOp32f<OpMax<float>, IF_SIMD(_VMax32f)>(src1, step1, src2, step2, dst, step, sz))); // (vBinOp32f<OpMax<float>, IF_SIMD(_VMax32f)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -776,7 +776,7 @@ static void min8u( const uchar* src1, size_t step1,
#endif #endif
// IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); // IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
// ippiMinEvery_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (IppiSize&)sz), // ippiMinEvery_8u_C1R(src1, (int)step1, src2, (int)step2, dst, ippiSize(sz)),
// (vBinOp8<uchar, OpMin<uchar>, IF_SIMD(_VMin8u)>(src1, step1, src2, step2, dst, step, sz))); // (vBinOp8<uchar, OpMin<uchar>, IF_SIMD(_VMin8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -810,7 +810,7 @@ static void min16u( const ushort* src1, size_t step1,
#endif #endif
// IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); // IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
// ippiMinEvery_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (IppiSize&)sz), // ippiMinEvery_16u_C1R(src1, (int)step1, src2, (int)step2, dst, ippiSize(sz)),
// (vBinOp16<ushort, OpMin<ushort>, IF_SIMD(_VMin16u)>(src1, step1, src2, step2, dst, step, sz))); // (vBinOp16<ushort, OpMin<ushort>, IF_SIMD(_VMin16u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -850,7 +850,7 @@ static void min32f( const float* src1, size_t step1,
vBinOp32f<OpMin<float>, IF_SIMD(_VMin32f)>(src1, step1, src2, step2, dst, step, sz); vBinOp32f<OpMin<float>, IF_SIMD(_VMin32f)>(src1, step1, src2, step2, dst, step, sz);
#endif #endif
// IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); // IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
// ippiMinEvery_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (IppiSize&)sz), // ippiMinEvery_32f_C1R(src1, (int)step1, src2, (int)step2, dst, ippiSize(sz)),
// (vBinOp32f<OpMin<float>, IF_SIMD(_VMin32f)>(src1, step1, src2, step2, dst, step, sz))); // (vBinOp32f<OpMin<float>, IF_SIMD(_VMin32f)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -866,7 +866,7 @@ static void absdiff8u( const uchar* src1, size_t step1,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAbsDiff_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiAbsDiff_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp8<uchar, OpAbsDiff<uchar>, IF_SIMD(_VAbsDiff8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpAbsDiff<uchar>, IF_SIMD(_VAbsDiff8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -882,7 +882,7 @@ static void absdiff16u( const ushort* src1, size_t step1,
ushort* dst, size_t step, Size sz, void* ) ushort* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAbsDiff_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiAbsDiff_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp16<ushort, OpAbsDiff<ushort>, IF_SIMD(_VAbsDiff16u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp16<ushort, OpAbsDiff<ushort>, IF_SIMD(_VAbsDiff16u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -905,7 +905,7 @@ static void absdiff32f( const float* src1, size_t step1,
float* dst, size_t step, Size sz, void* ) float* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAbsDiff_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiAbsDiff_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp32f<OpAbsDiff<float>, IF_SIMD(_VAbsDiff32f)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp32f<OpAbsDiff<float>, IF_SIMD(_VAbsDiff32f)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -922,7 +922,7 @@ static void and8u( const uchar* src1, size_t step1,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiAnd_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiAnd_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp8<uchar, OpAnd<uchar>, IF_SIMD(_VAnd8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpAnd<uchar>, IF_SIMD(_VAnd8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -931,7 +931,7 @@ static void or8u( const uchar* src1, size_t step1,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiOr_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiOr_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp8<uchar, OpOr<uchar>, IF_SIMD(_VOr8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpOr<uchar>, IF_SIMD(_VOr8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -940,7 +940,7 @@ static void xor8u( const uchar* src1, size_t step1,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step);
ippiXor_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz), ippiXor_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz)),
(vBinOp8<uchar, OpXor<uchar>, IF_SIMD(_VXor8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpXor<uchar>, IF_SIMD(_VXor8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -948,8 +948,8 @@ static void not8u( const uchar* src1, size_t step1,
const uchar* src2, size_t step2, const uchar* src2, size_t step2,
uchar* dst, size_t step, Size sz, void* ) uchar* dst, size_t step, Size sz, void* )
{ {
IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); (void *)src2; IF_IPP(fixSteps(sz, sizeof(dst[0]), step1, step2, step); (void)src2;
ippiNot_8u_C1R(src1, (int)step1, dst, (int)step, (IppiSize&)sz), ippiNot_8u_C1R(src1, (int)step1, dst, (int)step, ippiSize(sz)),
(vBinOp8<uchar, OpNot<uchar>, IF_SIMD(_VNot8u)>(src1, step1, src2, step2, dst, step, sz))); (vBinOp8<uchar, OpNot<uchar>, IF_SIMD(_VNot8u)>(src1, step1, src2, step2, dst, step, sz)));
} }
@ -2184,7 +2184,7 @@ static void cmp8u(const uchar* src1, size_t step1, const uchar* src2, size_t ste
if( op >= 0 ) if( op >= 0 )
{ {
fixSteps(size, sizeof(dst[0]), step1, step2, step); fixSteps(size, sizeof(dst[0]), step1, step2, step);
if( ippiCompare_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op) >= 0 ) if( ippiCompare_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op) >= 0 )
return; return;
} }
#endif #endif
@ -2267,7 +2267,7 @@ static void cmp16u(const ushort* src1, size_t step1, const ushort* src2, size_t
if( op >= 0 ) if( op >= 0 )
{ {
fixSteps(size, sizeof(dst[0]), step1, step2, step); fixSteps(size, sizeof(dst[0]), step1, step2, step);
if( ippiCompare_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op) >= 0 ) if( ippiCompare_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op) >= 0 )
return; return;
} }
#endif #endif
@ -2282,7 +2282,7 @@ static void cmp16s(const short* src1, size_t step1, const short* src2, size_t st
if( op > 0 ) if( op > 0 )
{ {
fixSteps(size, sizeof(dst[0]), step1, step2, step); fixSteps(size, sizeof(dst[0]), step1, step2, step);
if( ippiCompare_16s_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op) >= 0 ) if( ippiCompare_16s_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op) >= 0 )
return; return;
} }
#endif #endif
@ -2388,7 +2388,7 @@ static void cmp32f(const float* src1, size_t step1, const float* src2, size_t st
if( op >= 0 ) if( op >= 0 )
{ {
fixSteps(size, sizeof(dst[0]), step1, step2, step); fixSteps(size, sizeof(dst[0]), step1, step2, step);
if( ippiCompare_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op) >= 0 ) if( ippiCompare_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op) >= 0 )
return; return;
} }
#endif #endif

View File

@ -728,10 +728,10 @@ void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, Input
dcn_stddev = (int)stddev.total(); dcn_stddev = (int)stddev.total();
pstddev = (Ipp64f *)stddev.data; pstddev = (Ipp64f *)stddev.data;
} }
for( int k = cn; k < dcn_mean; k++ ) for( int c = cn; c < dcn_mean; c++ )
pmean[k] = 0; pmean[c] = 0;
for( int k = cn; k < dcn_stddev; k++ ) for( int c = cn; c < dcn_stddev; c++ )
pstddev[k] = 0; pstddev[c] = 0;
IppiSize sz = { cols, rows }; IppiSize sz = { cols, rows };
int type = src.type(); int type = src.type();
if( !mask.empty() ) if( !mask.empty() )

View File

@ -301,6 +301,7 @@ static ippiReorderFunc ippiSwapChannelsC4RTab[] =
0, (ippiReorderFunc)ippiSwapChannels_32f_AC4R, 0, 0 0, (ippiReorderFunc)ippiSwapChannels_32f_AC4R, 0, 0
}; };
#if 0
static ippiColor2GrayFunc ippiColor2GrayC3Tab[] = static ippiColor2GrayFunc ippiColor2GrayC3Tab[] =
{ {
(ippiColor2GrayFunc)ippiColorToGray_8u_C3C1R, 0, (ippiColor2GrayFunc)ippiColorToGray_16u_C3C1R, 0, (ippiColor2GrayFunc)ippiColorToGray_8u_C3C1R, 0, (ippiColor2GrayFunc)ippiColorToGray_16u_C3C1R, 0,
@ -312,6 +313,7 @@ static ippiColor2GrayFunc ippiColor2GrayC4Tab[] =
(ippiColor2GrayFunc)ippiColorToGray_8u_AC4C1R, 0, (ippiColor2GrayFunc)ippiColorToGray_16u_AC4C1R, 0, (ippiColor2GrayFunc)ippiColorToGray_8u_AC4C1R, 0, (ippiColor2GrayFunc)ippiColorToGray_16u_AC4C1R, 0,
0, (ippiColor2GrayFunc)ippiColorToGray_32f_AC4C1R, 0, 0 0, (ippiColor2GrayFunc)ippiColorToGray_32f_AC4C1R, 0, 0
}; };
#endif
static ippiGeneralFunc ippiRGB2GrayC3Tab[] = static ippiGeneralFunc ippiRGB2GrayC3Tab[] =
{ {

View File

@ -72,7 +72,7 @@ namespace cv
return func(values, dataPointer, step, size) >= 0; return func(values, dataPointer, step, size) >= 0;
} }
bool IPPSet(const cv::Scalar &value, void *dataPointer, int step, IppiSize &size, int channels, int depth) static bool IPPSet(const cv::Scalar &value, void *dataPointer, int step, IppiSize &size, int channels, int depth)
{ {
if( channels == 1 ) if( channels == 1 )
{ {
@ -3404,31 +3404,33 @@ class IPPwarpAffineInvoker :
public ParallelLoopBody public ParallelLoopBody
{ {
public: public:
IPPwarpAffineInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[2][3], int &_interpolation, int &_borderType, const Scalar &_borderValue, ippiWarpAffineBackFunc _func, bool *_ok) : IPPwarpAffineInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[2][3], int &_interpolation, int &_borderType,
ParallelLoopBody(), src(_src), dst(_dst), mode(_interpolation), coeffs(_coeffs), borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok) const Scalar &_borderValue, ippiWarpAffineBackFunc _func, bool *_ok) :
{ ParallelLoopBody(), src(_src), dst(_dst), coeffs(_coeffs), mode(_interpolation), borderType(_borderType),
*ok = true; borderValue(_borderValue), func(_func), ok(_ok)
} {
*ok = true;
}
virtual void operator() (const Range& range) const virtual void operator() (const Range& range) const
{ {
IppiSize srcsize = { src.cols, src.rows }; IppiSize srcsize = { src.cols, src.rows };
IppiRect srcroi = { 0, 0, src.cols, src.rows }; IppiRect srcroi = { 0, 0, src.cols, src.rows };
IppiRect dstroi = { 0, range.start, dst.cols, range.end - range.start }; IppiRect dstroi = { 0, range.start, dst.cols, range.end - range.start };
int cnn = src.channels(); int cnn = src.channels();
if( borderType == BORDER_CONSTANT ) if( borderType == BORDER_CONSTANT )
{ {
IppiSize setSize = { dst.cols, range.end - range.start }; IppiSize setSize = { dst.cols, range.end - range.start };
void *dataPointer = dst.data + dst.step[0] * range.start; void *dataPointer = dst.data + dst.step[0] * range.start;
if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) ) if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) )
{ {
*ok = false; *ok = false;
return; return;
} }
} }
if( func( src.data, srcsize, (int)src.step[0], srcroi, dst.data, (int)dst.step[0], dstroi, coeffs, mode ) < 0) ////Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr if( func( src.data, srcsize, (int)src.step[0], srcroi, dst.data, (int)dst.step[0], dstroi, coeffs, mode ) < 0) ////Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr
*ok = false; *ok = false;
} }
private: private:
Mat &src; Mat &src;
Mat &dst; Mat &dst;
@ -3552,7 +3554,6 @@ class warpPerspectiveInvoker :
public ParallelLoopBody public ParallelLoopBody
{ {
public: public:
warpPerspectiveInvoker(const Mat &_src, Mat &_dst, double *_M, int _interpolation, warpPerspectiveInvoker(const Mat &_src, Mat &_dst, double *_M, int _interpolation,
int _borderType, const Scalar &_borderValue) : int _borderType, const Scalar &_borderValue) :
ParallelLoopBody(), src(_src), dst(_dst), M(_M), interpolation(_interpolation), ParallelLoopBody(), src(_src), dst(_dst), M(_M), interpolation(_interpolation),
@ -3644,32 +3645,34 @@ class IPPwarpPerspectiveInvoker :
public ParallelLoopBody public ParallelLoopBody
{ {
public: public:
IPPwarpPerspectiveInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[3][3], int &_interpolation, int &_borderType, const Scalar &_borderValue, ippiWarpPerspectiveBackFunc _func, bool *_ok) : IPPwarpPerspectiveInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[3][3], int &_interpolation,
ParallelLoopBody(), src(_src), dst(_dst), mode(_interpolation), coeffs(_coeffs), borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok) int &_borderType, const Scalar &_borderValue, ippiWarpPerspectiveBackFunc _func, bool *_ok) :
{ ParallelLoopBody(), src(_src), dst(_dst), coeffs(_coeffs), mode(_interpolation),
*ok = true; borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok)
} {
*ok = true;
}
virtual void operator() (const Range& range) const virtual void operator() (const Range& range) const
{ {
IppiSize srcsize = {src.cols, src.rows}; IppiSize srcsize = {src.cols, src.rows};
IppiRect srcroi = {0, 0, src.cols, src.rows}; IppiRect srcroi = {0, 0, src.cols, src.rows};
IppiRect dstroi = {0, range.start, dst.cols, range.end - range.start}; IppiRect dstroi = {0, range.start, dst.cols, range.end - range.start};
int cnn = src.channels(); int cnn = src.channels();
if( borderType == BORDER_CONSTANT ) if( borderType == BORDER_CONSTANT )
{ {
IppiSize setSize = {dst.cols, range.end - range.start}; IppiSize setSize = {dst.cols, range.end - range.start};
void *dataPointer = dst.data + dst.step[0] * range.start; void *dataPointer = dst.data + dst.step[0] * range.start;
if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) ) if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) )
{ {
*ok = false; *ok = false;
return; return;
} }
} }
if( func(src.data, srcsize, (int)src.step[0], srcroi, dst.data, (int)dst.step[0], dstroi, coeffs, mode) < 0) if( func(src.data, srcsize, (int)src.step[0], srcroi, dst.data, (int)dst.step[0], dstroi, coeffs, mode) < 0)
*ok = false; *ok = false;
} }
private: private:
Mat &src; Mat &src;
Mat &dst; Mat &dst;

View File

@ -1317,9 +1317,9 @@ public:
if( cascade->hid_cascade->ipp_stages ) if( cascade->hid_cascade->ipp_stages )
{ {
IppiRect iequRect = {equRect.x, equRect.y, equRect.width, equRect.height}; IppiRect iequRect = {equRect.x, equRect.y, equRect.width, equRect.height};
ippiRectStdDev_32f_C1R(sum1.ptr<float>(y1), sum1.step, ippiRectStdDev_32f_C1R(sum1.ptr<float>(y1), (int)sum1.step,
sqsum1.ptr<double>(y1), sqsum1.step, sqsum1.ptr<double>(y1), (int)sqsum1.step,
norm1->ptr<float>(y1), norm1->step, norm1->ptr<float>(y1), (int)norm1->step,
ippiSize(ssz.width, ssz.height), iequRect ); ippiSize(ssz.width, ssz.height), iequRect );
int positive = (ssz.width/ystep)*((ssz.height + ystep-1)/ystep); int positive = (ssz.width/ystep)*((ssz.height + ystep-1)/ystep);
@ -1340,9 +1340,9 @@ public:
for( int j = 0; j < cascade->count; j++ ) for( int j = 0; j < cascade->count; j++ )
{ {
if( ippiApplyHaarClassifier_32f_C1R( if( ippiApplyHaarClassifier_32f_C1R(
sum1.ptr<float>(y1), sum1.step, sum1.ptr<float>(y1), (int)sum1.step,
norm1->ptr<float>(y1), norm1->step, norm1->ptr<float>(y1), (int)norm1->step,
mask1->ptr<uchar>(y1), mask1->step, mask1->ptr<uchar>(y1), (int)mask1->step,
ippiSize(ssz.width, ssz.height), &positive, ippiSize(ssz.width, ssz.height), &positive,
cascade->hid_cascade->stage_classifier[j].threshold, cascade->hid_cascade->stage_classifier[j].threshold,
(IppiHaarClassifier_32f*)cascade->hid_cascade->ipp_stages[j]) < 0 ) (IppiHaarClassifier_32f*)cascade->hid_cascade->ipp_stages[j]) < 0 )

View File

@ -747,7 +747,7 @@ void HOGCache::normalizeBlockHistogram(float* _hist) const
float sum = 0; float sum = 0;
#ifdef HAVE_IPP #ifdef HAVE_IPP
ippsDotProd_32f(hist,hist,sz,&sum); ippsDotProd_32f(hist,hist,(int)sz,&sum);
#else #else
for( i = 0; i < sz; i++ ) for( i = 0; i < sz; i++ )
sum += hist[i]*hist[i]; sum += hist[i]*hist[i];
@ -755,9 +755,9 @@ void HOGCache::normalizeBlockHistogram(float* _hist) const
float scale = 1.f/(std::sqrt(sum)+sz*0.1f), thresh = (float)descriptor->L2HysThreshold; float scale = 1.f/(std::sqrt(sum)+sz*0.1f), thresh = (float)descriptor->L2HysThreshold;
#ifdef HAVE_IPP #ifdef HAVE_IPP
ippsMulC_32f_I(scale,hist,sz); ippsMulC_32f_I(scale,hist,(int)sz);
ippsThreshold_32f_I( hist, sz, thresh, ippCmpGreater ); ippsThreshold_32f_I( hist, (int)sz, thresh, ippCmpGreater );
ippsDotProd_32f(hist,hist,sz,&sum); ippsDotProd_32f(hist,hist,(int)sz,&sum);
#else #else
for( i = 0, sum = 0; i < sz; i++ ) for( i = 0, sum = 0; i < sz; i++ )
{ {
@ -768,7 +768,7 @@ void HOGCache::normalizeBlockHistogram(float* _hist) const
scale = 1.f/(std::sqrt(sum)+1e-3f); scale = 1.f/(std::sqrt(sum)+1e-3f);
#ifdef HAVE_IPP #ifdef HAVE_IPP
ippsMulC_32f_I(scale,hist,sz); ippsMulC_32f_I(scale,hist,(int)sz);
#else #else
for( i = 0; i < sz; i++ ) for( i = 0; i < sz; i++ )
hist[i] *= scale; hist[i] *= scale;