org.diracvideo.Jirac.Arithmetic.DecodeInit C# (CSharp) Method

DecodeInit() private method

private DecodeInit ( ) : void
return void
        private void DecodeInit()
        {
            cntr = 0;
            low = 0;
            range = 0xffff;
            if(size - offset > 1) {
                code = ((data[offset]&0xff)<<8) | (data[offset+1]&0xff);
                } else if(size - offset > 0) {
                code = ((data[offset]&0xff)<<8) | 0xff;
            } else {
                code = 0xffff;
            }
            offset += 2;
            shift = (size - offset > 0 ? data[offset] : (byte)0xff);
            probabilities = new int[Context.LAST];
            lut = new short[512];
            for(int i = 0; i < Context.LAST; i++) {
                probabilities[i] = 0x8000;
            }
            for(int i = 0; i < 256; i++) {
                lut[i] = Arithmetic.LUT[255-i];
                lut[256+i] = (short)(-Arithmetic.LUT[i]);
            }
        }