avcodec/hqx: Use av_clip_uintp2()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 10 Apr 2015 10:32:44 +0000 (12:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 10 Apr 2015 10:38:03 +0000 (12:38 +0200)
Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/hqx.c

index 1e5a018..13c74f9 100644 (file)
@@ -182,7 +182,7 @@ static void hqx_idct_put(uint16_t *dst, ptrdiff_t stride,
 
     for (i = 0; i < 8; i++) {
         for (j = 0; j < 8; j++) {
-            int v = av_clip(block[j + i * 8] + 0x800, 0, 0xFFF);
+            int v = av_clip_uintp2(block[j + i * 8] + 0x800, 12);
             dst[j] = (v << 4) | (v >> 8);
         }
         dst += stride >> 1;