summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-01-27 00:49:14 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-31 17:17:17 +0100
commit5d0139d5f0aa9fc16661891e40efdb2671ff1726 (patch)
tree9332140b61567397033d15cad4fb99e30786274e /libavcodec
parentfe1ccc1e91168c855a2720d0a195377f4638cc70 (diff)
downloadffmpeg-5d0139d5f0aa9fc16661891e40efdb2671ff1726.tar.gz
avcodec/ffv1: Simplify fold()
No speed difference, or slightly faster (the difference is too small so it may be noise that this appears faster) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ffv1.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h
index 653138b070..7c29d01f51 100644
--- a/libavcodec/ffv1.h
+++ b/libavcodec/ffv1.h
@@ -153,9 +153,7 @@ static av_always_inline int fold(int diff, int bits)
if (bits == 8)
diff = (int8_t)diff;
else {
- diff += 1 << (bits - 1);
- diff = av_mod_uintp2(diff, bits);
- diff -= 1 << (bits - 1);
+ diff = sign_extend(diff, bits);
}
return diff;