提交 183c7535 编写于 作者: A Alexander Alekhin

imgproc: fix trailingZeros for MSVS 2010

上级 442380bf
......@@ -50,10 +50,15 @@
static const CvPoint icvCodeDeltas[8] =
{ CvPoint(1, 0), CvPoint(1, -1), CvPoint(0, -1), CvPoint(-1, -1), CvPoint(-1, 0), CvPoint(-1, 1), CvPoint(0, 1), CvPoint(1, 1) };
#if CV_SSE2
static
inline unsigned int trailingZeros(unsigned int value) {
CV_DbgAssert(value != 0); // undefined for zero input (https://en.wikipedia.org/wiki/Find_first_set)
#if defined(_MSC_VER)
#if (_MSC_VER < 1500)
return _BitScanForward(value);
#if (_MSC_VER < 1700)
unsigned long index = 0;
_BitScanForward(&index, value);
return (unsigned int)index;
#else
return _tzcnt_u32(value);
#endif
......@@ -70,6 +75,7 @@ inline unsigned int trailingZeros(unsigned int value) {
return MultiplyDeBruijnBitPosition[((uint32_t)((value & -value) * 0x077CB531U)) >> 27];
#endif
}
#endif
CV_IMPL void
cvStartReadChainPoints( CvChain * chain, CvChainPtReader * reader )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册