#include <Compressor.h>
Definition at line 26 of file Compressor.h.
◆ Compressor()
Compressor::Compressor |
( |
| ) |
|
|
inline |
◆ ~Compressor()
Compressor::~Compressor |
( |
| ) |
|
|
inline |
◆ expandFromUStoFloat()
void Compressor::expandFromUStoFloat |
( |
const std::vector< unsigned short > & |
vi, |
|
|
std::vector< float > & |
vf |
|
) |
| |
Definition at line 30 of file Compressor.cxx.
31 std::vector<unsigned short>::const_iterator
i=vc.begin();
32 union {
unsigned int u;
float f;}
m;
33 vf.reserve(vc.size());
34 for (;
i<vc.end();++
i){
35 unsigned int ui((*
i)<<16);
◆ expandToFloat()
void Compressor::expandToFloat |
( |
const std::vector< unsigned int > & |
vc, |
|
|
std::vector< float > & |
vf |
|
) |
| |
Definition at line 115 of file Compressor.cxx.
120 std::vector<unsigned int>::const_iterator
i=vi.begin();
128 unsigned int vecs=(
format>>6)&0xfffffff;
132 vf.reserve(vi.size()*
m_bits/16+17);
136 int CP=0;
int FP=0;
int REM=0;
137 unsigned int V=0xffffffff>>(32-L);
unsigned int R=0;
140 union {
unsigned int u;
float f;}
m;
145 R = ( ui >> (32-FP) ) & V;
159 R = ( ui & (0xffffffff >>
CP) ) << REM;
162 R |= ui >> (32-REM) ;
◆ reduce()
void Compressor::reduce |
( |
const std::vector< float > & |
vf, |
|
|
std::vector< unsigned int > & |
vi |
|
) |
| |
Definition at line 42 of file Compressor.cxx.
44 std::vector<float>::const_iterator
i=vf.begin();
45 vi.reserve(vf.size()*
m_bits/16+17);
48 unsigned int vfs=vf.size();
59 unsigned int vmax= 0x7f7<<20;
61 unsigned int rems=0xffffffff;
67 union {
unsigned int u;
float f;}
m;
74 unsigned int CUR=0;
int IN=0;
75 for (;
i<vf.end();++
i){
106 for (;
i<vf.end();++
i){
◆ reduceToUS()
void Compressor::reduceToUS |
( |
const std::vector< float > & |
vf, |
|
|
std::vector< unsigned short > & |
vi |
|
) |
| |
Definition at line 18 of file Compressor.cxx.
19 std::vector<float>::const_iterator
i=vf.begin();
20 unsigned int max_short_flt = 0x7f7f7fff;
21 union {
unsigned int u;
float f;}
m;
22 vc.reserve(vf.size());
23 for (;
i<vf.end();++
i){
25 if ( (
m.u & 0
x7fffffff) > max_short_flt) vc.push_back (
m.u>>16);
26 else vc.push_back((
m.u+0x8000)>>16);
◆ setIgnoreSign()
void Compressor::setIgnoreSign |
( |
| ) |
|
|
inline |
◆ setNrBits()
void Compressor::setNrBits |
( |
int |
bits | ) |
|
|
inline |
Definition at line 36 of file Compressor.h.
40 std::cout<<
"WARNING -> Too large compression requested. Will leave 12 bits instead!"<<std::endl;
43 else if(bits>=32 || bits==0){
44 std::cout<<
"WARNING -> Compression to "<<bits<<
" bits is not possible. Compressing to 31 bits !"<<std::endl;
◆ m_bits
◆ m_bitStrip
bool Compressor::m_bitStrip |
|
private |
◆ m_sign
The documentation for this class was generated from the following files: