diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-08-08 13:44:43 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-08-08 13:44:43 +0000 |
commit | c5a309afbd60114a4cb8b7f758647f7a6af0a6bd (patch) | |
tree | cb615f1619892e1d059c1767481d3f5f67a47402 /apps/plugins | |
parent | 905cf06e32197f54cd005851e4060f0e8cbff34c (diff) | |
download | rockbox-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/plugins')
-rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 28 |
1 files changed, 17 insertions, 11 deletions
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 | ||
38 | static int image_x; | ||
39 | static int image_y; | ||
40 | static int image_width; | 38 | static int image_width; |
41 | static int image_height; | 39 | static int image_height; |
42 | static int image_chroma_x; | 40 | static int image_chroma_x; |
43 | static int image_chroma_y; | 41 | static int image_chroma_y; |
42 | static int output_x; | ||
43 | static int output_y; | ||
44 | static int output_width; | ||
45 | static 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; |