summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-25 13:33:07 +0100
committerClément Bœsch <u@pkh.me>2017-03-27 21:38:21 +0200
commit5dd37c684736b3103430ffa94593726623ba3ff5 (patch)
tree95a234f199878ec0f6de4ad5a40b1969c779e114
parente6ffdc9582a220ce77af348ec49b13eb887fe88f (diff)
lavc/vp9: clarify inv_recenter_nonneg
Ends up identical to Libav.
-rw-r--r--libavcodec/vp9.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index dc0cea19e6..202b29e2eb 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