I've been reading up on gamma codes. I see where they get the unary codes from the decimal but not where the length & offset comes from. I also understand that the gamma code is just the length (of the unary code) concatenated with the offset.
777 in binary code is 1100001001
Gamma code
VB code
In esence, VB code splits the gap (in binary) into 7 bit partitions and set the continuation bit/1st bit of last/right most 7 bits part to 1 and all other parts's continuation bit to 0.