natix.CompactDS.BitStreamCtx.Seek C# (CSharp) Method

Seek() public method

public Seek ( long offset ) : void
offset long
return void
        public void Seek(long offset)
        {
            this.Offset = offset;
        }

Usage Example

Ejemplo n.º 1
0
Archivo: RRR.cs Proyecto: Pako125/natix
 public void Build(IBitStream B, short blockSize)
 {
     this.N = (int)B.CountBits;
     this.BlockSize = (short)blockSize;
     this.InitClasses();
     this.Offsets = new BitStream32 ();
     IList<int> _L = new ListIFS (15, B);
     IList<int> L;
     if ((B.CountBits % 15) == 0) {
         L = _L;
     } else {
         int D = _L.Count;
         int C = 15 * D;
         var ctx = new BitStreamCtx(0);
         ctx.Seek(C);
         int last_block = (int)B.Read(((int)B.CountBits) - C, ctx);
         L = new ListGen<int>(delegate(int a) {
             if (a == D) {
                 return last_block;
             } else {
                 return _L[a];
             }
         }, D+1);
     }
     this.AbsRank = new int[(int)Math.Ceiling(((float)L.Count) / this.BlockSize)];
     this.AbsOffset = new int[ this.AbsRank.Count ];
     int I = 0;
     int acc = 0;
     for (int i = 0; i < L.Count; i++) {
         var u = (short)L[i];
         var klass = GetClass(u);
         this.EncodeClass(klass);
         if (i % this.BlockSize == 0) {
             this.AbsRank[I] = acc;
             this.AbsOffset[I] = (int)this.Offsets.CountBits;
             I++;
         }
         var numbits = NumBits[klass];
         if (numbits > 0) {
             int offset = this.GetOffset (u, klass);
             this.Offsets.Write (offset, numbits);
         }
         acc += klass;
     }
 }
All Usage Examples Of natix.CompactDS.BitStreamCtx::Seek