[FFmpeg-soc] [soc]: r2688 - aacenc/aacenc.c
kostya
subversion at mplayerhq.hu
Sat Jul 5 12:11:55 CEST 2008
Author: kostya
Date: Sat Jul 5 12:11:55 2008
New Revision: 2688
Log:
Make MDCT output more realistic
Modified:
aacenc/aacenc.c
Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c (original)
+++ aacenc/aacenc.c Sat Jul 5 12:11:55 2008
@@ -249,10 +249,12 @@ static void analyze(AVCodecContext *avct
memcpy(s->output, cpe->ch[channel].saved, sizeof(float)*1024);
j = channel;
for (i = 0; i < 1024; i++, j += avctx->channels){
- s->output[i+1024] = audio[j] / 512 * s->kbd_long_1024[1024 - i - 1];
- cpe->ch[channel].saved[i] = audio[j] / 512 * s->kbd_long_1024[i];
+ s->output[i+1024] = audio[j] * s->kbd_long_1024[1024 - i - 1];
+ cpe->ch[channel].saved[i] = audio[j] * s->kbd_long_1024[i];
}
ff_mdct_calc(&s->mdct1024, cpe->ch[channel].coeffs, s->output, s->tmp);
+ //XXX: unelegant hack but it makes output spectrum more like other implementations
+ for(i = 0; i < 1024; i++) cpe->ch[channel].coeffs[i] /= 512;
}else{
for (k = 0; k < 1024; k += 128) {
memcpy(s->output, cpe->ch[channel].saved + k + !k*1024 - 128, sizeof(float)*128);
More information about the FFmpeg-soc
mailing list