2010.12.22 16:20 "[Tiff] [ANNOUNCE]: LZMA2 codec", by Andrey Kiselev

2010.12.23 12:23 "Re: [Tiff] [ANNOUNCE]: LZMA2 codec", by Even Rouault

Andrey,

I've integrated successfully the LZMA codec in GDAL GeoTIFF driver, but I have noticed one issue. I don't manage to control the size of the resulting file by changing the value of the TIFFTAG_LZMAPRESET tag. My analysis showed that LZMAVSetField() only calls lzma_lzma_preset() with the passed preset value if we are in the LSTATE_INIT_ENCODE state. But this state is only set by LZMASetupEncode(), which as far as I can see is called at the time of the first TIFFWriteScanline(), TIFFWriteEncodedTile() or TIFFWriteEncodedStrip(). The GDAL driver tries to set the preset value much more early, like what is done with the TIFFTAG_ZIPQUALITY or TIFFTAG_JPEGQUALITY that control similar parameters for LZW and JPEG compression. So the value is ignored. Do I miss something or shouldn't the lzma_lzma_preset(&sp->opt_lzma, sp->preset); call be moved from LZMAVSetField() to LZMAPreEncode()?

Best regards,

Even