Commit 5d0139d5 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent fe1ccc1e
...@@ -153,9 +153,7 @@ static av_always_inline int fold(int diff, int bits) ...@@ -153,9 +153,7 @@ static av_always_inline int fold(int diff, int bits)
if (bits == 8) if (bits == 8)
diff = (int8_t)diff; diff = (int8_t)diff;
else { else {
diff += 1 << (bits - 1); diff = sign_extend(diff, bits);
diff = av_mod_uintp2(diff, bits);
diff -= 1 << (bits - 1);
} }
return diff; return diff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment