[asterisk-commits] russell: trunk r194722 - in /trunk/codecs/g722: g722_decode.c g722_encode.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 15 12:59:12 CDT 2009


Author: russell
Date: Fri May 15 12:59:08 2009
New Revision: 194722

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=194722
Log:
Shuttle some bits around to address some gain issues with G.722.

(closes AST-209)

Modified:
    trunk/codecs/g722/g722_decode.c
    trunk/codecs/g722/g722_encode.c

Modified: trunk/codecs/g722/g722_decode.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/codecs/g722/g722_decode.c?view=diff&rev=194722&r1=194721&r2=194722
==============================================================================
--- trunk/codecs/g722/g722_decode.c (original)
+++ trunk/codecs/g722/g722_decode.c Fri May 15 12:59:08 2009
@@ -370,7 +370,7 @@
         {
             if (s->eight_k)
             {
-                amp[outlen++] = (int16_t) rlow;
+                amp[outlen++] = (int16_t) (rlow << 1);
             }
             else
             {
@@ -387,8 +387,8 @@
                     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);
             }
         }
     }

Modified: trunk/codecs/g722/g722_encode.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/codecs/g722/g722_encode.c?view=diff&rev=194722&r1=194721&r2=194722
==============================================================================
--- trunk/codecs/g722/g722_encode.c (original)
+++ trunk/codecs/g722/g722_encode.c Fri May 15 12:59:08 2009
@@ -279,7 +279,7 @@
         {
             if (s->eight_k)
             {
-                xlow = amp[j++];
+                xlow = amp[j++] >> 1;
             }
             else
             {
@@ -298,8 +298,8 @@
                     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 */




More information about the asterisk-commits mailing list