Compression Source Code
Version 1.10 12/01/02 H-19
while (i < n && mCLen[i] == 0) {
i++;
Count++;
}
if (Count <= 2) {
for (k = 0; k < Count; k++) {
PutBits(mPTLen[0], mPTCode[0]);
}
} else if (Count <= 18) {
PutBits(mPTLen[1], mPTCode[1]);
PutBits(4, Count - 3);
} else if (Count == 19) {
PutBits(mPTLen[0], mPTCode[0]);
PutBits(mPTLen[1], mPTCode[1]);
PutBits(4, 15);
} else {
PutBits(mPTLen[2], mPTCode[2]);
PutBits(CBIT, Count - 20);
}
} else {
PutBits(mPTLen[k + 2], mPTCode[k + 2]);
}
}
}
STATIC
VOID
EncodeC (
IN INT32 c
)
{
PutBits(mCLen[c], mCCode[c]);
}
STATIC
VOID
EncodeP (
IN UINT32 p
)
{
UINT32 c, q;
c = 0;
q = p;
while (q) {
q >>= 1;
c++;
}
PutBits(mPTLen[c], mPTCode[c]);
if (c > 1) {
PutBits(c - 1, p & (0xFFFFU >> (17 - c)));
}
}
STATIC
VOID
SendBlock ()
/*++