void Decoder decode const char dest whWriter dest outputBuffer new cBi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
void Decoder::decode(const char* dest) {
whWriter(dest);
outputBuffer = new cBitStream(dest, mWrite, 0);
unsigned long int *sample = new unsigned long int;
std::cout<<"Decoding..."<<std::endl;
inputBuffer->ReadBitField(&sample, BIT_PER_SAMPLE);
outputBuffer->WriteBitField(*sample, BIT_PER_SAMPLE);
std::cout<<"0 [";
unsigned long int DKM;
unsigned long int signal0=*sample, signal1=*sample, signal2;
uint32_t k=0;
for(uint32_t i = 0; i< filesize ; i+=ENC_BIT_PER_SAMPLE) {
k+=ENC_BIT_PER_SAMPLE;
if( k > (filesize/10) ) {
std::cout<<"#";
std::cout.flush();
k=0;
}
inputBuffer->ReadBitField(&sample, ENC_BIT_PER_SAMPLE);
if(sample==NULL) break;
*sample<<=(BIT_PER_SAMPLE-ENC_BIT_PER_SAMPLE);
signal2=*sample;
DKM = signal2 + proxyFunction(signal0, signal1);
signal0 = signal1;
signal1 = DKM;
outputBuffer->WriteBitField(DKM, BIT_PER_SAMPLE);
}
delete outputBuffer;
}