]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/vc1_block: Use av_clip_uintp2()
authorzhaoxiu.zeng <zhaoxiu.zeng@gmail.com>
Tue, 24 Feb 2015 16:28:45 +0000 (00:28 +0800)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Feb 2015 14:29:51 +0000 (15:29 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vc1_block.c

index 71b0b4d9976c8f9fc3094c00aa4494c075f04c54..680227cfe8cdfe5a7c0f8123b6d08aa940b678cf 100644 (file)
@@ -930,7 +930,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n,
     s->bdsp.clear_block(block);
 
     /* XXX: Guard against dumb values of mquant */
-    mquant = (mquant < 1) ? 0 : ((mquant > 31) ? 31 : mquant);
+    mquant = av_clip_uintp2(mquant, 5);
 
     /* Set DC scale - y and c use the same */
     s->y_dc_scale = s->y_dc_scale_table[mquant];