summaryrefslogtreecommitdiffstats
path: root/src/ufodecode.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-06-23 17:02:43 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-06-23 17:02:43 +0200
commit6353a9019c2999541b812a3c1ddba5b7b410a837 (patch)
tree6c1aa0e704843181f531c467c2ca70c9b67408d5 /src/ufodecode.c
parented37d87df3d5ccc82a4595155638aa077f8237a3 (diff)
downloadufodecode-6353a9019c2999541b812a3c1ddba5b7b410a837.tar.gz
ufodecode-6353a9019c2999541b812a3c1ddba5b7b410a837.tar.bz2
ufodecode-6353a9019c2999541b812a3c1ddba5b7b410a837.tar.xz
ufodecode-6353a9019c2999541b812a3c1ddba5b7b410a837.zip
Fix wrong results due to endianess
Diffstat (limited to 'src/ufodecode.c')
-rw-r--r--src/ufodecode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ufodecode.c b/src/ufodecode.c
index d842c36..cfd9846 100644
--- a/src/ufodecode.c
+++ b/src/ufodecode.c
@@ -253,8 +253,8 @@ ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint3
const __m64 src3 = _mm_set_pi32 (raw[base + 2], raw[base + 5]);
#define store(i) \
- pixel_buffer[index + i * space] = ((uint32_t *) &mm_r)[0]; \
- pixel_buffer[index + IPECAMERA_WIDTH_20MP + i * space] = ((uint32_t *) &mm_r)[1];
+ pixel_buffer[index + i * space] = ((uint32_t *) &mm_r)[1]; \
+ pixel_buffer[index + IPECAMERA_WIDTH_20MP + i * space] = ((uint32_t *) &mm_r)[0];
mm_r = _mm_srli_pi32 (src1, 20);
store(0);
@@ -279,6 +279,8 @@ ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint3
mm_r = _mm_and_si64 (src3, mask_fff);
store(7);
+
+#undef store
#else
pixel_buffer[index + 0 * space] = (raw[base] >> 20);
pixel_buffer[index + 1 * space] = (raw[base] >> 8) & 0xfff;