I couldn't measure it to be slower for normal interframe videos.
For the worst case, high-bitrate intra-only videos, it can be 0.7% slower.
Originally committed as revision 22416 to svn://svn.ffmpeg.org/ffmpeg/trunk
if (blocks_ended)
dct_tokens[j++] = blocks_ended << 2;
- while (coeff_i < num_coeffs) {
+ while (coeff_i < num_coeffs && get_bits_left(gb) > 0) {
/* decode a VLC into a token */
token = get_vlc2(gb, vlc_table, 5, 3);
/* use the token to get a zero run, a coefficient, and an eob run */