comparison vorbis_enc.c @ 4498:2832b65bd37e libavcodec

vorbis suffers from the same sign flip issue as wma (so this lame workaround, though it arguably doesnt matter much where the sign is fliped back)
author michael
date Wed, 07 Feb 2007 16:59:10 +0000
parents c8c591fe26f8
children 4dbe6578f811
comparison
equal deleted inserted replaced
4497:3975e734e07e 4498:2832b65bd37e
904 if (samples) { 904 if (samples) {
905 for (channel = 0; channel < venc->channels; channel++) { 905 for (channel = 0; channel < venc->channels; channel++) {
906 float * offset = venc->samples + channel*window_len*2 + window_len; 906 float * offset = venc->samples + channel*window_len*2 + window_len;
907 j = channel; 907 j = channel;
908 for (i = 0; i < samples; i++, j += venc->channels) 908 for (i = 0; i < samples; i++, j += venc->channels)
909 offset[i] = audio[j] / 32768. / n * win[window_len - i - 1]; 909 offset[i] = -audio[j] / 32768. / n * win[window_len - i - 1]; //FIXME find out why the sign has to be fliped
910 } 910 }
911 } else { 911 } else {
912 for (channel = 0; channel < venc->channels; channel++) { 912 for (channel = 0; channel < venc->channels; channel++) {
913 memset(venc->samples + channel*window_len*2 + window_len, 0, sizeof(float)*window_len); 913 memset(venc->samples + channel*window_len*2 + window_len, 0, sizeof(float)*window_len);
914 } 914 }
921 if (samples) { 921 if (samples) {
922 for (channel = 0; channel < venc->channels; channel++) { 922 for (channel = 0; channel < venc->channels; channel++) {
923 float * offset = venc->saved + channel*window_len; 923 float * offset = venc->saved + channel*window_len;
924 j = channel; 924 j = channel;
925 for (i = 0; i < samples; i++, j += venc->channels) 925 for (i = 0; i < samples; i++, j += venc->channels)
926 offset[i] = audio[j] / 32768. / n * win[i]; 926 offset[i] = -audio[j] / 32768. / n * win[i]; //FIXME find out why the sign has to be fliped
927 } 927 }
928 venc->have_saved = 1; 928 venc->have_saved = 1;
929 } else { 929 } else {
930 venc->have_saved = 0; 930 venc->have_saved = 0;
931 } 931 }