comparison ac3.c @ 10291:40736a5ed681 libavcodec

Cosmetics: Rename some variables to be more descriptive of their use.
author jbr
date Sun, 27 Sep 2009 06:13:01 +0000
parents 73ce2d78ca89
children 01e6afd0aba6
comparison
equal deleted inserted replaced
10290:73ce2d78ca89 10291:40736a5ed681
214 214
215 void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end, 215 void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
216 int snr_offset, int floor, 216 int snr_offset, int floor,
217 const uint8_t *bap_tab, uint8_t *bap) 217 const uint8_t *bap_tab, uint8_t *bap)
218 { 218 {
219 int i, j; 219 int bin, band;
220 220
221 /* special case, if snr offset is -960, set all bap's to zero */ 221 /* special case, if snr offset is -960, set all bap's to zero */
222 if (snr_offset == -960) { 222 if (snr_offset == -960) {
223 memset(bap, 0, 256); 223 memset(bap, 0, 256);
224 return; 224 return;
225 } 225 }
226 226
227 i = start; 227 bin = start;
228 j = bin_to_band_tab[start]; 228 band = bin_to_band_tab[start];
229 do { 229 do {
230 int v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor; 230 int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
231 int end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end); 231 int band_end = FFMIN(band_start_tab[band] + ff_ac3_critical_band_size_tab[band], end);
232 for (; i < end1; i++) { 232 for (; bin < band_end; bin++) {
233 int address = av_clip((psd[i] - v) >> 5, 0, 63); 233 int address = av_clip((psd[bin] - m) >> 5, 0, 63);
234 bap[i] = bap_tab[address]; 234 bap[bin] = bap_tab[address];
235 } 235 }
236 } while (end > band_start_tab[j++]); 236 } while (end > band_start_tab[band++]);
237 } 237 }
238 238
239 /* AC-3 bit allocation. The algorithm is the one described in the AC-3 239 /* AC-3 bit allocation. The algorithm is the one described in the AC-3
240 spec. */ 240 spec. */
241 void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap, 241 void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,