diff options
author | Alex Converse <alex.converse@gmail.com> | 2010-06-05 19:41:52 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2010-06-05 19:41:52 +0000 |
commit | 614842a93da3c2d241a312f91836be867c1491d8 (patch) | |
tree | 84ea83122fd2972c2fbbe7ecf9053cd3f2ed846f /libavcodec/aacenc.c | |
parent | b8c2c41d66534e4f6d3bbe8474d1ef76fb7c8be0 (diff) | |
download | ffmpeg-614842a93da3c2d241a312f91836be867c1491d8.tar.gz |
Cleanup apply_window_and_mdct().
Originally committed as revision 23495 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r-- | libavcodec/aacenc.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index d5f8ebbda2..219a4c1e31 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -234,25 +234,21 @@ static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s, s->output[i] = sce->saved[i]; } if (sce->ics.window_sequence[0] != LONG_START_SEQUENCE) { - j = channel; - for (i = 0; i < 1024; i++, j += avctx->channels) { + for (i = 0, j = channel; i < 1024; i++, j += avctx->channels) { s->output[i+1024] = audio[j] * lwindow[1024 - i - 1]; sce->saved[i] = audio[j] * lwindow[i]; } } else { - j = channel; - for (i = 0; i < 448; i++, j += avctx->channels) + for (i = 0, j = channel; i < 448; i++, j += avctx->channels) s->output[i+1024] = audio[j]; - for (i = 448; i < 576; i++, j += avctx->channels) + for (; i < 576; i++, j += avctx->channels) s->output[i+1024] = audio[j] * swindow[576 - i - 1]; memset(s->output+1024+576, 0, sizeof(s->output[0]) * 448); - j = channel; - for (i = 0; i < 1024; i++, j += avctx->channels) + for (i = 0, j = channel; i < 1024; i++, j += avctx->channels) sce->saved[i] = audio[j]; } ff_mdct_calc(&s->mdct1024, sce->coeffs, s->output); } else { - j = channel; for (k = 0; k < 1024; k += 128) { for (i = 448 + k; i < 448 + k + 256; i++) s->output[i - 448 - k] = (i < 1024) @@ -262,8 +258,7 @@ static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s, s->dsp.vector_fmul_reverse(s->output+128, s->output+128, swindow, 128); ff_mdct_calc(&s->mdct128, sce->coeffs + k, s->output); } - j = channel; - for (i = 0; i < 1024; i++, j += avctx->channels) + for (i = 0, j = channel; i < 1024; i++, j += avctx->channels) sce->saved[i] = audio[j]; } } |