CA2438309C

Method and apparatus for adaptive data compression

Abstract

We present a method and apparatus for performing adaptive data compression. An alphabet and vocabulary in the encoder and decoder is built adaptively and stored in a dictionary as symbols are to be encoded and decoded. Each time an unknown symbol is to be encoded by the encoder, the encoder adds the symbol to the dictionary and transmits it in plain in the encoded string. The code words transmitted by the encoder include symbols and indexes. The state of a prefix bit preceding the code word indicates whether the code word is a plain symbol or an index of a symbol or string of symbols stored in the dictionary. The decoder examines the prefix bit of each code word as it is received to determine if the code word stores a symbol in plain or in index. If the code word stores a symbol in plain, the decoder learns the symbol by adding a sequence of symbols resulting from the concatenation of previously decoded symbols and the first symbol of the currently decoded symbol and by adding the symbol to its dictionary. If the code word stores an index, the decoder decodes the code word by extracting the symbol or sequence of symbols stored in the dictionary at the respective index in the dictionary.

CA2438309C, drawing sheet 1
Sheet 1 of 11

Term

Term ended

Expired 11 February 2022, 4.6 years ago.

  1. Priority
  2. Filed
  3. Granted
  4. Expired
  5. Today

57 claims: 11 independent, 46 dependent

  1. 1
    CA 02438309 2010-02-12 -38CLAIMS:1. A method for adaptively compressing an input string comprising the steps of: searching an encoder dictionary for each symbol received in the input string, a 5 symbol width selected dependent on a type of data in the input string;upon detecting a symbol is not stored in the encoder dictionary, learning the symbol by storing the symbol at a next sequential index in the encoder dictionary and transmitting the symbol in a code word to a decoder, the code word including an identifier, the state of the identifier indicating the code word includes the symbol to be learned;10 upon detecting the symbol is stored in the encoder dictionary, transmitting in the code word a single index at which a previously learned symbol is stored in the encoder dictionary, the state of the identifier indicating the code word includes the single index;and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, modifying the symbol width and communicating a new 15 symbol width to the decoder.
  2. 8
    10. An apparatus for adaptively compressing an input string comprising:an encoder dictionary for storing each symbol received in the string of symbols a symbol width selected dependent on the type of data in the input string;and control logic which searches the dictionary for each symbol, transmits the symbol in a code word to a decoder upon detecting the symbol is not stored in the dictionary and learns the symbol by storing the symbol at a next sequential index in the dictionary, the code word including an identifier, the state of the identifier indicating the code word includes the symbol to be learned, upon detecting the symbol is stored in the encoder dictionary, transmits in the code word a single index at which the stored symbol is stored in the encoder dictionary, the state of the identifier indicating the code word includes the single index and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, modifies the symbol width and communicates a new symbol width to the decoder.
  3. 13
    15. An apparatus for adaptively compressing an input string comprising:an encoder dictionary for storing each symbol received in the string of symbols, a symbol width selected dependent on a type of data in the input string;means for searching the dictionary for each symbol;means for transmitting the symbol to a decoder in a code word upon detecting the symbol is not stored in the encoder dictionary, the code word including an identifier, the state of the identifier indicating the code word includes the symbol to be learned;and means for learning the symbol by storing the symbol at a next sequential index the dictionary;upon detecting the symbol is stored in the encoder dictionary, means for transmitting in the code word a single index at which the stored symbol is stored in the encoder dictionary, the state of the identifier indicating the code word includes the single index;and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, means for modifying the symbol width and communicating a new symbol width to the decoder.
  4. 16
    18. A method for adaptively compressing an input string comprising the steps of:searching a dictionary for a longest prefix match for a sequence of symbols received in the string of symbols, a symbol width selected dependent on a type of data in the input string;CA 02438309 2010-02-12 -41upon detecting a symbol in the string of symbols is not stored in the encoder dictionary, transmitting the symbol in a code word, the code word including an identifier, the state of the identifier identifying whether the code word is a plain symbol to be learned or is an index, and learning the symbol by storing the symbol at a next sequential index in the encoder dictionary;upon detecting that the sequence of symbols is stored in the dictionary, transmitting in the code word, the index at which the sequence of symbols is stored in the dictionary, the width of the index dependent on a number of learned items stored in the dictionary;upon detecting the symbol is stored in the encoder dictionary, transmitting in the code word a single index at which the stored symbol is stored in the encoder dictionary, the state of the identifier indicating the code word includes the single index;and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, modifying the symbol width and communicating a new symbol width to the decoder.
  5. 17
    19. A method for decompressing a sequence of code words comprising the steps of:receiving a code word, the code word including an identifier, the width of the code word dependent on a symbol width selected dependent on a type of data in the input string;upon detecting from the state of the identifier that a symbol is stored in the code word, learning the symbol by, storing the symbol at a next sequential index in a decoder dictionary;and providing the symbol as decoded data.
  6. 22
    24. An apparatus for decompressing a sequence of code words comprising:a dictionary for storing at a next sequential index, a plain symbol received in a code word, the code word including an identifier, the state of the identifier indicating the code word includes the symbol to be learned;and logic which receives a code word, detects the plain symbol stored in the code word, stores the symbol in the dictionary and provides the symbol as decoded data, upon detecting the symbol is stored in the encoder dictionary, transmits in the code word a single index at which the stored symbol is stored in both the encoder dictionary and the decoder dictionary, the state of the identifier indicating the code word includes the single index and upon detecting a compression ratio based on a current symbol width is less than a threshold compression ratio, modifies the current symbol width and communicates a new symbol width to the decoder.
  7. 28
    30. A method of adaptively compressing an input string comprising:searching an encoder dictionary for each symbol received in the input string, a symbol width selected dependent on a type of data in the input string;upon detecting a symbol is stored in the encoder dictionary, forming a sequence of symbols by concatenating the symbol with a next sequential symbol in the input string and searching the encoder dictionary for the sequence of symbols;upon detecting that the sequence of symbols is not stored in the encoder dictionary, storing the sequence of symbols at a next sequential index in the encoder dictionary and transmitting an index at which a longest prefix match for the sequence of symbols is stored in the encoder dictionary, the state of the identifier indicating the code word includes the index;and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, modifying the symbol width and communicating a new symbol width to the decoder.
  8. 39
    42. An apparatus for adaptively compressing an input string comprising:CA 02438309 2010-02-12 -45an encoder dictionary for storing each symbol received in the string of symbols, a symbol width selected dependent on the type of data in the input string;and control logic which: upon detecting the symbol is stored in the encoder dictionary, forms a sequence of symbols by concatenating the previously learned symbol with a next sequential symbol in the input string and searches the encoder dictionary for the sequence of symbols, upon detecting that the sequence of symbols is not stored in the encoder dictionary, stores the sequence of symbols at a next sequential index in the encoder dictionary and transmits an index at which a longest prefix match for the sequence of symbols is stored in the encoder dictionary, the state of the identifier indicating the code word includes the index, and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, modifies the symbol width and communicates a new symbol width to the decoder.
  9. 50
    54. An apparatus for adaptively compressing an input string comprising:an encoder dictionary for storing each symbol received in the string of symbols, a symbol width selected dependent on a type of data in the input string;upon detecting the symbol is stored in the encoder dictionary, means for forming a sequence of symbols by concatenating the previously learned symbol with a next CA 02438309 2010-02-12 -47sequential symbol in the input string and means for searching the encoder dictionary for the sequence of symbols;means for storing the sequence of symbols at a next sequential index in the encoder dictionary upon detecting that the sequence of symbols is not stored in the encoder dictionary and means for transmitting an index at which a longest prefix match for the sequence of symbols is stored in the encoder dictionary, the state of the identifier indicating the code word includes the index;and upon detecting a compression ratio based on the current symbol width is less than a threshold compression ratio, means for modifying the symbol width and means for communicating a new symbol width to the decoder.
  10. 51
    55. A method of increasing throughput of data transmission between an encoder and a decoder comprising:a) receiving an input string by the encoder;b) selecting a segment of bits from the input string as searchable data to be searched by the encoder;c) storing the position of the selected segment within the input string in a position register;d) comparing the searchable data with contents of a memory;e) upon detecting that the searchable data is stored in the memory, linking a subsequent segment of bits from the input string to the searchable data, storing the position of the subsequent segment within the input string in the position register and comparing the searchable data with the contents of the memory;and f) upon detecting that the searchable data is not stored in the memory, storing the subsequent segment of data bits in a next free location in the memory and sending the subsequent segment of data bits to the decoder.
  11. 55
    59. A method of encoding a data string comprising:receiving an input string at an encoder input, the input string comprising a plurality of symbols, each symbol having a number of bits, the number of bits dependent on a type of data in the input string;comparing a first symbol in the received data string with symbols stored in a memory associated with the encoder;upon detecting the first symbol is not stored in the memory, writing the first symbol in a free location in the memory;upon detecting the first symbol is stored in the memory, forming a sequence of symbols by linking the first symbol with a next sequential symbol in the input string and comparing the sequence of symbols with sequences of symbols stored in the memory;upon detecting that the sequence of symbols is not stored in the memory, writing the sequence of symbols at a next sequential free location in the memory;upon detecting that the sequence of symbols is stored in the encoder, expanding the sequence of symbols by linking the sequence of symbols with a next sequential symbol in the input string and comparing the expanded sequence of symbols with sequences of symbols stored in the memory;and continuing to compare expanded sequences of symbols from the input string with sequences of symbols stored in the memory and writing sequences of symbols into the memory only when the sequences of symbols from the input string are not stored in the encoder until all the symbols in the input string have been compared with symbols stored in the encoder.