diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-03-10 13:57:51 +0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-03-11 03:53:04 +0400 |
commit | 6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1 (patch) | |
tree | 6b57ed47b7708855b89d0ac79d80254604219b8f /libavcodec/golomb.h | |
parent | 227cfc1f10a940c88ad3742ec805c07b6a5e7abb (diff) |
golomb: Add a get_se_golomb_long
Useful in libavformat mostly.
(cherry picked from commit 5eacbb53289570834f9a1acb15fd406ea224eef6)
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r-- | libavcodec/golomb.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index efe5059133..ce3500f8a9 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -206,6 +206,18 @@ static inline int get_se_golomb(GetBitContext *gb) } } +static inline int get_se_golomb_long(GetBitContext *gb) +{ + unsigned int buf = get_ue_golomb_long(gb); + + if (buf & 1) + buf = -(buf >> 1); + else + buf = (buf >> 1); + + return buf; +} + static inline int svq3_get_se_golomb(GetBitContext *gb) { unsigned int buf; |