]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 194722 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Fri, 15 May 2009 18:05:14 +0000 (18:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 15 May 2009 18:05:14 +0000 (18:05 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@194724 65c4cc65-6c06-0410-ace0-fbb531ad65f3

codecs/g722/g722_decode.c
codecs/g722/g722_encode.c

index 1625acc860d11c4798ef1b727b15d3b7fcd19239..3e8f7d0c607143497fe4cc59f9fc392b5332fcae 100644 (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);
             }
         }
     }
index ad7e6b522bb68b5d28ef6ea1c7bc10ee5417232c..5890fbf24e537a2b44d656fd2f8bcf28cba7fc87 100644 (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 */