View previous topic :: View next topic |
Author |
Message |
Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
Reading an Animated GIF File with PIC18.? |
Posted: Tue Dec 05, 2006 5:47 pm |
|
|
Hello everyone;
Has anyone tried to read an animated GIF file say from a FAT formated MMC Card and then display it to a monochrome LCD.
After some reading I have found the the GIF file format uses LZW compression.
The size of each animated GIF frame I was planning to read would be 48x48 pixels.
What I would need to do is to read the file, then find the first GIF frame, decode it to an uncompressed format, and then update the LCD. continue to do this for all GIF frames.
That was easy to say.
The question is not reading the GIF file from the MMC. Its more that I have to decode the GIF file to uncompressed data.
The animated GIF files would be created on with a PC Application in 2 color mode. So the LCD pixels will be on or off
Do you think that a 40MHz PIC18 would have enough resources to do this function at a resonable rate of updating the LCD.
Thanks in advance;
Jerry |
|
|
Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
Re: Reading an Animated GIF File with PIC18.? |
Posted: Thu Dec 07, 2006 8:32 am |
|
|
Thanks for looking.
Looks like it is not possible. |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Thu Dec 07, 2006 10:13 am |
|
|
LZW is a lossy compression which with 48x48 images probably doesn't do a whole lot compression wise but brings baggage as far as translation goes.
Even if GIF compresses a whole lot there will be plenty of space on an MMC for a non lossy encoding say BMP or no compression TIFF. Converting to bmp or tiff will greatly simplify the translation the PIC is faced with.
As to speed the brain will see flicker below 30 frames per sec but it isn't really noticeble until you get below 20 frames per sec. A twentieth of a second allows for a large number of instructions especially at 10 mips
( 40Mhz) so the issue is mostly likely to be about the code space that would be needed to effect a lossy decompression verus a non lossy one. |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Fri Dec 08, 2006 10:20 am |
|
|
There's a not too complicated implementation of .gif decoding written in C++ here (I have bookmarked it some long time ago, as 'may be useful some time')
..it is written in a simple procedural style, not using objects, as it seemed to me at first glance, you might want to try to convert it to CCS C. No animated gifs are supported though. |
|
|
|