summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2008-12-26 07:03:22 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2008-12-26 07:03:22 +0000
commitf7fa7e5ad537415f1f75b3a9c1a58eb925e10d04 (patch)
treeea469e428a756e4f4979be1b6f5a84179a2cc80f /firmware
parent7428c7cc5b8462ed95683f707fe78609ce8208bf (diff)
downloadrockbox-f7fa7e5ad537415f1f75b3a9c1a58eb925e10d04.tar.gz
rockbox-f7fa7e5ad537415f1f75b3a9c1a58eb925e10d04.zip
Latest work on the bmp on-load scaler:
Macros for calculating size needed for bitmap load and scaling, so that these can be compile-time constant when their inputs are. Reduce size of bayer dither by chopping all but first row of dither matrix, and replacing 2D lookup with 1D lookup and small calculation. Move some functions not related to actual bmp file loading out of bmp.c. A smaller brightness() for mono targets, and a higher-quality one for greyscale targets, both replacing the division by 10 with a shift. Port of the linear and area scalers to greyscale targets, this costs some binsize but produces better output even when dithered to 2bpp. Move duplicated row output code from inside vertical scalers to a separate row output function. Move some multiplies out of the line scaler, for a small speedup and code size reduction, as well as a small improvement in accuracy for the upscaling case. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19592 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/lcd-remote.h4
-rw-r--r--firmware/export/lcd.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 3c013d657a..01df5a7eab 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -48,13 +48,17 @@ int remote_type(void);
#if (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) \
|| (LCD_REMOTE_PIXELFORMAT == HORIZONTAL_INTERLEAVED)
typedef unsigned short fb_remote_data;
+#define FB_RDATA_SZ 2
#else
typedef unsigned char fb_remote_data;
+#define FB_RDATA_SZ 1
#endif
#elif LCD_DEPTH <= 16
typedef unsigned short fb_remote_data;
+#define FB_RDATA_SZ 2
#else
typedef unsigned long fb_remote_data;
+#define FB_RDATA_SZ 4
#endif
/* common functions */
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index ea5851e736..e435d174f2 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -75,13 +75,17 @@ struct viewport {
#if (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) \
|| (LCD_PIXELFORMAT == HORIZONTAL_INTERLEAVED)
typedef unsigned short fb_data;
+#define FB_DATA_SZ 2
#else
typedef unsigned char fb_data;
+#define FB_DATA_SZ 1
#endif
#elif LCD_DEPTH <= 16
typedef unsigned short fb_data;
+#define FB_DATA_SZ 2
#else /* LCD_DEPTH > 16 */
typedef unsigned long fb_data;
+#define FB_DATA_SZ 4
#endif /* LCD_DEPTH */
#else /* LCD_CHARCELLS */