Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/05/04 12:21
Read: times


 
#64056 - RE: Another question?
Responding to: ???'s previous message
A very useful scheme I have made for compacting textual data is to take advantage of the fact that text (in many places at least) can be represented by ASCII or some other 7-bits codes. I have used an off-line tool that analyzes the text data base and compresses it in several simple ways. Then the packed version of the text is placed into non-volatile memory and read out at run time and decoded. The coding scheme works according to this set of rules:

1) If an byte has bit 7 clear then the lower 7 bits are the text character value.

2) If the upper bit is set and lower 7 bits are 0 (i.e == 0x80) then the following byte is a special character from the upper 128 character page of the font set.

3) If the upper bit is set and the lower 7 bits are 1 (i.e. == 0x81) then the following two bytes are an index to a token dictionary table of where to find the text token to be inserted at this point.

4) If the upper bit is set and the lower 7 bits are 2 (i.e. == 0x82) then the following two bytes are an index to the token dictionary table of where to find the text token to be inserted at this point then followed by a space.

5) If the upper bit is set and the lower 7 bits are 3 (i.e. == 0x83) then the following two bytes are an extended character code into a secondary font table used for example when western text is mixed with Chinese characters.

6) If the upper bit is set and the lower 7 bits are a value >= 4 then the following single byte is the a text character to repeat the number of times specified by the count in the lower 7 bits.

This scheme may take more than 1 or 2 bytes of internal RAM to decode but for a typical product user interfaces where I have used this scheme I have been able to realize text compressions of greater than 2.5 to 1. On one product I recall a menu system that has about 25 menus (hundreds of strings) that occupied about 45K bytes of straight text that was reduced to less than 20K bytes. Using this process I was able to gain enough memory space in the product to permit embedding the menu data sets for up to ten translations (different languages) so that the users could change product country selection on the fly at runtime.

If anybody wants more info on this idea I would let you look at the decoding tool (in C code) and the off-line tool that makes the compressed dataset (also in C code). I made this scheme for use on a different type of processor platform but there is no reason that it could not be used on an 8052 type processor as well. There is also reason to believe that the run time decoding could easily be done in assembler.

Michael Karas


List of 42 messages in thread
TopicAuthorDate
String Compression Algorthim...            01/01/70 00:00      
   RE: String Compression Algorthim...            01/01/70 00:00      
      RE: String Compression Algorthim...            01/01/70 00:00      
      A more excellent way            01/01/70 00:00      
      creativity or...rehashing an old idea            01/01/70 00:00      
   Alternative approach with Keil            01/01/70 00:00      
      RE: Alternative approach with Keil            01/01/70 00:00      
         RE: Clarification - Alternative approach            01/01/70 00:00      
   RE: String Compression Algorthim...            01/01/70 00:00      
      ROM/RAM; CODE/XDATA            01/01/70 00:00      
         RE: ROM/RAM; CODE/XDATA            01/01/70 00:00      
      RE: String Compression Algorthim...            01/01/70 00:00      
         What MCU?            01/01/70 00:00      
            RE: What MCU?            01/01/70 00:00      
               RE: What MCU?            01/01/70 00:00      
               RE: What MCU?            01/01/70 00:00      
                  RE: What MCU?            01/01/70 00:00      
                     RE: What MCU?            01/01/70 00:00      
               Completely the Wrong MCU!            01/01/70 00:00      
                  RE: Completely the Wrong MCU!            01/01/70 00:00      
                     RE: Completely the Wrong MCU!            01/01/70 00:00      
   RE: String Compression Algorthim...            01/01/70 00:00      
      RE: String Compression Algorthim...            01/01/70 00:00      
         RE: String Compression Algorthim...            01/01/70 00:00      
   RE: String Compression Algorthim...            01/01/70 00:00      
      RE: String Compression Algorthim...            01/01/70 00:00      
         RE: String Compression Algorthim...            01/01/70 00:00      
   Radix-50?            01/01/70 00:00      
      RE: Radix-50?            01/01/70 00:00      
         RE: Radix-50?            01/01/70 00:00      
            Animations...            01/01/70 00:00      
            RE: Radix-50?            01/01/70 00:00      
      RE: Radix-50?            01/01/70 00:00      
         RE: Radix-50?            01/01/70 00:00      
            Another question?            01/01/70 00:00      
               RE: Another question?            01/01/70 00:00      
                  RE: Another question?            01/01/70 00:00      
                     RE: Another question?            01/01/70 00:00      
                        RE: Another question?            01/01/70 00:00      
               RE: Another question?            01/01/70 00:00      
                  interesting for other, but not for Azhar            01/01/70 00:00      
               RE: Another question?            01/01/70 00:00      

Back to Subject List