[gdal-dev] RasterIO support for zlib / deflate compression?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] RasterIO support for zlib / deflate compression?

bradh

I’ve been looking at how much work it might take to implement a new NITF compression value (IC=CC and IC=MC) which is basically just ZLIB DEFLATE encoded blocks.

 

I’m mostly following the pattern used for JPEG, and its down to the part where I just need to do the compression:

int

NITFWriteZLIBBlock( GDALDataset *poSrcDS, VSILFILE *fp,

                    int nBlockXOff, int nBlockYOff,

                    int nBlockXSize, int nBlockYSize,

                    GDALProgressFunc pfnProgress, void * pProgressData )

{

    CPLDebug("NITF", "nBlockXOff=%d/%d, nBlockYOff=%d/%d",

                     nBlockXOff, nBlockXSize, nBlockYOff, nBlockYSize);

    return true;

}

 

Before I start to dig around in zlib, is there any support in the RasterIO level to do this? Anything else I could copy before reimplementing it poorly?

 

Brad


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: RasterIO support for zlib / deflate compression?

Even Rouault-2
Brad,

> I've been looking at how much work it might take to implement a new NITF
> compression value (IC=CC and IC=MC) which is basically just ZLIB DEFLATE
> encoded blocks.

Is it your own codec or something already standardized in NITF ?
If the former, I'd suggest that you consider ZStandard [1] compression
instead. It performs much better than ZLIB Deflate. I've integrated it
recently as a TIFF codec

>
> Before I start to dig around in zlib, is there any support in the RasterIO
> level to do this? Anything else I could copy before reimplementing it
> poorly?

Nothing at the RasterIO() level that exposes compressed datastream.
For ZLib(), there's a tiny helper, CPLZLibDeflate(), that can help you a bit.

Even

[1] https://github.com/facebook/zstd

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: RasterIO support for zlib / deflate compression?

bradh
Even,

It is not my compression, and although it isn't formalised yet, I think its
probably too late to change. I'll take it back to the NTB in any case.
The specific case is for "good enough" compression of floating point data
without (further) loss.

Thanks for the CPLZLibDeflate() helper recommendation - appreciated.

Brad
 


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev