Commit 27602467 authored by biagio montesano's avatar biagio montesano

Added time library

parent 16ed2972
...@@ -71,20 +71,20 @@ inline int match( UINT8*P, UINT8*Q, int codelb ) ...@@ -71,20 +71,20 @@ inline int match( UINT8*P, UINT8*Q, int codelb )
return popcnt( *(UINT32*) P ^ *(UINT32*) Q ); return popcnt( *(UINT32*) P ^ *(UINT32*) Q );
break; break;
case 8: // 64 bit case 8: // 64 bit
return popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ); return (int)popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] );
break; break;
case 16: // 128 bit case 16: // 128 bit
return popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ); return (int)(popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ));
break; break;
case 32: // 256 bit case 32: // 256 bit
return popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ) return (int)(popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] )
+ popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] ); + popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] ));
break; break;
case 64: // 512 bit case 64: // 512 bit
return popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ) return (int)(popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] )
+ popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] ) + popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] )
+ popcntll( ( (UINT64*) P )[4] ^ ( (UINT64*) Q )[4] ) + popcntll( ( (UINT64*) P )[5] ^ ( (UINT64*) Q )[5] ) + popcntll( ( (UINT64*) P )[4] ^ ( (UINT64*) Q )[4] ) + popcntll( ( (UINT64*) P )[5] ^ ( (UINT64*) Q )[5] )
+ popcntll( ( (UINT64*) P )[6] ^ ( (UINT64*) Q )[6] ) + popcntll( ( (UINT64*) P )[7] ^ ( (UINT64*) Q )[7] ); + popcntll( ( (UINT64*) P )[6] ^ ( (UINT64*) Q )[6] ) + popcntll( ( (UINT64*) P )[7] ^ ( (UINT64*) Q )[7] ));
break; break;
default: default:
int output = 0; int output = 0;
...@@ -132,7 +132,7 @@ inline UINT64 next_set_of_n_elements( UINT64 x ) ...@@ -132,7 +132,7 @@ inline UINT64 next_set_of_n_elements( UINT64 x )
{ {
UINT64 smallest, ripple, new_smallest; UINT64 smallest, ripple, new_smallest;
smallest = x & -x; smallest = x & -(signed)x;
ripple = x + smallest; ripple = x + smallest;
new_smallest = x ^ ripple; new_smallest = x ^ ripple;
new_smallest = new_smallest / smallest; new_smallest = new_smallest / smallest;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
//M*/ //M*/
#define _USE_MATH_DEFINES
#include "precomp.hpp" #include "precomp.hpp"
#define NUM_OF_BANDS 9 #define NUM_OF_BANDS 9
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include <cmath> #include <cmath>
#include <algorithm> #include <algorithm>
#include <bitset> #include <bitset>
#include <time.h>
#include "opencv2/line_descriptor.hpp" #include "opencv2/line_descriptor.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment