/* Outputs the code length array for the Extra Set or the Position Set. */
STATIC VOID WritePTLen(IN INT32 n, IN INT32 nbit, IN INT32 Special)
/* Outputs the code length array for the Extra Set or the Position Set. */
STATIC VOID WritePTLen(IN INT32 n, IN INT32 nbit, IN INT32 Special)
{
  INT32 i, k;
  while (n > 0 && mPTLen[n - 1] == 0) {
    n--;
  }
  PutBits(nbit, n);
  i = 0;
  while (i < n) {
    k = mPTLen[i++];
    if (k <= 6) {
      PutBits(3, k);
    } else {
      PutBits(k - 3, (1U << (k - 3)) - 2);
    }
    if (i == Special) {
      while (i < 6 && mPTLen[i] == 0) {
        i++;
      }
      PutBits(2, (i - 3) & 3);
    }
  }
}