METHOD AND APPARATUS FOR DOUBLE 3. Pattern Matching.
RUN-LENGTH ENCODING OF BINARY An adaptive method of detecting recurring and variable
DATA length patterns of double runs.
, „ Each of these elements are discussed in detail below. The
SUMMARY OF THE INVENTION s ^ ^ ^ ^ ^ slructoes used to represent compressed A method is disclosed for losslessly compressing binary 31,(1 ^ *e principal components of DRLE. Different data referred to herein as Double Run-Length Encoding pattern matching algorithms give varying degrees of com(DRLE), having particular application to the compression of pression. For gray-scale data, DRLE employs the Most gray-scale data as it is being processed for printing by a laser Recent (MR) double run scheme. Other schemes include printer or other continuous raster scan device. The DRLE Most Recent Pattern Change (MRPC) and Predefined Fixed method efficiently records repeating patterns of ones and Pattern (PFP) which are applicable to data containing patzeros with little computational complexity. Compression teras embedded in patterns, or data for which specific ratios that may be an order of magnitude or more are patterns are known to exist prior to applying DRLE, respecobtained frequently on data (hat may not compress well lively. Each of these pattern matching schemes are described using traditional Run-Length Encoding (RLE). DRLE uses below.
a sequential history of order-pairs that denote variable- The following is a discussion directed to a formal model length patterns of zeros and ones, and men efficiently and of lossless compression and DRLE. Examples of DRLE are adaptively encodes these patterns as they repeat themselves. then shown. These illustrate how DRLE works algorithmiDRLE provides high compression ratios for gray-scale 2o caUy and how me ... ratio may vary mathematidata which is typical of binary images of pages to be printed cally under certain conditions. DRLE's application to grayon a digital printer. DRLE allows many pages which do not scale data is then described, normally compress well using traditional Run-Length
Encoding (RLE) to be represented in a computationally Theoretical Model
efficient way while significantly reducing the amount of 25 A^a^y binary data can be thought of as a random
memory needed to hold these pages. The computational sequence 0f zeros and ones (see the top of FIG. 1). In this
efficiency lends itself well to bom software and hardware discussion, notation and terminology are introduced that
implementations with real-time constraints, while the typi- a formal ... of Iossless compression using
cally high compression ratio is ideal for today's low-cost RUE and DRLE
high-resolution monochrome and color ink jet and laser 30 TM „ . . . c.. . „ . ...,.
. . J M The smallest element of binary data is a bit (i.e., a zero or printers
y' a one). The total number of bits is called the length of the
A theoretical basis for DRLE and a discussion of its ^ Lossless compression of binary data is a transforma
application toward gray-scale imaging is also provided. ^ applie<J t0 mat ^ such mat me transformation is
Gray-scale imaging typically applies to digital monochrome invertible (i.e.. lossless), and produces binary data having a
printers or planar color printers with one bit per pixel per 35 smaller length (Le-> compresses). color plane.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 shows different representations of binary data.
FIG. 2 shows an example of double run-length encoding
using the most recent (MR) history. T(*)=y
FIG. 3 shows an example of double run-length encoding ... m ^ transformation T of binary data x prousing the most recent pattern change (MRPC). dudng binflry ^ y
FIG. 4 shows an example of DRLE using predefined fixed 45 ^ transformation T(x) is lossless if and only if there
pattern (PFP). exists transformation 1~L(y) such that:
FIGS. 5a and Sb show double run-length encoding of gray-scale data.
FIG. 6 is a block diagram of a hardware implementation Jo T-'(T(*)>^ for all x,
of the invented double run-length encoding technique. ^1(y) £g ^ ^ fransformaQon of T (x). m
FIG. 7 is a block diagram of a word packer suitable for use terms Gf lossless compression, T^y) is called the decom
with the invention. pression or expansion transformation.
„ „ The length of binary data x is the number (or count) of bits
DETAILED DESCRIPTION OF THE „ ^ *se x
INVENTION Let ^
Double Run-Length Encoding (DRLE) according to the present invention has three fundamental elements:
1. Double runs.
An ordered pair whose elements represent a concatenation denote the length of x.
of a run of zeros and a run of ones within the data to be A lossless transformation T(x) of x is compressed if compressed.
2. Encoding of literals and repeaters. T m ... . . The format of the output of DRLE contains literals 65
denoting double runs and repeaters for recurring instances of The compression ratio R(T(x)) of T(x) is defined as double runs.