comparison ac3.c @ 10282:934cd92921df libavcodec

cosmetics: Rename some variables to be more descriptive of their use. Do some pretty-printing as well.
author jbr
date Sun, 27 Sep 2009 04:46:56 +0000
parents 520c39d4b970
children a4b3121d4299
comparison
equal deleted inserted replaced
10281:520c39d4b970 10282:934cd92921df
96 } 96 }
97 97
98 void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd, 98 void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
99 int16_t *band_psd) 99 int16_t *band_psd)
100 { 100 {
101 int bin, j, k; 101 int bin, band;
102 102
103 /* exponent mapping to PSD */ 103 /* exponent mapping to PSD */
104 for(bin=start;bin<end;bin++) { 104 for(bin=start;bin<end;bin++) {
105 psd[bin]=(3072 - (exp[bin] << 7)); 105 psd[bin]=(3072 - (exp[bin] << 7));
106 } 106 }
107 107
108 /* PSD integration */ 108 /* PSD integration */
109 j=start; 109 bin = start;
110 k=bin_to_band_tab[start]; 110 band = bin_to_band_tab[start];
111 do { 111 do {
112 int v = psd[j++]; 112 int v = psd[bin++];
113 int end1 = FFMIN(band_start_tab[k+1], end); 113 int band_end = FFMIN(band_start_tab[band+1], end);
114 for (; j < end1; j++) { 114 for (; bin < band_end; bin++) {
115 /* logadd */ 115 /* logadd */
116 int adr = FFMIN(FFABS(v - psd[j]) >> 1, 255); 116 int adr = FFMIN(FFABS(v - psd[bin]) >> 1, 255);
117 v = FFMAX(v, psd[j]) + ff_ac3_log_add_tab[adr]; 117 v = FFMAX(v, psd[bin]) + ff_ac3_log_add_tab[adr];
118 } 118 }
119 band_psd[k]=v; 119 band_psd[band] = v;
120 k++; 120 band++;
121 } while (end > band_start_tab[k]); 121 } while (end > band_start_tab[band]);
122 } 122 }
123 123
124 int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd, 124 int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
125 int start, int end, int fast_gain, int is_lfe, 125 int start, int end, int fast_gain, int is_lfe,
126 int dba_mode, int dba_nsegs, uint8_t *dba_offsets, 126 int dba_mode, int dba_nsegs, uint8_t *dba_offsets,