Commit d1c70508 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/hevc_mvs: Use av_clip_intp2()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d74c8d3a
......@@ -118,7 +118,7 @@ static av_always_inline void mv_scale(Mv *dst, Mv *src, int td, int tb)
td = av_clip_int8(td);
tb = av_clip_int8(tb);
tx = (0x4000 + abs(td / 2)) / td;
scale_factor = av_clip((tb * tx + 32) >> 6, -4096, 4095);
scale_factor = av_clip_intp2((tb * tx + 32) >> 6, 12);
dst->x = av_clip_int16((scale_factor * src->x + 127 +
(scale_factor * src->x < 0)) >> 8);
dst->y = av_clip_int16((scale_factor * src->y + 127 +
......
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