fixed-point: converted denormalise_bands()
This commit is contained in:
parent
a31899f0e2
commit
7e94cc4d95
2 changed files with 6 additions and 3 deletions
|
@ -143,17 +143,20 @@ void renormalise_bands(const CELTMode *m, celt_norm_t *X)
|
||||||
void denormalise_bands(const CELTMode *m, const celt_norm_t *X, celt_sig_t *freq, const celt_ener_t *bank)
|
void denormalise_bands(const CELTMode *m, const celt_norm_t *X, celt_sig_t *freq, const celt_ener_t *bank)
|
||||||
{
|
{
|
||||||
int i, c, B, C;
|
int i, c, B, C;
|
||||||
|
const celt_word16_t sqrtC_1[2] = {QCONST16(1.f, 14), QCONST16(1.414214f, 14)};
|
||||||
const int *eBands = m->eBands;
|
const int *eBands = m->eBands;
|
||||||
B = m->nbMdctBlocks;
|
B = m->nbMdctBlocks;
|
||||||
C = m->nbChannels;
|
C = m->nbChannels;
|
||||||
|
if (C>2)
|
||||||
|
celt_fatal("denormalise_bands() not implemented for >2 channels");
|
||||||
for (c=0;c<C;c++)
|
for (c=0;c<C;c++)
|
||||||
{
|
{
|
||||||
for (i=0;i<m->nbEBands;i++)
|
for (i=0;i<m->nbEBands;i++)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
float g = ENER_SCALING_1*sqrt(C)*bank[i*C+c];
|
celt_word32_t g = MULT16_32_Q14(sqrtC_1[C-1],bank[i*C+c]);
|
||||||
for (j=B*eBands[i];j<B*eBands[i+1];j++)
|
for (j=B*eBands[i];j<B*eBands[i+1];j++)
|
||||||
freq[j*C+c] = NORM_SCALING_1*SIG_SCALING*X[j*C+c] * g;
|
freq[j*C+c] = MULT16_32_Q14(X[j*C+c], g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i=B*C*eBands[m->nbEBands];i<B*C*eBands[m->nbEBands+1];i++)
|
for (i=B*C*eBands[m->nbEBands];i<B*C*eBands[m->nbEBands+1];i++)
|
||||||
|
|
|
@ -219,7 +219,7 @@ int main(int argc, char *argv[])
|
||||||
sizeof(remoteAddr));
|
sizeof(remoteAddr));
|
||||||
|
|
||||||
if(rc<0) {
|
if(rc<0) {
|
||||||
printf("cannot send audio data\n");
|
perror("cannot send to socket");
|
||||||
close(sd);
|
close(sd);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue