aboutsummaryrefslogtreecommitdiffstats
path: root/codecs
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-15 18:05:35 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-15 18:05:35 +0000
commit3182db6699903092cbb9a733cd342c4cf909b94b (patch)
tree95013b51682a4a6b11e499813f43602c56e154e4 /codecs
parent494e3ba9da60d00783e55907eeb3ccbda28324e1 (diff)
Merged revisions 194722 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r194722 | russell | 2009-05-15 12:59:08 -0500 (Fri, 15 May 2009) | 4 lines Shuttle some bits around to address some gain issues with G.722. (closes AST-209) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@194725 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs')
-rw-r--r--codecs/g722/g722_decode.c6
-rw-r--r--codecs/g722/g722_encode.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/codecs/g722/g722_decode.c b/codecs/g722/g722_decode.c
index 1625acc86..3e8f7d0c6 100644
--- a/codecs/g722/g722_decode.c
+++ b/codecs/g722/g722_decode.c
@@ -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);
}
}
}
diff --git a/codecs/g722/g722_encode.c b/codecs/g722/g722_encode.c
index ad7e6b522..5890fbf24 100644
--- a/codecs/g722/g722_encode.c
+++ b/codecs/g722/g722_encode.c
@@ -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 */