diff options
author | Clément Bœsch <u@pkh.me> | 2017-03-25 13:33:07 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-03-27 21:38:21 +0200 |
commit | 5dd37c684736b3103430ffa94593726623ba3ff5 (patch) | |
tree | 95a234f199878ec0f6de4ad5a40b1969c779e114 /libavcodec/vp9.c | |
parent | e6ffdc9582a220ce77af348ec49b13eb887fe88f (diff) | |
download | ffmpeg-5dd37c684736b3103430ffa94593726623ba3ff5.tar.gz |
lavc/vp9: clarify inv_recenter_nonneg
Ends up identical to Libav.
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r-- | libavcodec/vp9.c | 6 |
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 |