Apparatus and method for modelling differential pulse code modulation (DPCM) input data for entropy coding. In particular, the sign and magnitude of one piece of DPCM data after another are modelled to provide a magnitude state input and a sign state input to provide context for DPCM magnitude input and DPCM sign input, respectively, to an entropy encoder or decoder. That is, the DPCM magnitudes of earlier pieces of (context) DPCM magnitude data are re-mapped for each such earlier piece of data, the re-mapped data being aggregated to form a combined value indicative of the magnitude state input. Similarly, the DPCM signs of earlier pieces of (context) DPCM sign data are re-mapped for each such earlier piece of data, the re-mapped data being aggregated to form a combined value indicative of the sign state input. In an image data compression system, the magnitude state input serves as an activity indicator for picture elements (pixels) neighboring a 'subject' pixel. According to the invention, the DPCM signal is derived from a difference value calculated by subtracting one of a plurality of predictor values from the graylevel value X of the subject pixel. The selection of predictor value P is based on the value of the magnitude state (activity indicator). In addition, the difference value is subject to adaptive quantization in which one of a plurality of quantizers is employed in assigning the (X-P) difference value to a quantization level. The selection of quantizers is also based on the value of the magnitude state (activity indicator).
Adaptive graylevel image compression system.