Viewing a single comment thread. View all comments

Jason_Peterson t1_j1yftv9 wrote

This is only possible in exceptional cases where the input data is highly repetitive, such as a simple digital drawing consisting of a few colors. Then the algorithm records how many bytes to repeat instead of writing them out one after the other. This is one of the most basic methods of how compression works.

Other methods include keeping a dictionary of sequences that have been encountered recently with the aim of using references into that table which are shorted than the data they describe, and prediction of a continuous signal, such as subtraction of the previous pixel in a row.

Most normal data that has a meaning is not very repetitive. It contains variations and noise, which make exact matches unlikely to occur. Typically compression achieves a ratio of 25% to 50%.

An "online" algorithm is not a meaningful classification. Perhaps you want to clarify what specific program you mean by online.

5

maw32 t1_j1ylkbk wrote

In sorting algorithms there is a classification in online and offline. Offline algorithms need all of the data to work. Online algorithms can work with parts of the data and incorporate more data as it is received. I guess he is looking for an algorithm which can compress data arriving from a stream without buffering the whole stream first.

Or he want to compress data over the internet because he has no local admin rights to install a compression software/library.

2