Skip to content
Snippets Groups Projects
Commit aa3a599c authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Fixes forward MDCT for overlaps that aren't a multiple of 4

Adds more sizes to test_unit_mdct.c
parent 259e1666
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar
kiss_fft_scalar * OPUS_RESTRICT yp = f;
const opus_val16 * OPUS_RESTRICT wp1 = window+(overlap>>1);
const opus_val16 * OPUS_RESTRICT wp2 = window+(overlap>>1)-1;
for(i=0;i<(overlap>>2);i++)
for(i=0;i<((overlap+3)>>2);i++)
{
/* Real part arranged as -d-cR, Imag part arranged as -b+aR*/
*yp++ = MULT16_32_Q15(*wp2, xp1[N2]) + MULT16_32_Q15(*wp1,*xp2);
......@@ -145,7 +145,7 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar
}
wp1 = window;
wp2 = window+overlap-1;
for(;i<N4-(overlap>>2);i++)
for(;i<N4-((overlap+3)>>2);i++)
{
/* Real part arranged as a-bR, Imag part arranged as -c-dR */
*yp++ = *xp2;
......
......@@ -183,15 +183,27 @@ int main(int argc,char ** argv)
test1d(256,1);
test1d(512,0);
test1d(512,1);
test1d(1024,0);
test1d(1024,1);
test1d(2048,0);
test1d(2048,1);
#ifndef RADIX_TWO_ONLY
test1d(36,0);
test1d(36,1);
test1d(40,0);
test1d(40,1);
test1d(60,0);
test1d(60,1);
test1d(120,0);
test1d(120,1);
test1d(240,0);
test1d(240,1);
test1d(480,0);
test1d(480,1);
test1d(960,0);
test1d(960,1);
test1d(1920,0);
test1d(1920,1);
#endif
}
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment