From 8cfbbd928cc94b4de6ad0a937cb818e999c7d75d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 16 Dec 2011 21:42:04 +0000 Subject: get_bits: introduce safe bitreading to prevent overreads. When turned on, H264/CAVLC gets ~15% (CVPCMNL1_SVA_C.264) slower for ultra-high-bitrate files, or ~2.5% (CVFI1_SVA_C.264) for lower-bitrate files. Other codecs are affected to a lesser extent because they are less optimized; e.g., VC-1 slows down by less than 1% (all on x86). The patch generated 3 extra instructions (cmp, cmovae and mov) per call to get_bits(). The performance penalty on ARM is within the error margin for most files, up to 4% in extreme cases such as CVPCMNL1_SVA_C.264. Based on work (for GCI) by Aneesh Dogra , and inspired by patch in Chromium by Chris Evans . --- libavcodec/wmavoice.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/wmavoice.c') diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 00e985d230..8854e35d93 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -25,6 +25,8 @@ * @author Ronald S. Bultje */ +#define UNCHECKED_BITSTREAM_READER 1 + #include #include "avcodec.h" #include "get_bits.h" -- cgit v1.2.3