Module: libav
Branch: release/10
Commit: e0aa76d38a02090245284fc157afb9074e9ff073

Author:    Martin Storsjö <[email protected]>
Committer: Martin Storsjö <[email protected]>
Date:      Sat Mar 29 12:35:11 2014 +0200

golomb: Fix the implementation of get_se_golomb_long

This was only used in hevc muxing code so far.

This makes the return values match what get_se_golomb returns for
the same bitstream reader instances.

The logic for producing a signed golomb code out of an unsigned one
was based on the corresponding code in get_se_golomb, which operated
directly on the bitstream reader buffer - not on the equivalent
return value from get_ue_golomb.

CC: [email protected]
Signed-off-by: Martin Storsjö <[email protected]>
(cherry picked from commit 508a84e6726ab94a740c160b30fd8162265d1fef)
Signed-off-by: Martin Storsjö <[email protected]>

---

 libavcodec/golomb.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index ce3500f..1754706 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -211,9 +211,9 @@ static inline int get_se_golomb_long(GetBitContext *gb)
     unsigned int buf = get_ue_golomb_long(gb);
 
     if (buf & 1)
-        buf = -(buf >> 1);
+        buf = (buf + 1) >> 1;
     else
-        buf = (buf >> 1);
+        buf = -(buf >> 1);
 
     return buf;
 }

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to