1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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>
This commit is contained in:
Michael Niedermayer 2019-01-27 00:49:14 +01:00
parent fe1ccc1e91
commit 5d0139d5f0

View File

@ -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;