Patent ID: 8044829

Claim:
An apparatus comprising: a memory module to store data, wherein the memory module comprises a first buffer portion to store encoded symbols of the data, and a second buffer portion to store symbols of the data to be encoded; and an encoder to compare the symbols stored in the second buffer portion with the encoded symbols stored in the first buffer portion and to compress the data, wherein the encoder is configured to operate in a first encoding mode to encode the symbols in the second buffer portion with corresponding codewords until the encoder detects a repeated pattern of symbols in the second buffer portion that matches the encoded symbols in the first buffer portion, and responsive to the encoder detecting the repeated pattern of symbols, switch to operate in a second encoding mode to count a number of times the pattern of symbols repeats in the second buffer portion, and output the number counted; wherein the encoder is configured to switch back to the first encoding mode when the encoder detects that the symbols in the second buffer stop repeating.