Belle II Software development
ECLCompress.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11namespace Belle2 {
16 namespace ECL {
17
18 class BitStream;
19
21 unsigned int ilog2(unsigned int v);
22
29 struct width_t {
30 unsigned char w0,
34 };
35
40 public:
42 virtual ~ECLCompress() {};
43
48 virtual void compress(BitStream& out, const int* adc) = 0;
49
54 virtual void uncompress(BitStream& in, int* adc) = 0;
55 };
56
61 public:
62 void compress(BitStream& out, const int* adc) override;
63 void uncompress(BitStream& out, int* adc) override;
64 };
65
70 public:
74 void compress(BitStream& out, const int* adc) override;
78 void uncompress(BitStream& out, int* adc) override;
79 };
80
85 public:
91 ECLDCTCompress(double scale, double c0, width_t* w);
95 void compress(BitStream& out, const int* adc) override;
99 void uncompress(BitStream& in, int* adc) override;
100 protected:
101 const double m_scale;
102 const double m_c0;
104 };
105
110 ECLCompress* selectAlgo(int compAlgo);
111 }
113}
Bit stream struct.
Definition BitStream.h:19
ECL waveform compression/decompression to/from the BitStream storage with the BASE algorithm.
Definition ECLCompress.h:60
void compress(BitStream &out, const int *adc) override
Compress the ECL waveform.
void uncompress(BitStream &out, int *adc) override
Decompress the ECL waveform.
Abstract class (interface) for ECL waveform compression/decompression to/from the BitStream storage.
Definition ECLCompress.h:39
virtual void uncompress(BitStream &in, int *adc)=0
Decompress the ECL waveform.
virtual void compress(BitStream &out, const int *adc)=0
Compress the ECL waveform.
virtual ~ECLCompress()
virtual destructure
Definition ECLCompress.h:42
const width_t * m_widths
Bit widths for the DCT coefficients for prefix encoding.
ECLDCTCompress(double scale, double c0, width_t *w)
Constructor for DCT based compression algorithm.
void compress(BitStream &out, const int *adc) override
function to compress
const double m_scale
Scale factor for quantization.
const double m_c0
Average waveform amplitude.
void uncompress(BitStream &in, int *adc) override
function to decompress
ECL waveform compression/decompression to/from the BitStream storage with the DELTA algorithm.
Definition ECLCompress.h:69
void compress(BitStream &out, const int *adc) override
function to compress the ECL waveform with the DELTA algorithm
void uncompress(BitStream &out, int *adc) override
function to decompress the ECL waveform with the DELTA algorithm
Abstract base class for different kinds of events.
Bit widths for the prefix coding to encode integers which are mainly concentrated around zero and pro...
Definition ECLCompress.h:29
unsigned char w0
Progressive bit width to encode an integer value.
Definition ECLCompress.h:30
unsigned char w2
Progressive bit width to encode an integer value.
Definition ECLCompress.h:32
unsigned char w1
Progressive bit width to encode an integer value.
Definition ECLCompress.h:31
unsigned char w3
Progressive bit width to encode an integer value.
Definition ECLCompress.h:33