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);
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);
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;
73 if (m_sign) L=m_bits-1;
else L=m_bits;
74 unsigned int CUR=0;
int IN=0;
75 for (;
i<vf.end();++
i){
106 for (;
i<vf.end();++
i){
120 std::vector<unsigned int>::const_iterator
i=vi.begin();
128 unsigned int vecs=(
format>>6)&0xfffffff;
130 int bshift=32-m_bits;
132 vf.reserve(vi.size()*m_bits/16+17);
135 if (m_sign) L=m_bits-1;
else L=m_bits;
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) ;
164 if (m_sign)
R &= 0x7fffffff;