Log in

View Full Version : Exp-golomb code (H.264)


vizzimani
19th March 2008, 11:49
How people are getting compression with exp-golomb code (in H.264) entropy coding method.

unsigned integer = 9
binary = 1001 (4 bits)
exp-golomb code = 000 1 010 (7 bits)


unsigned integer = 50
binary = 110010 (6 bits)
exp-golomb code = 00000 1 10011 (11 bits)

comparing normal binary with exp-golomb code, exp-golomb is taking
more bits.

akupenguin
19th March 2008, 16:55
"binary" isn't a valid bitstream.
By your count, a value of 0 would take 0 bits. But then how do you know how many 0s were supposed to be there? Likewise, bits 11 could be decoded as two 1s or one 3.

Trahald
19th March 2008, 18:57
when i first started looking at exp-golomb I sorta thought the same thing. But when you think big picture the coding is better. generally its used for variables that (can) have a wide range of possible values but can be small. A 16 bit maxsize variable has to reserve 16 bits with locked in 'binary'. For the same maxsize variable although exp golumb can use as high as 31 bits it can use as few as 1 bit.... and in the real world more often than not it will be closer 1 bit size so you save in the long run. some large variables in x264 also use exponent removers to attempt to make the values stored smaller (bitrate and cpb size for example) and more exp-golomb friendly