Skip to content

Commit

Permalink
fix expgolomb logic for signed value fields
Browse files Browse the repository at this point in the history
  • Loading branch information
amaha877 committed Sep 27, 2024
1 parent 4a0a19d commit f399639
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/bitstream/BitReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class BitReaderBase
//Get code num
DWORD codeNum = GetExpGolomb();
//Conver to signed
return codeNum & 0x01 ? codeNum >> 1 : -(codeNum >> 1);
return codeNum & 0x01 ? (codeNum+1) >> 1 : -(codeNum >> 1);
}

inline void Flush()
Expand Down

0 comments on commit f399639

Please sign in to comment.