Have you read this link?: Golomb coding - Wikipedia, the free encyclopedia