RLE解压缩求助
int Rle_Decode_P( char *inbuf, int inSize, char *outbuf, int onuBufSize){
char *src = inbuf;
int i;
int decSize = 0;
int count = 0;
while(src < (inbuf + inSize))
{
char value = *src++;
int count = 1;
if((value & 0xC0) == 0xC0) /*是否有块属性标志*/
{
count = value & 0x3F; /*低位是count*/
value = *src++;
}
else
{
count = 1;
}
if((decSize + count) > onuBufSize) /*输出缓冲区空间不够了*/
{
return -1;
}
for(i = 0; i < count; i++)
{
outbuf[decSize++] = value;
}
}
return decSize;
}
呃,我这个RLE解压缩的代码怎么不太对,对了,各位有RLE解压缩的代码吗?发一下可以吗?