summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-01-19 16:44:57 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-01-19 16:44:57 +0100
commit8c4d7d30621b7d446b25964a840080fc765a1492 (patch)
tree3856ac1fbee5b267f6a4c369521a009a251f03f8
parentc2c2be0392467cf671765179e645d93af4f741fc (diff)
downloadlibufodecode-8c4d7d30621b7d446b25964a840080fc765a1492.tar.gz
libufodecode-8c4d7d30621b7d446b25964a840080fc765a1492.tar.bz2
libufodecode-8c4d7d30621b7d446b25964a840080fc765a1492.tar.xz
libufodecode-8c4d7d30621b7d446b25964a840080fc765a1492.zip
Adjust offset for windowed frames
-rw-r--r--src/ufodecode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ufodecode.c b/src/ufodecode.c
index b72726b..46af883 100644
--- a/src/ufodecode.c
+++ b/src/ufodecode.c
@@ -229,7 +229,7 @@ ufo_decode_frame_channels_v5 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint3
}
static size_t
-ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint32_t *raw, size_t num_rows)
+ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint32_t *raw, size_t num_rows, uint16_t start_offset)
{
size_t base = 0;
size_t index = 0;
@@ -241,7 +241,7 @@ ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint3
#endif
while (raw[base] != 0xAAAAAAA) {
- const size_t row_number = raw[base] & 0xfff;
+ const size_t row_number = (raw[base] & 0xfff) - start_offset;
const size_t pixel_number = (raw[base + 1] >> 16) & 0xfff;
base += 2;
@@ -472,7 +472,7 @@ ufo_decoder_decode_frame (UfoDecoder *decoder, uint32_t *raw, size_t num_bytes,
break;
case 6:
- advance = ufo_decode_frame_channels_v6 (decoder, pixels, raw + pos, rows_per_frame);
+ advance = ufo_decode_frame_channels_v6 (decoder, pixels, raw + pos, rows_per_frame, meta->cmosis_start_address);
break;
default: