]> git.sesse.net Git - ffmpeg/commit
get_bits: introduce safe bitreading to prevent overreads.
authorRonald S. Bultje <rsbultje@gmail.com>
Fri, 16 Dec 2011 21:42:04 +0000 (21:42 +0000)
committerMans Rullgard <mans@mansr.com>
Sat, 17 Dec 2011 14:03:41 +0000 (14:03 +0000)
commit8cfbbd928cc94b4de6ad0a937cb818e999c7d75d
tree554918ba1509d4c296738f7e4a7313685ee92c41
parenta1e98f198e9db4e5ddfc2f777014179d3d7bc4d2
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 <lionaneesh@gmail.com>, and
inspired by patch in Chromium by Chris Evans <cevans@chromium.org>.
configure
libavcodec/get_bits.h
libavcodec/wmavoice.c