/* Assign code to each symbol based on the code length array */
STATIC VOID MakeCode(IN INT32 n, IN UINT8 Len[], OUT UINT16 Code[])
/* Assign code to each symbol based on the code length array */
STATIC VOID MakeCode(IN INT32 n, IN UINT8 Len[], OUT UINT16 Code[])
{
  INT32    i;
  UINT16   Start[18];
  Start[1] = 0;
  for (i = 1; i <= 16; i++) {
    Start[i + 1] = (UINT16)((Start[i] + mLenCnt[i]) << 1);
  }
  for (i = 0; i < n; i++) {
    Code[i] = Start[Len[i]]++;
  }
}