dect
/
asterisk
Archived
13
0
Fork 0

Shuttle some bits around to address some gain issues with G.722.

(closes AST-209)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@194722 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
russell 2009-05-15 17:59:08 +00:00
parent f445764a45
commit de17fec21a
2 changed files with 6 additions and 6 deletions

View File

@ -370,7 +370,7 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
{
if (s->eight_k)
{
amp[outlen++] = (int16_t) rlow;
amp[outlen++] = (int16_t) (rlow << 1);
}
else
{
@ -387,8 +387,8 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
xout2 += s->x[2*i]*qmf_coeffs[i];
xout1 += s->x[2*i + 1]*qmf_coeffs[11 - i];
}
amp[outlen++] = (int16_t) (xout1 >> 12);
amp[outlen++] = (int16_t) (xout2 >> 12);
amp[outlen++] = (int16_t) (xout1 >> 11);
amp[outlen++] = (int16_t) (xout2 >> 11);
}
}
}

View File

@ -279,7 +279,7 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
{
if (s->eight_k)
{
xlow = amp[j++];
xlow = amp[j++] >> 1;
}
else
{
@ -298,8 +298,8 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
sumodd += s->x[2*i]*qmf_coeffs[i];
sumeven += s->x[2*i + 1]*qmf_coeffs[11 - i];
}
xlow = (sumeven + sumodd) >> 13;
xhigh = (sumeven - sumodd) >> 13;
xlow = (sumeven + sumodd) >> 14;
xhigh = (sumeven - sumodd) >> 14;
}
}
/* Block 1L, SUBTRA */