avcodec/mjpegenc: use av_log2_16bit() in encode_block()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Dec 2013 13:08:06 +0000 (14:08 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Dec 2013 13:15:28 +0000 (14:15 +0100)
This reduces the number of operations done per non zero coefficient

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegenc.c

index 74817ca..d4db8d8 100644 (file)
@@ -441,7 +441,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
                 mant--;
             }
 
-            nbits= av_log2(val) + 1;
+            nbits= av_log2_16bit(val) + 1;
             code = (run << 4) | nbits;
 
             put_bits(&s->pb, huff_size_ac[code], huff_code_ac[code]);