summaryrefslogtreecommitdiffstats
path: root/src/ufodecode.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-07-20 14:27:33 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-07-20 14:27:33 +0200
commit59bc0f747a042e971a3de1224d223d944962cde2 (patch)
treef6a541901eca7743ae876456215be07ec859bfbe /src/ufodecode.c
parent37a1ff94dd3ba381e8f7792247d6bed3ad67d54c (diff)
downloadufodecode-59bc0f747a042e971a3de1224d223d944962cde2.tar.gz
ufodecode-59bc0f747a042e971a3de1224d223d944962cde2.tar.bz2
ufodecode-59bc0f747a042e971a3de1224d223d944962cde2.tar.xz
ufodecode-59bc0f747a042e971a3de1224d223d944962cde2.zip
Fix 12 bit decoding
Wrong masking led to bits capped at 10 bits.
Diffstat (limited to 'src/ufodecode.c')
-rw-r--r--src/ufodecode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ufodecode.c b/src/ufodecode.c
index 7956016..43085d7 100644
--- a/src/ufodecode.c
+++ b/src/ufodecode.c
@@ -410,10 +410,10 @@ ufo_decode_frame_channels_v5(UfoDecoder *decoder,
base += 2;
if ((header->magic != 0xe0) && (header->magic != 0xc0)) {
- pixel_buffer[index + (0+off)*IPECAMERA_PIXELS_PER_CHANNEL] = 0x3ff & (raw[base+5] >> 12);
- pixel_buffer[index + (4+off)*IPECAMERA_PIXELS_PER_CHANNEL] = 0x3ff & (raw[base+4] >> 4);
+ pixel_buffer[index + (0+off)*IPECAMERA_PIXELS_PER_CHANNEL] = 0xfff & (raw[base+5] >> 12);
+ pixel_buffer[index + (4+off)*IPECAMERA_PIXELS_PER_CHANNEL] = 0xfff & (raw[base+4] >> 4);
pixel_buffer[index + (8+off)*IPECAMERA_PIXELS_PER_CHANNEL] = ((0xf & raw[base+1]) << 8) | (raw[base+2] >> 24);
- pixel_buffer[index + (12+off)*IPECAMERA_PIXELS_PER_CHANNEL] = 0x3ff & (raw[base+1] >> 16);
+ pixel_buffer[index + (12+off)*IPECAMERA_PIXELS_PER_CHANNEL] = 0xfff & (raw[base+1] >> 16);
}
else {
off++;
@@ -425,7 +425,7 @@ ufo_decode_frame_channels_v5(UfoDecoder *decoder,
base += 6;
}
}
- else if (header->pixel_size) {
+ else if (header->pixel_size == 10) {
while (raw[base] != 0xAAAAAAA) {
header = (payload_header_v5 *) &raw[base];
index = header->row_number * IPECAMERA_WIDTH + header->pixel_number;