aacsbr: optimize sine level addition

Based-on commit by Måns Rullgård <mans@mansr.com>

original:   1424 decicycles in phi, 1024 runs, 0 skips
mans code:  1104 decicycles in phi, 1024 runs, 0 skips
this change: 734 decicycles in phi, 1024 runs, 0 skips

mans code:   1 file changed, 20 insertions(+), 10 deletions(-)
this change: 1 file changed, 10 insertions(+), 6 deletions(-)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-03 01:46:05 +02:00
parent e95233789c
commit 0e3cec9f7d

View File

@ -1635,13 +1635,17 @@ static void sbr_hf_assemble(float Y1[38][64][2],
q_filt, indexnoise, q_filt, indexnoise,
kx, m_max); kx, m_max);
} else { } else {
for (m = 0; m < m_max; m++) { int idx = indexsine&1;
Y1[i][m + kx][0] += int A = (1-((indexsine+(kx & 1))&2));
sbr->s_m[e][m] * phi[0][indexsine]; int B = (A^(-idx)) + idx;
Y1[i][m + kx][1] += float *out = &Y1[i][kx][idx];
sbr->s_m[e][m] * (phi[1][indexsine] * phi_sign); float *in = sbr->s_m[e];
phi_sign = -phi_sign; for (m = 0; m+1 < m_max; m+=2) {
out[2*m ] += in[m ] * A;
out[2*m+2] += in[m+1] * B;
} }
if(m_max&1)
out[2*m ] += in[m ] * A;
} }
indexnoise = (indexnoise + m_max) & 0x1ff; indexnoise = (indexnoise + m_max) & 0x1ff;
indexsine = (indexsine + 1) & 3; indexsine = (indexsine + 1) & 3;