I am introducing my new mad project, a video player using stellaris launchpad and a 320x240 color lcd which I got from seeedstudio. I tried the lcd shield by connecting on an arduino board and loaded some example codes for the arduino and it was working fine. I made a small video player few months ago using atmega32 and a 128x128 color lcd. This time my lcd resolution is larger. I want to make a better video player this time, so I selected a 32bit processor with more speed and ram, and I already have one arm cortex m4 based board, the texas instruments stellaris launchpad board which I bought for 4.9$ (limited time offer).
I checked the arduino library code and written the lcd code for stellaris. To display stuff more faster I connected 8 bits of portb of stellaris to the 8 bit bus of lcd. At first I have some problems and later I found that few bits of portb is shorted with some other bits using zero ohm resistor r9 and r10, so I removed those. This is for msp430 launchpad compatibilit and it started to work. I displayed some patterns on lcd and confirmed it is working.
Later I configured uart in stellaris and streamed the image pixel data from pc to stellais and displayed it on the lcd. I used python image library in pc to convert image to 320x240 resolution and to get the pixel data from it.
Later I configured sd card and used my own old library written for avr. Copied a single image data to sd card from sector zero and read the data and displayed on lcd. Then I wrote a python code in pc which invokes ffmpeg to obtain frames of a particular video. The same script reads all the image frames in the same order write the pixel data to a single file in 16bit format. Now I got a single uncompressed 'video' file!. I copied it to sd card, right now I am not following any filesystem, just writing the data from sector zero of sd card using command 'sudo video_data >/dev/mmcblk0'. (warning: the above command will erase the boot sector and all important components of existing file system in the card).
Now my aim is the display the data in the sd card on lcd as fast as possible. For this I am using multiple sector read command for the sd card and I am not even reading data to any buffer, instead I am directly reading from spi and writing to lcd. To get the best speed I used the spi accessing code inside the spi library function for reading and writing so that I can save few push and pop and thus improve the speed / frame rate of video. Right now without audio I can achieve a speed of around 40 fps.
Later I added audio to the video file, here I need to apply simple math. Using ffpmeg I extracted audio from the video in 8 bit wav format. On adding few video byte to video_file I added few audio bytes in between according to the video/audio bitrate ratio.
Video frame rate = 25
single video frame size = 320x140*2
So total video bytes/second = 320x140*2*25 = 2240000
Now I selected audio byte rate as 22400 bytes/second.
So video/audio = 100
So accordingly I have to mix video and audio in the final uncompressed video file.
I configured pwm in stelaris. Then copied the new generated uncompressed video file to sd card in the same manner I did earlier. Now in the display code I need to send the video bytes to lcd and audio byte to pwm, and it played video with audio and the quality is good.... See the video if U didn't......