Commit bf7825bb authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added CDI_COMPRESS_AEC.

parent 137ab788
......@@ -711,11 +711,6 @@ void defineCompress(const char *arg)
{
comptype = CDI_COMPRESS_JPEG;
}
else if ( strncmp(arg, "gzip", len) == 0 )
{
comptype = CDI_COMPRESS_GZIP;
complevel = 6;
}
else if ( strncmp(arg, "zip", 3) == 0 )
{
comptype = CDI_COMPRESS_ZIP;
......
......@@ -72,10 +72,9 @@ extern "C" {
#define CDI_COMPRESS_NONE 0
#define CDI_COMPRESS_SZIP 1
#define CDI_COMPRESS_GZIP 2
#define CDI_COMPRESS_BZIP2 3
#define CDI_COMPRESS_ZIP 4
#define CDI_COMPRESS_JPEG 5
#define CDI_COMPRESS_AEC 2
#define CDI_COMPRESS_ZIP 3
#define CDI_COMPRESS_JPEG 4
/* external data types */
......
......@@ -200,7 +200,7 @@ void grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1)
size_t unzipsize;
int izip = gribGetZip(recsize, gribbuffer, &unzipsize);
if ( izip == 0 && streamptr2->comptype == CDI_COMPRESS_SZIP )
if ( izip == 0 && (streamptr2->comptype == CDI_COMPRESS_SZIP || streamptr2->comptype == CDI_COMPRESS_AEC) )
nbytes = grbSzip(filetype, gribbuffer, nbytes);
}
......@@ -255,7 +255,7 @@ void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
#endif
}
if ( comptype != CDI_COMPRESS_JPEG && comptype != CDI_COMPRESS_SZIP ) comptype = CDI_COMPRESS_NONE;
if ( comptype != CDI_COMPRESS_JPEG && comptype != CDI_COMPRESS_SZIP && comptype != CDI_COMPRESS_AEC ) comptype = CDI_COMPRESS_NONE;
if ( filetype == CDI_FILETYPE_GRB && comptype == CDI_COMPRESS_JPEG )
{
......@@ -267,7 +267,7 @@ void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
size_t nbytes = grbEncode(filetype, memtype, varID, levelID, vlistID, gridID, zaxisID, date, time, tsteptype, numavg,
datasize, data, nmiss, &gribbuffer, comptype, gc);
if ( filetype == CDI_FILETYPE_GRB && streamptr->comptype == CDI_COMPRESS_SZIP )
if ( filetype == CDI_FILETYPE_GRB && (streamptr->comptype == CDI_COMPRESS_SZIP || streamptr->comptype == CDI_COMPRESS_AEC) )
nbytes = grbSzip(filetype, gribbuffer, nbytes);
size_t (*myFileWrite)(int fileID, const void *restrict buffer, size_t len, int tsID)
......
......@@ -725,7 +725,7 @@ grib_handle *gribapiGetDiskRepresentation(size_t recsize, size_t *buffersize, vo
{
// fprintf(stderr, "packingType %d %s\n", len, typeOfPacking);
if ( strncmp(typeOfPacking, "grid_jpeg", len) == 0 ) *outCompressionType = CDI_COMPRESS_JPEG;
else if ( strncmp(typeOfPacking, "grid_ccsds", len) == 0 ) *outCompressionType = CDI_COMPRESS_SZIP;
else if ( strncmp(typeOfPacking, "grid_ccsds", len) == 0 ) *outCompressionType = CDI_COMPRESS_AEC;
else if ( strncmp(typeOfPacking, "grid_ieee", len) == 0 ) lieee = true;
}
}
......@@ -1836,7 +1836,7 @@ getGribApiCompTypeMsg(int comptype, size_t gridsize)
len = sizeof (mesg_grid_jpeg) - 1;
mesg = mesg_grid_jpeg;
}
else if ( comptype == CDI_COMPRESS_SZIP && gridsize > 1 )
else if ( (comptype == CDI_COMPRESS_SZIP || comptype == CDI_COMPRESS_AEC) && gridsize > 1 )
{
static const char mesg_grid_ccsds[] = "grid_ccsds";
len = sizeof (mesg_grid_ccsds) - 1;
......@@ -2189,7 +2189,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
GRIB_CHECK(my_grib_set_long(gh, "numberOfDataPoints", (long)gridsize), 0);
GRIB_CHECK(my_grib_set_long(gh, "totalNumberOfGridPoints", (long)gridsize), 0);
if ( comptype == CDI_COMPRESS_SZIP )
if ( comptype == CDI_COMPRESS_SZIP || comptype == CDI_COMPRESS_AEC )
{
static const char mesg[] = "grid_ccsds";
size_t len = sizeof (mesg) -1;
......@@ -2225,7 +2225,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
Warning("Can't write UUID!");
}
if ( comptype == CDI_COMPRESS_SZIP )
if ( comptype == CDI_COMPRESS_SZIP || comptype == CDI_COMPRESS_AEC )
{
static const char mesg[] = "grid_ccsds";
size_t len = sizeof (mesg) -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment