ldas-tools-framecpp 2.7.0
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
FrameCPP::Compression Namespace Reference

Routines related to compression algorithems. More...

Namespaces

namespace  Differential
 Routines related to the differential compression algorithm.
 
namespace  GZip
 Routines related to the gzip compression algorith.
 
namespace  ZeroSuppress
 Routines related to the gzip compression algorith.
 

Enumerations

enum  data_types_type {
  FR_VECT_C = 0 , FR_VECT_2S = 1 , FR_VECT_8R = 2 , FR_VECT_4R = 3 ,
  FR_VECT_4S = 4 , FR_VECT_8S = 5 , FR_VECT_8C = 6 , FR_VECT_16C = 7 ,
  FR_VECT_STRING = 8 , FR_VECT_2U = 9 , FR_VECT_4U = 10 , FR_VECT_8U = 11 ,
  FR_VECT_1U = 12 , FR_VECT_C = 0 , FR_VECT_2S = 1 , FR_VECT_8R = 2 ,
  FR_VECT_4R = 3 , FR_VECT_4S = 4 , FR_VECT_8S = 5 , FR_VECT_8C = 6 ,
  FR_VECT_16C = 7 , FR_VECT_STRING = 8 , FR_VECT_2U = 9 , FR_VECT_4U = 10 ,
  FR_VECT_8U = 11 , FR_VECT_1U = 12
}
 Enumerated type for supported vector data types. More...
 
enum  compress_type {
  MODE_RAW = 0 , MODE_GZIP = 0x10000 , MODE_DIFF = 0x20000 , MODE_DIFF_GZIP = 0x30000 ,
  MODE_ZERO_SUPPRESS_SHORT = 0x40000 , MODE_ZERO_SUPPRESS_INT_FLOAT = 0x50000 , MODE_ZERO_SUPPRESS_WORD_4 = 0x60000 , MODE_ZERO_SUPPRESS_WORD_8 = 0x70000 ,
  MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP = 0x1000000 , MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP = 0x2000000 , MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP = 0x3000000 , MODE_BEST_COMPRESSION = 0x4000000 ,
  MODE_RAW = 0 , MODE_GZIP = 0x10000 , MODE_DIFF = 0x20000 , MODE_DIFF_GZIP = 0x30000 ,
  MODE_ZERO_SUPPRESS_SHORT = 0x40000 , MODE_ZERO_SUPPRESS_INT_FLOAT = 0x50000 , MODE_ZERO_SUPPRESS_WORD_4 = 0x60000 , MODE_ZERO_SUPPRESS_WORD_8 = 0x70000 ,
  MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP = 0x1000000 , MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP = 0x2000000 , MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP = 0x3000000 , MODE_BEST_COMPRESSION = 0x4000000
}
 Enumerated type for general compression modes. More...
 
enum  data_types_type {
  FR_VECT_C = 0 , FR_VECT_2S = 1 , FR_VECT_8R = 2 , FR_VECT_4R = 3 ,
  FR_VECT_4S = 4 , FR_VECT_8S = 5 , FR_VECT_8C = 6 , FR_VECT_16C = 7 ,
  FR_VECT_STRING = 8 , FR_VECT_2U = 9 , FR_VECT_4U = 10 , FR_VECT_8U = 11 ,
  FR_VECT_1U = 12 , FR_VECT_C = 0 , FR_VECT_2S = 1 , FR_VECT_8R = 2 ,
  FR_VECT_4R = 3 , FR_VECT_4S = 4 , FR_VECT_8S = 5 , FR_VECT_8C = 6 ,
  FR_VECT_16C = 7 , FR_VECT_STRING = 8 , FR_VECT_2U = 9 , FR_VECT_4U = 10 ,
  FR_VECT_8U = 11 , FR_VECT_1U = 12
}
 Enumerated type for supported vector data types. More...
 
enum  compress_type {
  MODE_RAW = 0 , MODE_GZIP = 0x10000 , MODE_DIFF = 0x20000 , MODE_DIFF_GZIP = 0x30000 ,
  MODE_ZERO_SUPPRESS_SHORT = 0x40000 , MODE_ZERO_SUPPRESS_INT_FLOAT = 0x50000 , MODE_ZERO_SUPPRESS_WORD_4 = 0x60000 , MODE_ZERO_SUPPRESS_WORD_8 = 0x70000 ,
  MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP = 0x1000000 , MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP = 0x2000000 , MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP = 0x3000000 , MODE_BEST_COMPRESSION = 0x4000000 ,
  MODE_RAW = 0 , MODE_GZIP = 0x10000 , MODE_DIFF = 0x20000 , MODE_DIFF_GZIP = 0x30000 ,
  MODE_ZERO_SUPPRESS_SHORT = 0x40000 , MODE_ZERO_SUPPRESS_INT_FLOAT = 0x50000 , MODE_ZERO_SUPPRESS_WORD_4 = 0x60000 , MODE_ZERO_SUPPRESS_WORD_8 = 0x70000 ,
  MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP = 0x1000000 , MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP = 0x2000000 , MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP = 0x3000000 , MODE_BEST_COMPRESSION = 0x4000000
}
 Enumerated type for general compression modes. More...
 

Functions

void Compress (INT_4U &CompressionMode, INT_4U Level, const compress_type_mapping &CompressionMapping, const compress_type_reverse_mapping &CompressionReverseMapping, INT_4U DataType, const data_type_mapping &DataTypeMapping, const CHAR_U *Source, const INT_8U SourceLength, const INT_8U SourceByteLength, output_type &Dest, INT_8U &DestByteLength)
 compress data without altering the source
 
void Expand (const bool NativeOrder, const INT_4U CompressionMode, const compress_type_mapping &CompressionMapping, const INT_4U DataType, const data_type_mapping &DataTypeMapping, const CHAR_U *Source, const INT_8U SourceLength, const INT_8U SourceByteLength, output_type &Dest, INT_8U &DataByteLength)
 uncompress data without altering the source
 

Detailed Description

Routines related to compression algorithems.

Enumeration Type Documentation

◆ compress_type [1/2]

Enumerated type for general compression modes.

Enumerator
MODE_RAW 

Uncompressed raw values.

MODE_GZIP 

Gzip of any data type.

MODE_DIFF_GZIP 

Gzip of differential values for FR_VECT_C, FR_VECT_1U, FR_VECT_2S, FR_VECT_2U, FR_VECT_4S, and FR_VECT_4U.

MODE_ZERO_SUPPRESS_SHORT 

Zero suppression algorithm for FR_VECT_2S and FR_VECT_2U.

MODE_ZERO_SUPPRESS_INT_FLOAT 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R.

MODE_ZERO_SUPPRESS_WORD_4 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R, and FR_VECT_8C. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_WORD_8 

Zero suppression algorithm for FR_VECT_8S, FR_VECT_8U, FR_VECT_8R, and FR_VECT_16C. If used on data types FR_VECT_4U, FR_VECT_4S, FR_VECT_4R or FR_VECT_8C, then the mode is modified to MODE_ZERO_SUPPRESS_INT_FLOAT. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; for FR_VECT_8U, FR_VECT_8S, FR_VECT_8R, and FR_VECT_16C, compression mode MODE_ZERO_SUPPRESS_WORD_8 is used; All other data types are compressed using MODE_GZIP.

MODE_BEST_COMPRESSION 

This compression mode tries to compress the data using all known compression modes and keeps the one with the highest compression ratio.

MODE_RAW 

Uncompressed raw values.

MODE_GZIP 

Gzip of any data type.

MODE_DIFF_GZIP 

Gzip of differential values for FR_VECT_C, FR_VECT_1U, FR_VECT_2S, FR_VECT_2U, FR_VECT_4S, and FR_VECT_4U.

MODE_ZERO_SUPPRESS_SHORT 

Zero suppression algorithm for FR_VECT_2S and FR_VECT_2U.

MODE_ZERO_SUPPRESS_INT_FLOAT 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R.

MODE_ZERO_SUPPRESS_WORD_4 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R, and FR_VECT_8C. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_WORD_8 

Zero suppression algorithm for FR_VECT_8S, FR_VECT_8U, FR_VECT_8R, and FR_VECT_16C. If used on data types FR_VECT_4U, FR_VECT_4S, FR_VECT_4R or FR_VECT_8C, then the mode is modified to MODE_ZERO_SUPPRESS_INT_FLOAT. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; for FR_VECT_8U, FR_VECT_8S, FR_VECT_8R, and FR_VECT_16C, compression mode MODE_ZERO_SUPPRESS_WORD_8 is used; All other data types are compressed using MODE_GZIP.

MODE_BEST_COMPRESSION 

This compression mode tries to compress the data using all known compression modes and keeps the one with the highest compression ratio.

◆ compress_type [2/2]

Enumerated type for general compression modes.

Enumerator
MODE_RAW 

Uncompressed raw values.

MODE_GZIP 

Gzip of any data type.

MODE_DIFF_GZIP 

Gzip of differential values for FR_VECT_C, FR_VECT_1U, FR_VECT_2S, FR_VECT_2U, FR_VECT_4S, and FR_VECT_4U.

MODE_ZERO_SUPPRESS_SHORT 

Zero suppression algorithm for FR_VECT_2S and FR_VECT_2U.

MODE_ZERO_SUPPRESS_INT_FLOAT 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R.

MODE_ZERO_SUPPRESS_WORD_4 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R, and FR_VECT_8C. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_WORD_8 

Zero suppression algorithm for FR_VECT_8S, FR_VECT_8U, FR_VECT_8R, and FR_VECT_16C. If used on data types FR_VECT_4U, FR_VECT_4S, FR_VECT_4R or FR_VECT_8C, then the mode is modified to MODE_ZERO_SUPPRESS_INT_FLOAT. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; for FR_VECT_8U, FR_VECT_8S, FR_VECT_8R, and FR_VECT_16C, compression mode MODE_ZERO_SUPPRESS_WORD_8 is used; All other data types are compressed using MODE_GZIP.

MODE_BEST_COMPRESSION 

This compression mode tries to compress the data using all known compression modes and keeps the one with the highest compression ratio.

MODE_RAW 

Uncompressed raw values.

MODE_GZIP 

Gzip of any data type.

MODE_DIFF_GZIP 

Gzip of differential values for FR_VECT_C, FR_VECT_1U, FR_VECT_2S, FR_VECT_2U, FR_VECT_4S, and FR_VECT_4U.

MODE_ZERO_SUPPRESS_SHORT 

Zero suppression algorithm for FR_VECT_2S and FR_VECT_2U.

MODE_ZERO_SUPPRESS_INT_FLOAT 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R.

MODE_ZERO_SUPPRESS_WORD_4 

Zero suppression algorithm for FR_VECT_4S, FR_VECT_4U, FR_VECT_4R, and FR_VECT_8C. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_WORD_8 

Zero suppression algorithm for FR_VECT_8S, FR_VECT_8U, FR_VECT_8R, and FR_VECT_16C. If used on data types FR_VECT_4U, FR_VECT_4S, FR_VECT_4R or FR_VECT_8C, then the mode is modified to MODE_ZERO_SUPPRESS_INT_FLOAT. If used on data types FR_VECT_2U or FR_VECT_2S, then the mode is modified to MODE_ZERO_SUPPRESS_SHORT.

MODE_ZERO_SUPPRESS_2_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; All other data types are compressed using MODE_GZIP.

MODE_ZERO_SUPPRESS_2_4_8_OTHERWISE_GZIP 

This meta mode uses MODE_ZERO_SUPPRESS_SHORT for FR_VECT_2S and FR_VECT_2U; for FR_VECT_4U, FR_VECT_4S, FR_VECT_4R, and FR_VECT_8C, compression mode MODE_ZERO_SUPPRESS_INT_FLOAT is used; for FR_VECT_8U, FR_VECT_8S, FR_VECT_8R, and FR_VECT_16C, compression mode MODE_ZERO_SUPPRESS_WORD_8 is used; All other data types are compressed using MODE_GZIP.

MODE_BEST_COMPRESSION 

This compression mode tries to compress the data using all known compression modes and keeps the one with the highest compression ratio.

◆ data_types_type [1/2]

Enumerated type for supported vector data types.

Enumerator
FR_VECT_C 

CHAR data type.

FR_VECT_2S 

INT_2S data type.

FR_VECT_8R 

REAL_8 data type.

FR_VECT_4R 

REAL_4 data type.

FR_VECT_4S 

INT_4S data type.

FR_VECT_8S 

INT_8S data type.

FR_VECT_8C 

COMPLEX_8 data type.

FR_VECT_16C 

COMPLEX_16 data type.

FR_VECT_STRING 

STRING data type.

FR_VECT_2U 

INT_2U data type.

FR_VECT_4U 

INT_4U data type.

FR_VECT_8U 

INT_8U data type.

FR_VECT_1U 

CHAR_U data type.

FR_VECT_C 

CHAR data type.

FR_VECT_2S 

INT_2S data type.

FR_VECT_8R 

REAL_8 data type.

FR_VECT_4R 

REAL_4 data type.

FR_VECT_4S 

INT_4S data type.

FR_VECT_8S 

INT_8S data type.

FR_VECT_8C 

COMPLEX_8 data type.

FR_VECT_16C 

COMPLEX_16 data type.

FR_VECT_STRING 

STRING data type.

FR_VECT_2U 

INT_2U data type.

FR_VECT_4U 

INT_4U data type.

FR_VECT_8U 

INT_8U data type.

FR_VECT_1U 

CHAR_U data type.

◆ data_types_type [2/2]

Enumerated type for supported vector data types.

Enumerator
FR_VECT_C 

CHAR data type.

FR_VECT_2S 

INT_2S data type.

FR_VECT_8R 

REAL_8 data type.

FR_VECT_4R 

REAL_4 data type.

FR_VECT_4S 

INT_4S data type.

FR_VECT_8S 

INT_8S data type.

FR_VECT_8C 

COMPLEX_8 data type.

FR_VECT_16C 

COMPLEX_16 data type.

FR_VECT_STRING 

STRING data type.

FR_VECT_2U 

INT_2U data type.

FR_VECT_4U 

INT_4U data type.

FR_VECT_8U 

INT_8U data type.

FR_VECT_1U 

CHAR_U data type.

FR_VECT_C 

CHAR data type.

FR_VECT_2S 

INT_2S data type.

FR_VECT_8R 

REAL_8 data type.

FR_VECT_4R 

REAL_4 data type.

FR_VECT_4S 

INT_4S data type.

FR_VECT_8S 

INT_8S data type.

FR_VECT_8C 

COMPLEX_8 data type.

FR_VECT_16C 

COMPLEX_16 data type.

FR_VECT_STRING 

STRING data type.

FR_VECT_2U 

INT_2U data type.

FR_VECT_4U 

INT_4U data type.

FR_VECT_8U 

INT_8U data type.

FR_VECT_1U 

CHAR_U data type.

Function Documentation

◆ Compress()

void FrameCPP::Compression::Compress ( INT_4U &  CompressionMode,
INT_4U  Level,
const compress_type_mapping &  CompressionMapping,
const compress_type_reverse_mapping &  CompressionReverseMapping,
INT_4U  DataType,
const data_type_mapping &  DataTypeMapping,
const CHAR_U *  Source,
const INT_8U  SourceLength,
const INT_8U  SourceByteLength,
output_type &  Dest,
INT_8U &  DestByteLength 
)

compress data without altering the source

Parameters
[in,out]CompressionModeOn input, this variable represents the desired compression method to be used. Because some compression modes represent a set of compression methods, this value may be modified to signify the one actually choosen.
[in]LevelSome compression methods support the idea of levels. For these methods, it usually is a trade off between speed and size. The higher the level, the harder the algorithm tries to compress the data.
[in]CompressionMappingProvides an interface from the frame spec to the generic compression routine about the compression being requested.
[in]CompressionReverseMappingProvides mapping information about how to go from the generic compression modes to the frame specification compression modes.
[in]DataTypeThe data type of the source.
[in]DataTypeMappingThis is a table mapping the supported data types allowed by the user. Since these routines are general, they may be able to do more than what the caller is requesting. This table limits the allowed data types.
[in]SourceThis is a buffer of data to be compressed.
[in]SourceLengthThe number of data elements in the origional, uncompressed data array.
[in]SourceByteLengthThe number of bytes used by Source.
[out]DestThe buffer in compressed format. If the compression failed, then this will be a NULL pointer. If the compression succeeded, this will be a pointer allocated via new[] and is the responsibility of the caller to deallocate.
[out]DestByteLengthThe number of bytes used by Dest. If the compression failed, then this will be zero.

This will take on input buffer and generate a compressed version of the input buffer.

Todo:
See about doing gzip compression when an exception is thrown for zero suppress compressions.
Todo:
See about doing gzip compression when an exception is thrown for zero suppress compressions.

◆ Expand()

void FrameCPP::Compression::Expand ( const bool  NativeOrder,
const INT_4U  CompressionMode,
const compress_type_mapping &  CompressionMapping,
const INT_4U  DataType,
const data_type_mapping &  DataTypeMapping,
const CHAR_U *  Source,
const INT_8U  SourceLength,
const INT_8U  SourceByteLength,
output_type &  Dest,
INT_8U &  DataByteLength 
)

uncompress data without altering the source

Parameters
[in]NativeOrderBoolean describing if the data being uncompressed is of the same byte order as the host.
[in]CompressionModeVersion specific compression mode.
[in]CompressionMappingMap from version specific compression modes to compression modes used by the general compression routines.
[in]DataTypeVersion specific data type.
[in]DataTypeMappingMap from version specific data type to data types used by the general compression routines.
[in]SourceThe compressed data stream.
[in]SourceLengthThe number of data elements.
[in]SourceByteLengthThe number of bytes
[out]DestNew buffer containing the decompressed data.
[out]DataByteLengthThe number of bytes allocated to Dest.