ldas-tools-framecpp 3.0.4
Loading...
Searching...
No Matches
compression.cc File Reference
#include <sys/types.h>
#include <dirent.h>
#include <stdarg.h>
#include <unistd.h>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <boost/shared_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/test/included/unit_test.hpp>
#include "ldastoolsal/unordered_map.hh"
#include "ldastoolsal/regex.hh"
#include "ldastoolsal/regexmatch.hh"
#include "framecpp/Common/Compression.hh"
#include "framecpp/Common/CompressionDifferential.hh"
#include "framecpp/Common/CompressionZeroSuppress.hh"
#include "framecpp/Dimension.hh"
#include "framecpp/FrameH.hh"
#include "framecpp/FrAdcData.hh"
#include "framecpp/FrRawData.hh"
#include "framecpp/FrVect.hh"
#include "framecpp/IFrameStream.hh"
#include "framecpp/OFrameStream.hh"
Include dependency graph for compression.cc:

Classes

class  anonymous_namespace{compression.cc}::waveform_compression
class  anonymous_namespace{compression.cc}::GenSawToothFalling< T >
class  anonymous_namespace{compression.cc}::GenSawToothPeaks< T >
class  anonymous_namespace{compression.cc}::GenSawToothRising< T >
class  anonymous_namespace{compression.cc}::GenSquareWave< T >
class  unordered_map

Namespaces

namespace  anonymous_namespace{compression.cc}

Macros

#define EnableFrameL(a)
#define TEST_FILE_COMPARISON   1
#define TEST_BUILDING_BLOCKS   1
#define TEST_RAW   1
#define TEST_GZIP   1
#define TEST_DIFF_GZIP   1
#define TEST_ZERO_SUPPRESS   1
#define TEST_ZERO_SUPPRESS_SHORT   1
#define TEST_ZERO_SUPPRESS_INT_FLOAT   1
#define TEST_ZERO_SUPPRESS_OTHERWISE_GZIP   1
#define TEST_ZSTD   1
#define TEST_DIFF_ZSTD   1
#define PROBLEM_CASES   1
#define BOOST_TEST_MAIN
#define FL_DATA_TYPE(A, B)
#define METHOD(A)
#define DATA_TYPE(A, B)

Typedefs

typedef FrameCPP::Compression::output_type data_type
typedef ::data_type anonymous_namespace{compression.cc}::zero_suppress_data_type
typedef INT_8U anonymous_namespace{compression.cc}::nBytes_type
typedef Version::IFrameStream IFrameStream
typedef Common::OFrameStream OFrameStream

Enumerations

enum  anonymous_namespace{compression.cc}::wave_form_type {
  anonymous_namespace{compression.cc}::NO_WAVE_FORM , anonymous_namespace{compression.cc}::SAW_TOOTH_FALLING , anonymous_namespace{compression.cc}::SAW_TOOTH_PEAKS , anonymous_namespace{compression.cc}::SAW_TOOTH_RISING ,
  anonymous_namespace{compression.cc}::SQUARE_WAVE , anonymous_namespace{compression.cc}::MAX_WAVE_FORM
}

Functions

bool DUMP_DATA ()
static const GPSTime FrameStart (6000000, 0)
void anonymous_namespace{compression.cc}::message_line ()
template<class T>
std::string anonymous_namespace{compression.cc}::data_name_type ()
std::string anonymous_namespace{compression.cc}::method (const FrameCPP::FrVect::compression_scheme_type Method)
template<typename T>
std::string anonymous_namespace{compression.cc}::canonical (T Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< CHAR > (CHAR Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< CHAR_U > (CHAR_U Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< INT_2U > (INT_2U Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< INT_4U > (INT_4U Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< INT_8U > (INT_8U Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< COMPLEX_8 > (COMPLEX_8 Data)
template<>
std::string anonymous_namespace{compression.cc}::canonical< COMPLEX_16 > (COMPLEX_16 Data)
template<typename T>
void anonymous_namespace{compression.cc}::gen_test_names (FrameCPP::FrVect::compression_scheme_type Method, INT_2U Level, const T Start, const T End, const T Inc, INT_4U Samples, const wave_form_type WaveForm, std::ostringstream &TestName, std::ostringstream &ChannelName)
template<class T>
void anonymous_namespace{compression.cc}::ZeroSuppressCompress (zero_suppress_data_type &Data, INT_8U &NBytes, INT_4U NData)
template<>
void anonymous_namespace{compression.cc}::ZeroSuppressCompress< INT_2S > (zero_suppress_data_type &Data, INT_8U &NBytes, INT_4U NData)
template<>
void anonymous_namespace{compression.cc}::ZeroSuppressCompress< INT_4S > (zero_suppress_data_type &Data, INT_8U &NBytes, INT_4U NData)
template<class T>
void anonymous_namespace{compression.cc}::ZeroSuppressUncompress (zero_suppress_data_type &Data, INT_8U &NBytes, INT_4U NData)
template<>
void anonymous_namespace{compression.cc}::ZeroSuppressUncompress< INT_2S > (zero_suppress_data_type &Data, INT_8U &NBytes, INT_4U NData)
template<>
void anonymous_namespace{compression.cc}::ZeroSuppressUncompress< INT_4S > (zero_suppress_data_type &Data, INT_8U &NBytes, INT_4U NData)
template<typename T, typename UT>
void anonymous_namespace{compression.cc}::ZeroSuppress ()
template<class T>
void anonymous_namespace{compression.cc}::Differential ()
template<class T>
void compress_base (const std::string &TestName, FrameCPP::FrVect::compression_scheme_type Method, INT_2U Level, T *Data, INT_4U Samples, FrameCPP::FrVect::compression_scheme_type OutputMethod, const std::string &ChannelName)
template<class T>
void compress (FrameCPP::FrVect::compression_scheme_type Method, INT_2U Level, const T Start, const T End, const T Inc, INT_4U Samples, waveform_compression OutputMethod, int cycles=4)
template<typename T>
void compress (FrameCPP::FrVect::compression_scheme_type Method, INT_2U Level, T *Data, INT_4U Samples, FrameCPP::FrVect::compression_scheme_type OutputMethod, const char *ChannelName)
template<class T>
void compress (FrameCPP::FrVect::compression_scheme_type Method, INT_2U Level, const T Start, const T End, const T Inc, FrameCPP::FrVect::compression_scheme_type OutputMethod)
template<class T>
void compress (FrameCPP::FrVect::compression_scheme_type Method, INT_2U Level, const T Start, const T End, const T Inc, waveform_compression OutputMethod)
void test_building_blocks ()
void test_gzip ()
void test_zstd ()
void test_raw ()
void test_diff_gzip ()
void test_diff_zstd ()
void test_zero_suppress ()
void test_zero_suppress_short ()
void test_zero_suppress_int_float ()
 BOOST_AUTO_TEST_CASE (frame_compression)

Variables

static const INT_4S TEST_GZIP_LEVEL_MIN = 1
static const INT_4S TEST_GZIP_LEVEL_MAX = 9
static const INT_4S TEST_DIFF_GZIP_LEVEL_MIN = 1
static const INT_4S TEST_DIFF_GZIP_LEVEL_MAX = 9
static const INT_4S TEST_ZSTD_LEVEL_MIN = -7
static const INT_4S TEST_ZSTD_LEVEL_MAX = 22
static const INT_4S TEST_DIFF_ZSTD_LEVEL_MIN = -7
static const INT_4S TEST_DIFF_ZSTD_LEVEL_MAX = 22
INT_2S sc1 [256]
REAL_4 sc2 []
static std::ostringstream FrameName
static const REAL_8 FrameDT = 1.0
static const INT_4S FrameRun = -1
static const INT_4U FrameNumber = 1
static const INT_4U NBits = 16
static INT_4U ChannelNumber = 1
static const char * IFO = "Z1"
static INT_2U FrameSpecVersion = FRAME_SPEC_CURRENT
static std::string SystemType
boost::shared_ptr< FrameCPP::FrameHFrame

Macro Definition Documentation

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

◆ DATA_TYPE

#define DATA_TYPE ( A,
B )
Value:
FL_DATA_TYPE( A, B ) \
template <> \
std::string data_name_type< A >( ) \
{ \
return #A; \
}
#define FL_DATA_TYPE(A, B)
Definition compression.cc:176

◆ EnableFrameL

#define EnableFrameL ( a)

◆ FL_DATA_TYPE

#define FL_DATA_TYPE ( A,
B )

◆ METHOD

#define METHOD ( A)
Value:
case FrameCPP::FrVect::A: \
return #A

◆ PROBLEM_CASES

#define PROBLEM_CASES   1

◆ TEST_BUILDING_BLOCKS

#define TEST_BUILDING_BLOCKS   1

◆ TEST_DIFF_GZIP

#define TEST_DIFF_GZIP   1

◆ TEST_DIFF_ZSTD

#define TEST_DIFF_ZSTD   1

◆ TEST_FILE_COMPARISON

#define TEST_FILE_COMPARISON   1

◆ TEST_GZIP

#define TEST_GZIP   1

◆ TEST_RAW

#define TEST_RAW   1

◆ TEST_ZERO_SUPPRESS

#define TEST_ZERO_SUPPRESS   1

◆ TEST_ZERO_SUPPRESS_INT_FLOAT

#define TEST_ZERO_SUPPRESS_INT_FLOAT   1

◆ TEST_ZERO_SUPPRESS_OTHERWISE_GZIP

#define TEST_ZERO_SUPPRESS_OTHERWISE_GZIP   1

◆ TEST_ZERO_SUPPRESS_SHORT

#define TEST_ZERO_SUPPRESS_SHORT   1

◆ TEST_ZSTD

#define TEST_ZSTD   1

Typedef Documentation

◆ data_type

◆ IFrameStream

typedef Version::IFrameStream FrameCPP::IFrameStream

◆ OFrameStream

typedef Common::OFrameStream FrameCPP::OFrameStream

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( frame_compression )

◆ compress() [1/4]

template<class T>
void compress ( FrameCPP::FrVect::compression_scheme_type Method,
INT_2U Level,
const T Start,
const T End,
const T Inc,
FrameCPP::FrVect::compression_scheme_type OutputMethod )
inline

◆ compress() [2/4]

template<class T>
void compress ( FrameCPP::FrVect::compression_scheme_type Method,
INT_2U Level,
const T Start,
const T End,
const T Inc,
INT_4U Samples,
waveform_compression OutputMethod,
int cycles = 4 )

◆ compress() [3/4]

template<class T>
void compress ( FrameCPP::FrVect::compression_scheme_type Method,
INT_2U Level,
const T Start,
const T End,
const T Inc,
waveform_compression OutputMethod )
inline

◆ compress() [4/4]

template<typename T>
void compress ( FrameCPP::FrVect::compression_scheme_type Method,
INT_2U Level,
T * Data,
INT_4U Samples,
FrameCPP::FrVect::compression_scheme_type OutputMethod,
const char * ChannelName )

◆ compress_base()

template<class T>
void compress_base ( const std::string & TestName,
FrameCPP::FrVect::compression_scheme_type Method,
INT_2U Level,
T * Data,
INT_4U Samples,
FrameCPP::FrVect::compression_scheme_type OutputMethod,
const std::string & ChannelName )

◆ DUMP_DATA()

bool DUMP_DATA ( )
inline

◆ FrameStart()

const GPSTime FrameStart ( 6000000 ,
0  )
static

◆ test_building_blocks()

void test_building_blocks ( )

◆ test_diff_gzip()

void test_diff_gzip ( )

◆ test_diff_zstd()

void test_diff_zstd ( )

◆ test_gzip()

void test_gzip ( )

◆ test_raw()

void test_raw ( )

◆ test_zero_suppress()

void test_zero_suppress ( )

◆ test_zero_suppress_int_float()

void test_zero_suppress_int_float ( )

◆ test_zero_suppress_short()

void test_zero_suppress_short ( )

◆ test_zstd()

void test_zstd ( )

Variable Documentation

◆ ChannelNumber

INT_4U ChannelNumber = 1
static

◆ Frame

boost::shared_ptr< FrameCPP::FrameH > Frame

◆ FrameDT

const REAL_8 FrameDT = 1.0
static

◆ FrameName

std::ostringstream FrameName
static

◆ FrameNumber

const INT_4U FrameNumber = 1
static

◆ FrameRun

const INT_4S FrameRun = -1
static

◆ FrameSpecVersion

INT_2U FrameSpecVersion = FRAME_SPEC_CURRENT
static

◆ IFO

const char* IFO = "Z1"
static

◆ NBits

const INT_4U NBits = 16
static

◆ sc1

INT_2S sc1[256]
Initial value:
= {
6211, 6206, 6198, 6189, 6184, 6174, 6165, 6153, 6142, 6134, 6124, 6112,
6099, 6091, 6084, 6072, 6060, 6048, 6040, 6028, 6012, 5994, 5981, 5968,
5949, 5931, 5915, 5901, 5888, 5870, 5850, 5836, 5822, 5803, 5781, 5762,
5746, 5727, 5709, 5690, 5678, 5668, 5654, 5642, 5630, 5623, 5612, 5599,
5585, 5572, 5560, 5547, 5531, 5518, 5507, 5499, 5494, 5489, 5483, 5481,
5480, 5478, 5474, 5468, 5465, 5462, 5457, 5451, 5448, 5450, 5452, 5452,
5454, 5461, 5468, 5473, 5474, 5476, 5480, 5482, 5480, 5477, 5479, 5484,
5484, 5485, 5489, 5496, 5502, 5504, 5507, 5515, 5521, 5525, 5528, 5531,
5540, 5545, 5551, 5555, 5562, 5571, 5580, 5584, 5590, 5599, 5606, 5615,
5621, 5626, 5636, 5645, 5653, 5661, 5670, 5681, 5692, 5704, 5712, 5718,
5730, 5738, 5743, 5745, 5747, 5753, 5753, 5752, 5751, 5754, 5759, 5759,
5761, 5764, 5771, 5775, 5773, 5774, 5778, 5782, 5784, 5784, 5786, 5795,
5804, 5809, 5815, 5830, 5842, 5852, 5862, 5872, 5887, 5899, 5914, 5926,
5942, 5964, 5981, 6001, 6020, 6042, 6066, 6083, 6101, 6121, 6141, 6160,
6177, 6194, 6212, 6230, 6245, 6261, 6275, 6290, 6306, 6318, 6327, 6337,
6350, 6358, 6364, 6373, 6383, 6393, 6402, 6407, 6415, 6426, 6431, 6433,
6437, 6440, 6443, 6442, 6439, 6439, 6441, 6441, 6438, 6434, 6437, 6437,
6434, 6430, 6425, 6424, 6420, 6412, 6408, 6404, 6403, 6397, 6391, 6390,
6389, 6387, 6382, 6378, 6374, 6372, 6367, 6360, 6351, 6345, 6340, 6330,
6322, 6313, 6307, 6304, 6297, 6289, 6283, 6282, 6275, 6268, 6259, 6255,
6250, 6241, 6235, 6228, 6224, 6222, 6215, 6206, 6201, 6198, 6190, 6179,
6167, 6158, 6148, 6137
}

◆ sc2

REAL_4 sc2[]
Initial value:
= {
-2.0650132e-01, -2.0650132e-01, -2.0650132e-01, -2.0650132e-01,
-2.0650132e-01, -2.0650132e-01, -2.0650132e-01, -2.0650132e-01,
-2.0650132e-01, -2.0650132e-01, -0.0000000e+00, -0.0000000e+00,
-0.0000000e+00, -0.0000000e+00, -0.0000000e+00, -0.0000000e+00
}

◆ SystemType

std::string SystemType
static
Initial value:
=
"??Bit"

◆ TEST_DIFF_GZIP_LEVEL_MAX

const INT_4S TEST_DIFF_GZIP_LEVEL_MAX = 9
static

◆ TEST_DIFF_GZIP_LEVEL_MIN

const INT_4S TEST_DIFF_GZIP_LEVEL_MIN = 1
static

◆ TEST_DIFF_ZSTD_LEVEL_MAX

const INT_4S TEST_DIFF_ZSTD_LEVEL_MAX = 22
static

◆ TEST_DIFF_ZSTD_LEVEL_MIN

const INT_4S TEST_DIFF_ZSTD_LEVEL_MIN = -7
static

◆ TEST_GZIP_LEVEL_MAX

const INT_4S TEST_GZIP_LEVEL_MAX = 9
static

◆ TEST_GZIP_LEVEL_MIN

const INT_4S TEST_GZIP_LEVEL_MIN = 1
static

◆ TEST_ZSTD_LEVEL_MAX

const INT_4S TEST_ZSTD_LEVEL_MAX = 22
static

◆ TEST_ZSTD_LEVEL_MIN

const INT_4S TEST_ZSTD_LEVEL_MIN = -7
static