Skip to Main Content
Many coding methods are more efficient with certain types of images than others. In particular, run-length coding is very useful for coding areas of little changes. Adaptive predictive coding achieves high coding efficiency for fast changing areas like edges. In this paper, we propose a switching coding scheme that will combine the advantages of both run-length and adaptive linear predictive coding (RALP) for lossless compression of images. For pixels in slowly varying areas, run-length coding is used; otherwise LS (least square)-adapted predictive coding is used. Instead of performing LS adaptation in a pixel-by-pixel manner, we adapt the predictor coefficients only when an edge is detected so that the computational complexity can be significantly reduced. For this, we propose an edge detector using only causal pixels. This way, the predictor can look ahead if the coding pixel is around an edge and initiate the LS adaptation in advance to prevent the occurrence of a large prediction error. With the proposed switching structure, very good prediction results can be obtained in both slowly varying areas and pixels around boundaries as we will see in the experiments.