run-length encoding

(redirected from Run length encoding)
Also found in: Medical, Acronyms.

run-length encoding

[′rən ¦leŋkth in′kōd·iŋ]
(computer science)
A method of data compression that encodes strings of the same character as a single number.

run-length encoding

A kind of compression algorithm which replaces sequences ("runs") of consecutive repeated characters (or other units of data) with a single character and the length of the run. This can either be applied to all input characters, including runs of length one, or a special character can be used to introduce a run-length encoded group. The longer and more frequent the runs are, the greater the compression that will be achieved. This technique is particularly useful for encoding black and white images where the data units would be single bit pixels.
References in periodicals archive ?
Besides the data structures from above, the implementation of our run length encoding needs the following.
We are now prepared to turn to the pseudo-code for the procedure DoEncoding(), which performs the run length encoding. void DoEncoding() { bool IND; int i, r, totNumLin, prelLabel; vector<int> CurPixCs(n), LinePos(n-1); RleRun Run; RleLine *pLine; // set variables CurPixCs.init(0); LinePos.init(0); totNumLin = 1; Index[Rank[0]] = 0; FOR i FROM 1 TO n-1 DO { Index[Rank[i]] = i; totNumLin *= ImgSize[i]; } // allocate memory for the array RleData // The size of the i-th dimension (i = 1,...,n-1) of RleData is the // image size in the direction with rank n-i.
Next, we consider the actual labeling of the image data, which is based on a preceding run length encoding. We have already stated that all correspondences between preliminary labels can be found by testing only the start and the endpoint of runs with their respective neighbors according to the chosen adjacency.
Although for the worst case of a 'salt and pepper' image (with a large amount of small objects) also the recursive and probably almost every other labeling algorithm can not fully deploy its potential, a run length encoding surely will spoil the total performance of the procedure.