[FFmpeg-cvslog] avcodec/vc1_block: Use av_clip_uintp2()

zhaoxiu.zeng git at videolan.org
Sat Feb 28 15:42:44 CET 2015


ffmpeg | branch: master | zhaoxiu.zeng <zhaoxiu.zeng at gmail.com> | Wed Feb 25 00:28:45 2015 +0800| [9914502264fda0b974db3fff3d3e91b4309b7c0b] | committer: Michael Niedermayer

avcodec/vc1_block: Use av_clip_uintp2()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9914502264fda0b974db3fff3d3e91b4309b7c0b
---

 libavcodec/vc1_block.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 71b0b4d..680227c 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -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];



More information about the ffmpeg-cvslog mailing list