CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Reading an Animated GIF File with PIC18.?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jerry I



Joined: 14 Sep 2003
Posts: 96
Location: Toronto, Ontario, Canada

View user's profile Send private message

Reading an Animated GIF File with PIC18.?
PostPosted: Tue Dec 05, 2006 5:47 pm     Reply with quote

Question

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. Smile

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

View user's profile Send private message

Re: Reading an Animated GIF File with PIC18.?
PostPosted: Thu Dec 07, 2006 8:32 am     Reply with quote

Thanks for looking.

Looks like it is not possible.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Thu Dec 07, 2006 10:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 08, 2006 10:20 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group