xb0f0f2071b49b1cb.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:3k
源码类别:

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     internal class xb0f0f2071b49b1cb
  5.     {
  6.         private int xca3516d7e7bf3e88;
  7.         private int[] xd56734c5eb5c07a0;
  8.         private int xda0cfe0865a46405;
  9.         public xb0f0f2071b49b1cb(int defMaxCodeLen)
  10.         {
  11.             this.xda0cfe0865a46405 = defMaxCodeLen;
  12.         }
  13.         public void Build(int[] CodeLenths, int StartInx, int Count, byte[] ExtraBits, int ExtraOffset)
  14.         {
  15.             int num3;
  16.             int[] numArray = new int[0x10];
  17.             int[] numArray2 = new int[0x10];
  18.             this.xca3516d7e7bf3e88 = 0;
  19.             for (int i = 0; i < Count; i++)
  20.             {
  21.                 num3 = CodeLenths[i + StartInx];
  22.                 if (num3 > this.xca3516d7e7bf3e88)
  23.                 {
  24.                     this.xca3516d7e7bf3e88 = num3;
  25.                 }
  26.                 numArray[num3]++;
  27.             }
  28.             int num5 = x71589e3f55261426.PowerOfTwo[this.xca3516d7e7bf3e88];
  29.             this.xd56734c5eb5c07a0 = new int[num5 * 4];
  30.             int num7 = num5;
  31.             for (int j = 0; j < (num5 * 4); j++)
  32.             {
  33.                 this.xd56734c5eb5c07a0[j] = 0;
  34.             }
  35.             int num2 = 0;
  36.             numArray[0] = 0;
  37.             for (int k = 1; k <= this.xda0cfe0865a46405; k++)
  38.             {
  39.                 num2 = (num2 + numArray[k - 1]) << 1;
  40.                 numArray2[k] = num2;
  41.             }
  42.             int[] numArray3 = this.xd56734c5eb5c07a0;
  43.             for (int m = 0; m < Count; m++)
  44.             {
  45.                 num3 = CodeLenths[m + StartInx];
  46.                 if (num3 != 0)
  47.                 {
  48.                     num2 = numArray2[num3];
  49.                     int num12 = shr(num2 & 0xff00, 8);
  50.                     int index = num2 & 0xff;
  51.                     int num13 = num12;
  52.                     num12 = x71589e3f55261426.ByteRevTable[index];
  53.                     index = x71589e3f55261426.ByteRevTable[num13];
  54.                     num2 = ((num2 - (num2 & 0xffff)) + (num12 << 8)) + index;
  55.                     num2 = shr(num2, 0x10 - num3);
  56.                     int num4 = m + (num3 << 0x10);
  57.                     if (m >= ExtraOffset)
  58.                     {
  59.                         num4 += ExtraBits[m - ExtraOffset] << 0x18;
  60.                     }
  61.                     int num6 = x71589e3f55261426.PowerOfTwo[num3];
  62.                     int num = num2;
  63.                     do
  64.                     {
  65.                         numArray3[num] = num4;
  66.                         num += num6;
  67.                     }
  68.                     while (num < num7);
  69.                     numArray2[num3]++;
  70.                 }
  71.             }
  72.         }
  73.         public int Decode(int lookupBits)
  74.         {
  75.             return this.xd56734c5eb5c07a0[lookupBits];
  76.         }
  77.         public static int shr(int i, int j)
  78.         {
  79.             if (i > 0)
  80.             {
  81.                 return (i >> j);
  82.             }
  83.             return (i >> j);
  84.         }
  85.         public int MaxCodeLen
  86.         {
  87.             get
  88.             {
  89.                 return this.xca3516d7e7bf3e88;
  90.             }
  91.         }
  92.     }
  93. }