C语言vc6环境。关于图像算术编码的。这是其中那个关于解码的头文件,求大神改错!
/*ARITHMETIC DECODING ALGORITHM.*/
#pragma once
#include"accode.h"
/*CURRENT STATE OF THE DECODING.*/
static code_value value;
static code_value low,high; //本行有错
/*START DECODING A STREAM OF SYMBOL.*/
start_decoding()
{
int i;
value=0;
for(i=1;i<=Code_value_bits;i++)
{
value=2*value+input_bit(); //本行有错
}
low=0;
high=Top_value;
return 0;
}
/*DECODE THE NEXT SYMBOL.*/
int decode_symbol(cum_freq)
int cum_freq[]; //本行有错。。还报了两个错
{
long range;
int cum;
int symbol;
range=(long)(high-low)+1;
cum=(((long)(value-low)+1)*cum_freq[0]-1)/range;
for(symbol=1;cum_freq[symbol]>cum;symbol++);
high=low+(range*cum_freq[symbol-1])/cum_freq[0]-1;
low=low+(range*cum_freq[symbol])/cum_freq[0];
for(;;)
{
if(high<Half)
{
}
else if(low>=Half)
{
value-=Half;
low-=Half;
high-=Half;
}
else if(low>=First_qtr&&high<Third_qtr)
{
value-=First_qtr;
low-=First_qtr;
high-=First_qtr;
}
else break;
low=2*low;
high=2*high+1;
value=2*value+input_bit();
}
return symbol;
}
报错:
/*ARITHMETIC DECODING ALGORITHM.*/
#pragma once
#include"accode.h"
/*CURRENT STATE OF THE DECODING.*/
static code_value value;
static code_value low,high; //本行有错
/*START DECODING A STREAM OF SYMBOL.*/
start_decoding()
{
int i;
value=0;
for(i=1;i<=Code_value_bits;i++)
{
value=2*value+input_bit(); //本行有错
}
low=0;
high=Top_value;
return 0;
}
/*DECODE THE NEXT SYMBOL.*/
int decode_symbol(cum_freq)
int cum_freq[]; //本行有错。。还报了两个错
{
long range;
int cum;
int symbol;
range=(long)(high-low)+1;
cum=(((long)(value-low)+1)*cum_freq[0]-1)/range;
for(symbol=1;cum_freq[symbol]>cum;symbol++);
high=low+(range*cum_freq[symbol-1])/cum_freq[0]-1;
low=low+(range*cum_freq[symbol])/cum_freq[0];
for(;;)
{
if(high<Half)
{
}
else if(low>=Half)
{
value-=Half;
low-=Half;
high-=Half;
}
else if(low>=First_qtr&&high<Third_qtr)
{
value-=First_qtr;
low-=First_qtr;
high-=First_qtr;
}
else break;
low=2*low;
high=2*high+1;
value=2*value+input_bit();
}
return symbol;
}
报错: