void Coder code const char dest whWriter dest outputBuffer new cBitStr

 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
void Coder::code(const char* dest) {
whWriter(dest);
outputBuffer = new cBitStream(dest, mWrite, 0);
unsigned long int *sample = new unsigned long int;
std::cout<<"Coding..."<<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=*sample;
uint32_t k=0;
for(uint32_t i = 0; i< filesize ; i+=BIT_PER_SAMPLE) {
k+=BIT_PER_SAMPLE;
if( k > (filesize/10) ) {
std::cout<<"#";
std::cout.flush();
k=0;
}
inputBuffer->ReadBitField(&sample, BIT_PER_SAMPLE);
if(sample==NULL) break;
signal2=*sample;
DKM = signal2 - proxyFunction(signal0, signal1);
signal0 = signal1;
signal1 = signal2;
DKM>>=(BIT_PER_SAMPLE-ENC_BIT_PER_SAMPLE);
outputBuffer->WriteBitField(DKM, ENC_BIT_PER_SAMPLE);
}
std::cout<<"] 100"<<std::endl;
delete outputBuffer;
}