diff options
author | Nathan Caldwell <saintdev@gmail.com> | 2011-03-16 23:35:39 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-03-16 23:35:39 -0400 |
commit | 4afedfd8e5c5f102d3a67c224c33b51bbed47eee (patch) | |
tree | 222a3432ec8e2062f9d10ad3967875b7d01ac6a2 /libavcodec/aaccoder.c | |
parent | b7c96769c52a312c6f6abe43f5d8c83701118a0b (diff) | |
download | ffmpeg-4afedfd8e5c5f102d3a67c224c33b51bbed47eee.tar.gz |
aacenc: cosmetics, indentation, and comment clarification
Correct bad indentation in aaccoder
Clarify and correct comments in 3GPP psymodel, other cosmetics.
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r-- | libavcodec/aaccoder.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index d2c928205f..79723c61ef 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -146,34 +146,34 @@ static av_always_inline float quantize_and_encode_band_cost_template( curidx *= range; curidx += quants[j] + off; } - curbits = ff_aac_spectral_bits[cb-1][curidx]; - vec = &ff_aac_codebook_vectors[cb-1][curidx*dim]; - if (BT_UNSIGNED) { - for (k = 0; k < dim; k++) { - float t = fabsf(in[i+k]); - float di; - if (BT_ESC && vec[k] == 64.0f) { //FIXME: slow - if (t >= CLIPPED_ESCAPE) { - di = t - CLIPPED_ESCAPE; - curbits += 21; - } else { - int c = av_clip(quant(t, Q), 0, 8191); - di = t - c*cbrtf(c)*IQ; - curbits += av_log2(c)*2 - 4 + 1; - } + curbits = ff_aac_spectral_bits[cb-1][curidx]; + vec = &ff_aac_codebook_vectors[cb-1][curidx*dim]; + if (BT_UNSIGNED) { + for (k = 0; k < dim; k++) { + float t = fabsf(in[i+k]); + float di; + if (BT_ESC && vec[k] == 64.0f) { //FIXME: slow + if (t >= CLIPPED_ESCAPE) { + di = t - CLIPPED_ESCAPE; + curbits += 21; } else { - di = t - vec[k]*IQ; + int c = av_clip(quant(t, Q), 0, 8191); + di = t - c*cbrtf(c)*IQ; + curbits += av_log2(c)*2 - 4 + 1; } - if (vec[k] != 0.0f) - curbits++; - rd += di*di; - } - } else { - for (k = 0; k < dim; k++) { - float di = in[i+k] - vec[k]*IQ; - rd += di*di; + } else { + di = t - vec[k]*IQ; } + if (vec[k] != 0.0f) + curbits++; + rd += di*di; } + } else { + for (k = 0; k < dim; k++) { + float di = in[i+k] - vec[k]*IQ; + rd += di*di; + } + } cost += rd * lambda + curbits; resbits += curbits; if (cost >= uplim) @@ -575,7 +575,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, int qnrg = av_clip_uint8(log2f(sqrtf(qnrgf/qcnt))*4 - 31 + SCALE_ONE_POS - SCALE_DIV_512); q1 = qnrg + 30; q0 = qnrg - 30; - //av_log(NULL, AV_LOG_ERROR, "q0 %d, q1 %d\n", q0, q1); + //av_log(NULL, AV_LOG_ERROR, "q0 %d, q1 %d\n", q0, q1); if (q0 < q0low) { q1 += q0low - q0; q0 = q0low; |