Merge branch 'master' of steffen.gulpe.de:steffen/SimpleSkyCam

merge
test16bit
Steffen Pohle 4 years ago
commit 2b394e70a4

@ -1,5 +1,7 @@
#include <stdint.h>
#include <mmintrin.h>
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
#include "config.h" #include "config.h"
@ -240,6 +242,15 @@ void Detect::InputDetect(int *posx, int *posy) {
#endif #endif
} }
inline float calc_vector(uint8_t a1, uint8_t a2, uint8_t b1, uint8_t b2, uint8_t c1, uint8_t c2, uint8_t d1, uint8_t d2) {
return a1 * a2 + b1 * b2 + c1 * c2 + d1 * d2;
// __m64 m1 = _mm_set_pi16 (a1, b1, c1, d1);
// __m64 m2 = _mm_set_pi16 (a2, b2, c2, d2);
// __m64 m3 = _mm_madd_pi16 (m1, m2);
// _mm_empty ();
// uint32_t *data = (uint32_t *) &m3;
// return data[0] + data[1];
}
#define OBJSIZE 50 #define OBJSIZE 50
#define MAXSHIFT 20 #define MAXSHIFT 20
@ -304,7 +315,12 @@ void Detect::InputDetectCrossC(int *posx, int *posy) {
for (x = 0; x < OBJSIZE; x++, oldi += 3, ini += 3, oldx++, inx++) { for (x = 0; x < OBJSIZE; x++, oldi += 3, ini += 3, oldx++, inx++) {
if (oldx >= 0 && oldy >= 0 && oldx < oldFrame.w && oldy <= oldFrame.h && if (oldx >= 0 && oldy >= 0 && oldx < oldFrame.w && oldy <= oldFrame.h &&
inx >= 0 && inx < inFrame.w && iny >= 0 && iny < inFrame.h) { inx >= 0 && inx < inFrame.w && iny >= 0 && iny < inFrame.h) {
f += (float)(pxo[oldi+0])*(float)(pxi[ini+0]); //f += (float)(pxo[oldi+0])*(float)(pxi[ini+0]);
f += calc_vector( pxo[oldi+0], pxi[ini+0],
pxo[oldi+3], pxi[ini+3],
pxo[oldi+6], pxi[ini+6],
pxo[oldi+9], pxi[ini+9]);
x+=3; oldi += 9; ini += 9; oldx+=3; inx+=3;
} }
} }
} }

Loading…
Cancel
Save