This commit is contained in:
Victoria Zhislina 2012-02-10 13:47:53 +00:00
parent c07d9d75e8
commit 3e94f77215

View File

@ -563,6 +563,7 @@ cvtScaleAbs_( const T* src, size_t sstep,
for( ; size.height--; src += sstep, dst += dstep ) for( ; size.height--; src += sstep, dst += dstep )
{ {
int x = 0; int x = 0;
#if CV_ENABLE_UNROLLED
for( ; x <= size.width - 4; x += 4 ) for( ; x <= size.width - 4; x += 4 )
{ {
DT t0, t1; DT t0, t1;
@ -573,7 +574,7 @@ cvtScaleAbs_( const T* src, size_t sstep,
t1 = saturate_cast<DT>(std::abs(src[x+3]*scale + shift)); t1 = saturate_cast<DT>(std::abs(src[x+3]*scale + shift));
dst[x+2] = t0; dst[x+3] = t1; dst[x+2] = t0; dst[x+3] = t1;
} }
#endif
for( ; x < size.width; x++ ) for( ; x < size.width; x++ )
dst[x] = saturate_cast<DT>(std::abs(src[x]*scale + shift)); dst[x] = saturate_cast<DT>(std::abs(src[x]*scale + shift));
} }
@ -658,6 +659,7 @@ cvt_( const T* src, size_t sstep,
for( ; size.height--; src += sstep, dst += dstep ) for( ; size.height--; src += sstep, dst += dstep )
{ {
int x = 0; int x = 0;
#if CV_ENABLE_UNROLLED
for( ; x <= size.width - 4; x += 4 ) for( ; x <= size.width - 4; x += 4 )
{ {
DT t0, t1; DT t0, t1;
@ -668,6 +670,7 @@ cvt_( const T* src, size_t sstep,
t1 = saturate_cast<DT>(src[x+3]); t1 = saturate_cast<DT>(src[x+3]);
dst[x+2] = t0; dst[x+3] = t1; dst[x+2] = t0; dst[x+3] = t1;
} }
#endif
for( ; x < size.width; x++ ) for( ; x < size.width; x++ )
dst[x] = saturate_cast<DT>(src[x]); dst[x] = saturate_cast<DT>(src[x]);
} }
@ -700,7 +703,7 @@ cvt_<float, short>( const float* src, size_t sstep,
} }
#endif #endif
for( ; x < size.width; x++ ) for( ; x < size.width; x++ )
dst[x] = (src[x]); dst[x] = saturate_cast<short>(src[x]);
} }
} }