Question about DecodeParms and FlateDecode

  • Follow


Hi guys,

I met a problem when dealing with FlateDcode, if there's no
DecodeParms, I could uncompress the data using zlib successfully. but
if there's DecodeParms, I don't know what to do with these
parameters(predictor/bits/colors/columns..)
I know it's some algorithm about differencing. but is it applied to
the data that has been uncompressed using zlib ? Is there any source
code about the differencing for reference?

any comment is appreciated.

thanks in advance.

Tim.
0
Reply xxdfall 6/16/2004 5:37:32 AM

xxdfall@hotmail.com (Tim) wrote:

>Hi guys,
>
>I met a problem when dealing with FlateDcode, if there's no
>DecodeParms, I could uncompress the data using zlib successfully. but
>if there's DecodeParms, I don't know what to do with these
>parameters(predictor/bits/colors/columns..)
>I know it's some algorithm about differencing. but is it applied to
>the data that has been uncompressed using zlib ? 

Yes, I believe so, though I haven't done it. You first decompress,
then apply the differencing.

It may be helpful to think about why these options exist.

Suppose you are creating a PDF and you have a greyscale photograph.
The pixel values will range all over the place, and so there may be
little repetition. Compression with Flate may not work well.  But if
you look at the areas of "smooth" colour in a photo, the colour may be
changing just a little between neighbouring pixels. Perhaps just by
+1, +2, +3 or -1, -2, -3.  By replacing pixel values by their
difference value, there is much more similarity in the new data, so it
may well compress better.  To decompress, you must therefore remove
the Flate first, then undo the differences.

----------------------------------------
Aandi Inston  quite@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

0
Reply quite 6/16/2004 6:08:45 AM


1 Replies
1367 Views

(page loaded in 0.037 seconds)

Similiar Articles:











7/22/2012 10:35:27 AM


Reply: