[FFmpeg-cvslog] avcodec/golomb: cleanup

Zeng Zhaoxiu git at videolan.org
Sat Mar 7 20:27:28 CET 2015


ffmpeg | branch: master | Zeng Zhaoxiu <zhaoxiu.zeng at gmail.com> | Sat Mar  7 23:42:05 2015 +0800| [02fc168c93663ef14b8ce02a9e1362ba0ff32bbc] | committer: Michael Niedermayer

avcodec/golomb: cleanup

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/golomb.h |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 1632ee3..b9b29e7 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -215,9 +215,7 @@ 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);
-    int sign;
-
-    sign = (buf & 1) - 1;
+    int sign = (buf & 1) - 1;
     return ((buf >> 1) ^ sign) + 1;
 }
 
@@ -259,8 +257,7 @@ static inline int dirac_get_se_golomb(GetBitContext *gb)
     uint32_t ret = svq3_get_ue_golomb(gb);
 
     if (ret) {
-        int sign;
-        sign = -get_bits1(gb);
+        int sign = -get_bits1(gb);
         ret = (ret ^ sign) - sign;
     }
 
@@ -363,11 +360,7 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
                                 int esc_len)
 {
     int v = get_ur_golomb(gb, k, limit, esc_len);
-    int sign;
-
-    v++;
-    sign = (v & 1) - 1;
-    return ((v >> 1) ^ sign) - sign;
+    return (v >> 1) ^ -(v & 1);
 }
 
 /**



More information about the ffmpeg-cvslog mailing list