summaryrefslogtreecommitdiff
path: root/libavcodec/motionpixels.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/motionpixels.c')
-rw-r--r--libavcodec/motionpixels.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index da2727fdf5..c8cf00b69c 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -212,13 +212,13 @@ static void mp_decode_line(MotionPixelsContext *mp, GetBitContext *gb, int y)
p = mp_get_yuv_from_rgb(mp, x - 1, y);
} else {
p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb));
- p.y = av_clip(p.y, 0, 31);
+ p.y = av_clip_uintp2(p.y, 5);
if ((x & 3) == 0) {
if ((y & 3) == 0) {
p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb));
- p.v = av_clip(p.v, -32, 31);
+ p.v = av_clip_intp2(p.v, 5);
p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb));
- p.u = av_clip(p.u, -32, 31);
+ p.u = av_clip_intp2(p.u, 5);
mp->hpt[((y / 4) * mp->avctx->width + x) / 4] = p;
} else {
p.v = mp->hpt[((y / 4) * mp->avctx->width + x) / 4].v;
@@ -242,12 +242,12 @@ static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb)
p = mp_get_yuv_from_rgb(mp, 0, y);
} else {
p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb));
- p.y = av_clip(p.y, 0, 31);
+ p.y = av_clip_uintp2(p.y, 5);
if ((y & 3) == 0) {
p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb));
- p.v = av_clip(p.v, -32, 31);
+ p.v = av_clip_intp2(p.v, 5);
p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb));
- p.u = av_clip(p.u, -32, 31);
+ p.u = av_clip_intp2(p.u, 5);
}
mp->vpt[y] = p;
mp_set_rgb_from_yuv(mp, 0, y, &p);