FS#5786 - lcd_yuv_blit for X5

Attached to Project: Rockbox
Opened by Michael Sevakis (MikeS) - Thursday, 10 August 2006, 05:01 GMT
Task Type Patches
Category Video
Status Closed
Assigned To No-one
Operating System iAudio X5
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Implements lcd_yuv_blit in the x5 driver.
Adds nescessary defines for mpegplayer to use it on the x5.
Hard coded to YUV4:2:0 for now.

Helps a few fps and I get the impression things are close to maxed out as far as speed. Tried everything including lookup tables (which didn't really help at all-- even in IRAM). Can blit any rectangle of the image and keeps drawing clipped to the visible display.

The awkward gotos are there to save precious bytes for the leading and trailing pixels drawing.
This task depends upon

Closed by  Rani Hod (RaeNye)
Friday, 11 August 2006, 14:15 GMT
Reason for closing:  Accepted
Additional comments about closing:  10x!
I\'ll gladly commit an ASM-optimized version :)
Comment by Michael Sevakis (MikeS) - Thursday, 10 August 2006, 10:52 GMT
Updated version since the implementation exceeded the requirements of performance functions.
Comment by Michael Sevakis (MikeS) - Thursday, 10 August 2006, 15:54 GMT
I want to do a little more testing here. I have managed to get a couple more 10'ths out of it to get 13.5 fps and I think there may be a little more. If ya just want the function there for now to have it in place, go ahead and commit and I'll add another task with an update.
Comment by Michael Sevakis (MikeS) - Thursday, 10 August 2006, 16:34 GMT
Adding the following (320 bytes):
unsigned char y_ibuf[LCD_WIDTH] IBSS_ATTR;
unsigned char u_ibuf[LCD_WIDTH/2] IBSS_ATTR;
unsigned char v_ibuf[LCD_WIDTH/2] IBSS_ATTR;

and using memcpy to copy to IRAM first brings it up to 14.9 fps.
Perhaps there should be a function to set these buffers by the codec or plugin so they don't stay resident?
lcd_set_yuv_line_buffers(unsigned char * const y, unsigned char * const u, unsigned char * const v);
Comment by Michael Sevakis (MikeS) - Friday, 11 August 2006, 02:53 GMT
Gonna try assembly code. I think it will pay off.