summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-08-08 13:44:43 +0000
committerJens Arnold <amiconn@rockbox.org>2006-08-08 13:44:43 +0000
commitc5a309afbd60114a4cb8b7f758647f7a6af0a6bd (patch)
treecb615f1619892e1d059c1767481d3f5f67a47402 /apps
parent905cf06e32197f54cd005851e4060f0e8cbff34c (diff)
downloadrockbox-c5a309afbd60114a4cb8b7f758647f7a6af0a6bd.tar.gz
rockbox-c5a309afbd60114a4cb8b7f758647f7a6af0a6bd.zip
H300: * Implemented lcd_yuv_blit(). Speeds up video playback by about 7%. No bounds check in lcd_yuv_blit() (by convention), implementations for other targets should be adapted. * Fixed off-by-one bug in lcd_update_rect()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10484 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c4
-rw-r--r--apps/plugin.h6
-rw-r--r--apps/plugins/mpegplayer/video_out_rockbox.c28
3 files changed, 22 insertions, 16 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 4474d0d5ee..bbc5d7d15c 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -463,8 +463,8 @@ static const struct plugin_api rockbox_api = {
463 lcd_remote_bitmap, 463 lcd_remote_bitmap,
464#endif 464#endif
465 465
466#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO) && \ 466#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO \
467 !defined(SIMULATOR) 467 || CONFIG_LCD == LCD_H300) && !defined(SIMULATOR)
468 lcd_yuv_blit, 468 lcd_yuv_blit,
469#endif 469#endif
470 470
diff --git a/apps/plugin.h b/apps/plugin.h
index b764d860c3..f43e0ae08b 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -104,7 +104,7 @@
104#define PLUGIN_MAGIC 0x526F634B /* RocK */ 104#define PLUGIN_MAGIC 0x526F634B /* RocK */
105 105
106/* increase this every time the api struct changes */ 106/* increase this every time the api struct changes */
107#define PLUGIN_API_VERSION 27 107#define PLUGIN_API_VERSION 28
108 108
109/* update this to latest version if a change to the api struct breaks 109/* update this to latest version if a change to the api struct breaks
110 backwards compatibility (and please take the opportunity to sort in any 110 backwards compatibility (and please take the opportunity to sort in any
@@ -539,8 +539,8 @@ struct plugin_api {
539 void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, 539 void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width,
540 int height); 540 int height);
541#endif 541#endif
542#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO) && \ 542#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO \
543 !defined(SIMULATOR) 543 || CONFIG_LCD == LCD_H300) && !defined(SIMULATOR)
544 void (*lcd_yuv_blit)(unsigned char * const src[3], 544 void (*lcd_yuv_blit)(unsigned char * const src[3],
545 int src_x, int src_y, int stride, 545 int src_x, int src_y, int stride,
546 int x, int y, int width, int height); 546 int x, int y, int width, int height);
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c
index 786d9d0e14..a5fdf5efbb 100644
--- a/apps/plugins/mpegplayer/video_out_rockbox.c
+++ b/apps/plugins/mpegplayer/video_out_rockbox.c
@@ -35,12 +35,14 @@ static int starttick;
35#define CSUB_X 2 35#define CSUB_X 2
36#define CSUB_Y 2 36#define CSUB_Y 2
37 37
38static int image_x;
39static int image_y;
40static int image_width; 38static int image_width;
41static int image_height; 39static int image_height;
42static int image_chroma_x; 40static int image_chroma_x;
43static int image_chroma_y; 41static int image_chroma_y;
42static int output_x;
43static int output_y;
44static int output_width;
45static int output_height;
44 46
45#if (LCD_DEPTH == 16) && \ 47#if (LCD_DEPTH == 16) && \
46 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED)) 48 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED))
@@ -197,16 +199,16 @@ static void rockbox_draw_frame (vo_instance_t * instance,
197 (void)id; 199 (void)id;
198 (void)instance; 200 (void)instance;
199 201
200#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO) && \ 202#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO \
201 !defined(SIMULATOR) 203 || CONFIG_LCD == LCD_H300) && !defined(SIMULATOR)
202 rb->lcd_yuv_blit(buf, 204 rb->lcd_yuv_blit(buf,
203 0,0,image_width, 205 0,0,image_width,
204 image_x,image_y,image_width,image_height); 206 output_x,output_y,output_width,output_height);
205#elif (LCD_DEPTH == 16) && \ 207#elif (LCD_DEPTH == 16) && \
206 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED)) 208 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED))
207 yuv_bitmap_part(buf,0,0,image_width, 209 yuv_bitmap_part(buf,0,0,image_width,
208 image_x,image_y,image_width,image_height); 210 output_x,output_y,output_width,output_height);
209 rb->lcd_update_rect(image_x,image_y,image_width,image_height); 211 rb->lcd_update_rect(output_x,output_y,output_width,output_height);
210#endif 212#endif
211 213
212 if (starttick==0) starttick=*rb->current_tick-1; /* Avoid divby0 */ 214 if (starttick==0) starttick=*rb->current_tick-1; /* Avoid divby0 */
@@ -265,15 +267,19 @@ static int rockbox_setup (vo_instance_t * instance, unsigned int width,
265 image_chroma_y=image_height/chroma_height; 267 image_chroma_y=image_height/chroma_height;
266 268
267 if (image_width >= LCD_WIDTH) { 269 if (image_width >= LCD_WIDTH) {
268 image_x = 0; 270 output_width = LCD_WIDTH;
271 output_x = 0;
269 } else { 272 } else {
270 image_x = (LCD_WIDTH-image_width)/2; 273 output_width = image_width;
274 output_x = (LCD_WIDTH-image_width)/2;
271 } 275 }
272 276
273 if (image_height >= LCD_HEIGHT) { 277 if (image_height >= LCD_HEIGHT) {
274 image_y = 0; 278 output_height = LCD_HEIGHT;
279 output_y = 0;
275 } else { 280 } else {
276 image_y = (LCD_HEIGHT-image_height)/2; 281 output_height = image_height;
282 output_y = (LCD_HEIGHT-image_height)/2;
277 } 283 }
278 284
279 return 0; 285 return 0;