/// <summary> /// Get the offset when compress mode is 64k /// </summary> /// <param name="offsetBitCount">the bits count offset used</param> /// <param name="actualOffsetBitCount">the bits count offset used without flag</param> private void GetOffsetFromRemain64K( OffsetBitSize64k offsetBitCount, OffsetBitSizeWithoutSymbol64k actualOffsetBitCount) { uint adding = 0; if (actualOffsetBitCount == OffsetBitSizeWithoutSymbol64k.Between64And319) { adding = (uint)OffsetAdding64k.Between64And319; } else if (actualOffsetBitCount == OffsetBitSizeWithoutSymbol64k.Between320And2367) { adding = (uint)OffsetAdding64k.Between320And2367; } else if (actualOffsetBitCount == OffsetBitSizeWithoutSymbol64k.LargerThan2368) { adding = (uint)OffsetAdding64k.LargerThan2368; } else { // adding = 0; } //get offset from high bits part of remain. //this bits are pushed to remain earlier than others offset = ((remain >> (remainBitsCount - (int)offsetBitCount)) & (uint)((1 << (int)actualOffsetBitCount) - 1)) + adding; remainBitsCount -= (int)offsetBitCount; //elimate the decoded bits remain = remain & (uint)((1 << remainBitsCount) - 1); }