diff options
Diffstat (limited to 'apps/recorder/bmp.c')
-rw-r--r-- | apps/recorder/bmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 3e7356a500..e4eb588eb3 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -175,13 +175,15 @@ enum color_order { | |||
175 | }; | 175 | }; |
176 | 176 | ||
177 | struct bmp_args { | 177 | struct bmp_args { |
178 | /* needs to be at least 2byte aligned for faster 16bit reads. | ||
179 | * but aligning to cache should be even faster */ | ||
180 | unsigned char buf[BM_MAX_WIDTH * 4] CACHEALIGN_AT_LEAST_ATTR(2); | ||
178 | int fd; | 181 | int fd; |
179 | short padded_width; | 182 | short padded_width; |
180 | short read_width; | 183 | short read_width; |
181 | short width; | 184 | short width; |
182 | short depth; | 185 | short depth; |
183 | enum color_order order; | 186 | enum color_order order; |
184 | unsigned char buf[BM_MAX_WIDTH * 4]; | ||
185 | struct uint8_rgb *palette; | 187 | struct uint8_rgb *palette; |
186 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ | 188 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
187 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) | 189 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
@@ -276,7 +278,7 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
276 | break; | 278 | break; |
277 | case 15: | 279 | case 15: |
278 | case 16: | 280 | case 16: |
279 | data = ibuf[0] | (ibuf[1]<<8); | 281 | data = letoh16(*(uint16_t*)ibuf); |
280 | component = (data << 3) & 0xf8; | 282 | component = (data << 3) & 0xf8; |
281 | component |= component >> 5; | 283 | component |= component >> 5; |
282 | buf->blue = component; | 284 | buf->blue = component; |