Created
April 7, 2015 21:42
-
-
Save Corgan/dad9aa01bae43b448ccd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint value = bb.GetBits(6); | |
if ((value & 0x30) > 0) | |
{ | |
uint a = (value >> 0x04) & 0x03; | |
uint b = (uint)((a == 0x03) ? 0x10 : 0); | |
value = (bb.GetBits((int)(4 * a + b)) << 4) | (value & 0xF); | |
} | |
return (int) (base_index + value + 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
value == 0x10 -> a = 1, b = 0 -> reads 4
value == 0x20 -> a = 2, b = 0 -> reads 8
value == 0x30 -> a = 3, b = 1 -> reads 28
same as my code :(