[FFmpeg-cvslog] lavc/vp9: clarify inv_recenter_nonneg

Clément Bœsch git at videolan.org
Mon Mar 27 22:41:16 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sat Mar 25 13:33:07 2017 +0100| [5dd37c684736b3103430ffa94593726623ba3ff5] | committer: Clément Bœsch

lavc/vp9: clarify inv_recenter_nonneg

Ends up identical to Libav.

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

 libavcodec/vp9.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index dc0cea1..202b29e 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -261,7 +261,11 @@ static av_always_inline int get_sbits_inv(GetBitContext *gb, int n)
 
 static av_always_inline int inv_recenter_nonneg(int v, int m)
 {
-    return v > 2 * m ? v : v & 1 ? m - ((v + 1) >> 1) : m + (v >> 1);
+    if (v > 2 * m)
+        return v;
+    if (v & 1)
+        return m - ((v + 1) >> 1);
+    return m + (v >> 1);
 }
 
 // differential forward probability updates



More information about the ffmpeg-cvslog mailing list