#include <Compressor.h>
Definition at line 26 of file Compressor.h.
◆ Compressor()
| Compressor::Compressor |
( |
| ) |
|
|
inline |
◆ ~Compressor()
| Compressor::~Compressor |
( |
| ) |
|
|
default |
◆ expandFromUStoFloat()
| void Compressor::expandFromUStoFloat |
( |
const std::vector< unsigned short > & |
vi, |
|
|
std::vector< float > & |
vf |
|
) |
| |
Definition at line 29 of file Compressor.cxx.
30 union {
unsigned int u;
float f;}
m;
31 vf.reserve(vc.size());
32 for (
const auto&
value : vc){
33 unsigned int ui(
value << 16);
◆ expandToFloat()
| void Compressor::expandToFloat |
( |
const std::vector< unsigned int > & |
vc, |
|
|
std::vector< float > & |
vf |
|
) |
| |
Definition at line 112 of file Compressor.cxx.
117 std::vector<unsigned int>::const_iterator
i=vi.begin();
125 unsigned int vecs=(
format>>6)&0xfffffff;
129 vf.reserve(vi.size()*
m_bits/16+17);
133 int CP=0;
int FP=0;
int REM=0;
134 unsigned int V=0xffffffff>>(32-
L);
unsigned int R=0;
137 union {
unsigned int u;
float f;}
m;
142 R = ( ui >> (32-FP) ) & V;
156 R = ( ui & (0xffffffff >>
CP) ) << REM;
159 R |= ui >> (32-REM) ;
◆ reduce()
| void Compressor::reduce |
( |
const std::vector< float > & |
vf, |
|
|
std::vector< unsigned int > & |
vi |
|
) |
| |
Definition at line 40 of file Compressor.cxx.
42 vi.reserve(vf.size()*
m_bits/16+17);
45 unsigned int vfs=vf.size();
56 unsigned int vmax= 0x7f7<<20;
58 unsigned int rems=0xffffffff;
64 union {
unsigned int u;
float f;}
m;
71 unsigned int CUR=0;
int IN=0;
72 for (
const auto&
value : vf){
103 for (
const auto&
value : vf){
◆ reduceToUS()
| void Compressor::reduceToUS |
( |
const std::vector< float > & |
vf, |
|
|
std::vector< unsigned short > & |
vi |
|
) |
| |
Definition at line 18 of file Compressor.cxx.
19 constexpr
unsigned int max_short_flt = 0x7f7f7fff;
20 union {
unsigned int u;
float f;}
m;
21 vc.reserve(vf.size());
22 for (
const auto&
value : vf){
24 if ( (
m.u & 0
x7fffffff) > max_short_flt) vc.push_back (
m.u>>16);
25 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: