[FFmpeg-cvslog] golomb: Add a get_se_golomb_long

Luca Barbato git at videolan.org
Tue Mar 11 13:12:02 CET 2014


ffmpeg | branch: release/2.2 | Luca Barbato <lu_zero at gentoo.org> | Mon Mar 10 10:57:51 2014 +0100| [6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1] | committer: Reinhard Tartler

golomb: Add a get_se_golomb_long

Useful in libavformat mostly.

(cherry picked from commit 5eacbb53289570834f9a1acb15fd406ea224eef6)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1
---

 libavcodec/golomb.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index efe5059..ce3500f 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;



More information about the ffmpeg-cvslog mailing list