comparison ac3.c @ 10489:8e07155cbe04 libavcodec

Simplify AC-3 critical band end calculation (correctly this time).
author jbr
date Tue, 03 Nov 2009 03:26:26 +0000
parents 40e411a184b2
children 7d46c481d045
comparison
equal deleted inserted replaced
10488:40e411a184b2 10489:8e07155cbe04
226 226
227 bin = start; 227 bin = start;
228 band = bin_to_band_tab[start]; 228 band = bin_to_band_tab[start];
229 do { 229 do {
230 int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor; 230 int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
231 int band_end = FFMIN(band_start_tab[band] + ff_ac3_critical_band_size_tab[band], end); 231 int band_end = FFMIN(band_start_tab[band+1], end);
232 for (; bin < band_end; bin++) { 232 for (; bin < band_end; bin++) {
233 int address = av_clip((psd[bin] - m) >> 5, 0, 63); 233 int address = av_clip((psd[bin] - m) >> 5, 0, 63);
234 bap[bin] = bap_tab[address]; 234 bap[bin] = bap_tab[address];
235 } 235 }
236 } while (end > band_start_tab[band++]); 236 } while (end > band_start_tab[band++]);