Previous Next


                                               77
      SECTION 3.3                                                                   Filters



        more previous image samples, regardless of whether there are multiple color
        components in a byte or whether a single color component spans multiple
        bytes. This can yield significantly better speed at the cost of somewhat worse
        compression.

3.3.4 RunLengthDecode Filter

      The RunLengthDecode filter decodes data that has been encoded in a simple
      byte-oriented format based on run length. The encoded data is a sequence of
      runs, where each run consists of a length byte followed by 1 to 128 bytes of data. If
      the length byte is in the range 0 to 127, the following length + 1 (1 to 128) bytes
      are copied literally during decompression. If length is in the range 129 to 255, the
      following single byte is to be copied 257 − length (2 to 128) times during
      decompression. A length value of 128 denotes EOD.

      The compression achieved by run-length encoding depends on the input data. In
      the best case (all zeros), a compression of approximately 64 : 1 is achieved for long
      files. The worst case (the hexadecimal sequence 00 alternating with FF) results in
      an expansion of 127 : 128.


3.3.5 CCITTFaxDecode Filter

      The CCITTFaxDecode filter decodes image data that has been encoded using
      either Group 3 or Group 4 CCITT facsimile (fax) encoding. CCITT encoding is
      designed to achieve efficient compression of monochrome (1 bit per pixel) image
      data at relatively low resolutions, and so is useful only for bitmap image data, not
      for color images, grayscale images, or general data.

      The CCITT encoding standard is defined by the International
      Telecommunications Union (ITU), formerly known as the Comité Consultatif
      International Téléphonique et Télégraphique (International Coordinating
      Committee for Telephony and Telegraphy). The encoding algorithm is not
      described in detail in this book but can be found in ITU Recommendations T.4
      and T.6 (see the Bibliography). For historical reasons, we refer to these
      documents as the CCITT standard.

Previous Next