Fix bug in signed Exp-Golomb mapping code. Fixes ticket #313
This commit is contained in:
parent
555db6be83
commit
b4e69ca8b3
1 changed files with 3 additions and 3 deletions
|
@ -86,14 +86,14 @@ read_golomb_ue(bitstream_t *bs)
|
|||
signed int
|
||||
read_golomb_se(bitstream_t *bs)
|
||||
{
|
||||
int v, neg;
|
||||
int v, pos;
|
||||
v = read_golomb_ue(bs);
|
||||
if(v == 0)
|
||||
return 0;
|
||||
|
||||
neg = v & 1;
|
||||
pos = v & 1;
|
||||
v = (v + 1) >> 1;
|
||||
return neg ? -v : v;
|
||||
return pos ? v : -v;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue