Mercurial > libavcodec.hg
comparison ac3.c @ 10281:520c39d4b970 libavcodec
Move 2 variable declarations to inside of loop.
author | jbr |
---|---|
date | Sun, 27 Sep 2009 04:41:05 +0000 |
parents | 9e91066235c8 |
children | 934cd92921df |
comparison
equal
deleted
inserted
replaced
10280:9e91066235c8 | 10281:520c39d4b970 |
---|---|
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, end1, v; | 101 int bin, j, k; |
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 j=start; |
110 k=bin_to_band_tab[start]; | 110 k=bin_to_band_tab[start]; |
111 do { | 111 do { |
112 v = psd[j++]; | 112 int v = psd[j++]; |
113 end1 = FFMIN(band_start_tab[k+1], end); | 113 int end1 = FFMIN(band_start_tab[k+1], end); |
114 for (; j < end1; j++) { | 114 for (; j < end1; j++) { |
115 /* logadd */ | 115 /* logadd */ |
116 int adr = FFMIN(FFABS(v - psd[j]) >> 1, 255); | 116 int adr = FFMIN(FFABS(v - psd[j]) >> 1, 255); |
117 v = FFMAX(v, psd[j]) + ff_ac3_log_add_tab[adr]; | 117 v = FFMAX(v, psd[j]) + ff_ac3_log_add_tab[adr]; |
118 } | 118 } |