# HG changeset patch # User jbr # Date 1257218786 0 # Node ID 8e07155cbe04ac3877bb62df95d805a14c59f843 # Parent 40e411a184b299b6fb8ed06c88666e3368f9344a Simplify AC-3 critical band end calculation (correctly this time). diff -r 40e411a184b2 -r 8e07155cbe04 ac3.c --- a/ac3.c Tue Nov 03 02:59:18 2009 +0000 +++ b/ac3.c Tue Nov 03 03:26:26 2009 +0000 @@ -228,7 +228,7 @@ band = bin_to_band_tab[start]; do { int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor; - int band_end = FFMIN(band_start_tab[band] + ff_ac3_critical_band_size_tab[band], end); + int band_end = FFMIN(band_start_tab[band+1], end); for (; bin < band_end; bin++) { int address = av_clip((psd[bin] - m) >> 5, 0, 63); bap[bin] = bap_tab[address];