Mercurial > libavcodec.hg
comparison aacpsy.c @ 9938:6c1ac45b3097 libavcodec
cosmetics: Remove unnecessary {} around if/for blocks;
move statements after if/for to the next line.
author | diego |
---|---|
date | Wed, 08 Jul 2009 21:36:33 +0000 |
parents | 3e39dbd2d9eb |
children | c5ca5e520fe1 |
comparison
equal
deleted
inserted
replaced
9937:3e39dbd2d9eb | 9938:6c1ac45b3097 |
---|---|
138 coeffs->spread_hi [g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_HI); | 138 coeffs->spread_hi [g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_HI); |
139 } | 139 } |
140 start = 0; | 140 start = 0; |
141 for (g = 0; g < ctx->num_bands[j]; g++) { | 141 for (g = 0; g < ctx->num_bands[j]; g++) { |
142 minscale = ath(ctx->avctx->sample_rate * start / 1024.0, ATH_ADD); | 142 minscale = ath(ctx->avctx->sample_rate * start / 1024.0, ATH_ADD); |
143 for (i = 1; i < ctx->bands[j][g]; i++) { | 143 for (i = 1; i < ctx->bands[j][g]; i++) |
144 minscale = fminf(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD)); | 144 minscale = fminf(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD)); |
145 } | |
146 coeffs->ath[g] = minscale - minath; | 145 coeffs->ath[g] = minscale - minath; |
147 start += ctx->bands[j][g]; | 146 start += ctx->bands[j][g]; |
148 } | 147 } |
149 } | 148 } |
150 | 149 |
281 } | 280 } |
282 } | 281 } |
283 //modify thresholds - spread, threshold in quiet - 5.4.3 "Spreaded Energy Calculation" | 282 //modify thresholds - spread, threshold in quiet - 5.4.3 "Spreaded Energy Calculation" |
284 for (w = 0; w < wi->num_windows*16; w += 16) { | 283 for (w = 0; w < wi->num_windows*16; w += 16) { |
285 Psy3gppBand *band = &pch->band[w]; | 284 Psy3gppBand *band = &pch->band[w]; |
286 for (g = 1; g < num_bands; g++) { | 285 for (g = 1; g < num_bands; g++) |
287 band[g].thr = FFMAX(band[g].thr, band[g-1].thr * coeffs->spread_low[g-1]); | 286 band[g].thr = FFMAX(band[g].thr, band[g-1].thr * coeffs->spread_low[g-1]); |
288 } | 287 for (g = num_bands - 2; g >= 0; g--) |
289 for (g = num_bands - 2; g >= 0; g--) { | |
290 band[g].thr = FFMAX(band[g].thr, band[g+1].thr * coeffs->spread_hi [g]); | 288 band[g].thr = FFMAX(band[g].thr, band[g+1].thr * coeffs->spread_hi [g]); |
291 } | |
292 for (g = 0; g < num_bands; g++) { | 289 for (g = 0; g < num_bands; g++) { |
293 band[g].thr_quiet = FFMAX(band[g].thr, coeffs->ath[g]); | 290 band[g].thr_quiet = FFMAX(band[g].thr, coeffs->ath[g]); |
294 if (wi->num_windows != 8 && wi->window_type[1] != EIGHT_SHORT_SEQUENCE) { | 291 if (wi->num_windows != 8 && wi->window_type[1] != EIGHT_SHORT_SEQUENCE) |
295 band[g].thr_quiet = fmaxf(PSY_3GPP_RPEMIN*band[g].thr_quiet, | 292 band[g].thr_quiet = fmaxf(PSY_3GPP_RPEMIN*band[g].thr_quiet, |
296 fminf(band[g].thr_quiet, | 293 fminf(band[g].thr_quiet, |
297 PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet)); | 294 PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet)); |
298 } | |
299 band[g].thr = FFMAX(band[g].thr, band[g].thr_quiet * 0.25); | 295 band[g].thr = FFMAX(band[g].thr, band[g].thr_quiet * 0.25); |
300 | 296 |
301 ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].threshold = band[g].thr; | 297 ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].threshold = band[g].thr; |
302 } | 298 } |
303 } | 299 } |