# HG changeset patch # User jbr # Date 1254031981 0 # Node ID 40736a5ed68160a8e3043ad602f1addf3f01fc04 # Parent 73ce2d78ca89770d1c54eda75de43f4f259aa2fb Cosmetics: Rename some variables to be more descriptive of their use. diff -r 73ce2d78ca89 -r 40736a5ed681 ac3.c --- a/ac3.c Sun Sep 27 06:10:36 2009 +0000 +++ b/ac3.c Sun Sep 27 06:13:01 2009 +0000 @@ -216,7 +216,7 @@ int snr_offset, int floor, const uint8_t *bap_tab, uint8_t *bap) { - int i, j; + int bin, band; /* special case, if snr offset is -960, set all bap's to zero */ if (snr_offset == -960) { @@ -224,16 +224,16 @@ return; } - i = start; - j = bin_to_band_tab[start]; + bin = start; + band = bin_to_band_tab[start]; do { - int v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor; - int end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end); - for (; i < end1; i++) { - int address = av_clip((psd[i] - v) >> 5, 0, 63); - bap[i] = bap_tab[address]; + 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); + for (; bin < band_end; bin++) { + int address = av_clip((psd[bin] - m) >> 5, 0, 63); + bap[bin] = bap_tab[address]; } - } while (end > band_start_tab[j++]); + } while (end > band_start_tab[band++]); } /* AC-3 bit allocation. The algorithm is the one described in the AC-3