[FFmpeg-soc] [soc] soc g723.1 97675db32bacb632c213985cfae96d8afa862709

naufal11 at gmail.com naufal11 at gmail.com
Wed Jun 2 15:22:51 CEST 2010



- Log -----------------------------------------------------------------
commit 97675db32bacb632c213985cfae96d8afa862709
Author: Naufal <naufal11 at gmail.com>
Date:   Wed Jun 2 18:49:52 2010 +0530

    Inverse quantize LSP vectors

diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index 42e1d88..f1bef98 100755
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -1,20 +1,28 @@
 #include "avcodec.h"
 #define ALT_BITSTREAM_READER_LE
 #include "get_bits.h"
+#include "g723_1_data.h"
 
 typedef struct g723_1_context {
-    int32_t lsp_index[LSP_BANDS];
+    int8_t lsp_index[LSP_BANDS];
+    int16_t prev_lsp[LPC_ORDER];
     int16_t pitch_lag[2];
     G723_1_Subframe subframe[4];
     FrameType cur_frame_type;
+    FrameType past_frame_type;
     Rate cur_rate;
 } G723_1_Context;
 
 static av_cold int g723_1_decode_init(AVCodecContext *avctx)
 {
+    G723_1_Context *p  = avctx->priv_data;
+
     avctx->sample_fmt  = SAMPLE_FMT_S16;
     avctx->channels    = 1;
     avctx->sample_rate = 8000;
+
+    memcpy(p->prev_lsp, dc_lsp, LPC_ORDER * sizeof(int16_t));
+
     return 0;
 }
 
@@ -131,6 +139,85 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
     return 0;
 }
 
+/*
+ * Perform inverse quantization of LSP frequencies.
+ *
+ * @param cur_lsp    the current LSP vector
+ * @param prev_lsp   the previous LSP vector
+ */
+static void inverse_quant(int16_t *cur_lsp, int16_t *prev_lsp, int8_t *lsp_index, int bad_frame)
+{
+    int min_dist, pred;
+    int i, j, temp1, temp2, stable;
+
+    // Check for frame erasure
+    if (!bad_frame) {
+        min_dist = 0x100;
+        pred = 12288;
+        lsp_index[0] *= 3;
+        lsp_index[1] *= 3;
+        lsp_index[2] *= 4;
+    } else {
+        min_dist = 0x200;
+        pred = 23552;
+        lsp_index[0] = lsp_index[1] = lsp_index[2] = 0;
+    }
+
+    // Get the VQ table entry corresponding to the transmitted index
+    cur_lsp[0] = lsp_band0[lsp_index[0]];
+    cur_lsp[1] = lsp_band0[lsp_index[0] + 1];
+    cur_lsp[2] = lsp_band0[lsp_index[0] + 2];
+    cur_lsp[3] = lsp_band1[lsp_index[1]];
+    cur_lsp[4] = lsp_band1[lsp_index[1] + 1];
+    cur_lsp[5] = lsp_band1[lsp_index[1] + 2];
+    cur_lsp[6] = lsp_band2[lsp_index[2]];
+    cur_lsp[7] = lsp_band2[lsp_index[2] + 1];
+    cur_lsp[8] = lsp_band2[lsp_index[2] + 2];
+    cur_lsp[9] = lsp_band2[lsp_index[2] + 3];
+
+    // Add predicted vector & DC component to the previously quantized vector
+    for (i = 0; i < LPC_ORDER; i++) {
+        temp1      = av_clip_int16(prev_lsp[i] - dc_lsp[i]);
+        temp2      = av_clip_int16((temp1 * pred >> 15) + 1);
+        cur_lsp[i] = av_clip_int16(cur_lsp[i] + temp2);
+        cur_lsp[i] = av_clip_int16(cur_lsp[i] + dc_lsp[i]);
+    }
+
+    for (i = 0; i < LPC_ORDER; i++) {
+        cur_lsp[0]             = FFMAX(cur_lsp[0],  0x180);
+        cur_lsp[LPC_ORDER - 1] = FFMIN(cur_lsp[LPC_ORDER - 1], 0x7e00);
+
+        // Stability check
+        for (j = 1; j < LPC_ORDER; j++) {
+            temp1 = av_clip_int16(min_dist + cur_lsp[j - 1]);
+            temp1 = av_clip_int16(temp1 - cur_lsp[j]);
+            if (temp1 > 0) {
+                temp1 >>= 1;
+                cur_lsp[j - 1] =  av_clip_int16(cur_lsp[j - 1] - temp1);
+                cur_lsp[j] =  av_clip_int16(cur_lsp[j] + temp1);
+            }
+        }
+
+        stable = 1;
+
+        for (j = 1; j < LPC_ORDER; j++) {
+            temp1 = av_clip_int16(cur_lsp[j - 1] + min_dist);
+            temp1 = av_clip_int16(temp1 - 4);
+            temp1 = av_clip_int16(temp1 - cur_lsp[j]);
+            if (temp1 > 0) {
+                stable = 0;
+                break;
+            }
+        }
+
+        if (stable)
+            break;
+    }
+
+    if (!stable)
+        memcpy(cur_lsp, prev_lsp, LPC_ORDER * sizeof(int16_t));
+}
+
 static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
                               int *data_size, AVPacket *avpkt)
 {
@@ -138,14 +225,27 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
     const uint8_t *buf = avpkt->data;
     int buf_size       = avpkt->size;
 
+    int16_t cur_lsp[LPC_ORDER];
+    int bad_frame, erased_frames;
+
     if (!buf_size || buf_size < frame_size[buf[0] & 3]) {
         *data_size = 0;
         return buf_size;
     }
 
     if (unpack_bitstream(p, buf, buf_size) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "G723.1: Bad frame\n");
-        return AVERROR_INVALIDDATA;
+        bad_frame         = 1;
+        p->cur_frame_type = p->past_frame_type == ActiveFrame ?
+                            ActiveFrame : UntransmittedFrame;
+    }
+
+    if(p->cur_frame_type == ActiveFrame) {
+        if (!bad_frame)
+            erased_frames = 0;
+        else if(erased_frames != 3)
+            erased_frames++;
+
+        inverse_quant(cur_lsp, p->prev_lsp, p->lsp_index, bad_frame);
     }
 
     return frame_size[p->cur_frame_type];
diff --git a/libavcodec/g723_1_data.h b/libavcodec/g723_1_data.h
index 82532ae..b67e6c6 100644
--- a/libavcodec/g723_1_data.h
+++ b/libavcodec/g723_1_data.h
@@ -3,6 +3,7 @@
 #define SUBFRAME_LEN (FRAME_LEN / SUBFRAMES)
 #define LPC_ORDER    10
 #define LSP_BANDS    3
+#define LSP_CB_SIZE  256
 #define PITCH_MIN    18
 #define GAIN_LEVELS  24
 
@@ -35,3 +36,798 @@ typedef struct {
     int16_t amp_index;
 } G723_1_Subframe;
 
+/*
+ * LSP DC component
+ */
+static const int16_t dc_lsp[LPC_ORDER] = {
+    0x03cb,
+    0x1271,
+    0x1e0a,
+    0x2a36,
+    0x3630,
+    0x406f,
+    0x4d28,
+    0x56f4,
+    0x638c,
+    0x6c46
+};
+
+/*
+ *  LSP VQ tables
+ */
+static const int16_t lsp_band0[LSP_CB_SIZE * 3] = {
+      0,      0,      0,
+   -270,  -1372,  -1032,
+   -541,  -1650,  -1382,
+   -723,  -2011,  -2213,
+   -941,  -1122,  -1942,
+   -780,  -1145,  -2454,
+   -884,  -1309,  -1373,
+  -1051,  -1523,  -1766,
+  -1083,  -1622,  -2300,
+   -777,  -1377,  -2147,
+   -935,  -1467,  -2763,
+   -802,  -1327,  -3471,
+   -935,  -1959,  -3999,
+   -240,    -89,    222,
+   -661,   -257,   -160,
+   -994,   -466,   -419,
+   -188,   -164,   -278,
+   -342,   -512,   -415,
+   -607,   -511,   -797,
+     16,     19,   -716,
+    374,    425,   -972,
+   -346,    245,   -282,
+   -265,    506,   -754,
+   -620,   -147,   1955,
+   -742,   -860,   2597,
+   -150,   -352,   2704,
+    305,    880,   1954,
+    123,    731,   2766,
+   -348,    765,   3327,
+    618,    221,   3258,
+   -178,    -47,   4219,
+    393,   1304,   3842,
+    698,   1702,   4801,
+     63,   -584,   1229,
+   -215,   -732,   1704,
+    172,   -335,   1909,
+     -2,    216,   1797,
+    353,    127,   2205,
+  -1208,    188,     11,
+   -513,    -75,   -683,
+   -973,    222,   -646,
+   -616,   -843,   -388,
+   -950,  -1113,   -359,
+  -1431,   -623,   -705,
+  -1398,  -1063,   -178,
+    -45,   -461,     35,
+     -9,   -657,   -216,
+    127,  -1078,     95,
+   -950,  -1156,    584,
+  -1480,  -1494,    449,
+   -120,   -705,    516,
+   -368,   -961,    727,
+   -378,   -526,    973,
+   -793,   -614,    676,
+   -801,   -755,   1287,
+  -1476,   -340,   1636,
+   -505,  -1254,   1543,
+  -1243,  -1622,   1532,
+   -776,  -1477,   -655,
+  -1151,  -1296,   -823,
+  -1153,  -1672,  -1124,
+  -1291,  -2003,  -1702,
+   -622,  -1283,     57,
+   -471,  -1611,    509,
+  -1060,  -1570,   -139,
+   -873,  -2156,   -536,
+  -1716,  -2021,   -364,
+  -2150,  -3218,  -1291,
+  -1248,  -1945,  -2904,
+  -1215,  -2633,  -2855,
+    167,   -244,     84,
+    349,   -412,   -217,
+    -40,   -352,    632,
+    227,   -529,    405,
+     68,   -383,   -443,
+    167,   -558,   -706,
+   -275,   -854,    -14,
+   -351,  -1089,   -449,
+    341,    -72,   -289,
+    603,   -106,   -474,
+    322,   -219,   -649,
+    179,   -317,   -998,
+    450,   -291,   -996,
+    555,    195,   -525,
+    784,    272,   -831,
+   -148,   -384,   -849,
+     82,   -536,  -1357,
+    238,   -172,  -1354,
+    422,   -268,  -1841,
+    297,   -737,  -2079,
+   -111,   -801,   -598,
+      1,   -668,   -984,
+   -131,   -818,  -1299,
+   -329,   -521,  -1310,
+   -151,   -778,  -1834,
+    -93,   -352,  -1746,
+   -568,   -640,  -1821,
+   -509,   -941,  -2183,
+    464,   -815,  -1250,
+     79,  -1133,  -1597,
+   -184,  -1353,  -2123,
+   -196,   -410,  -2427,
+   -192,   -833,  -2810,
+   -259,  -1382,  -3045,
+   -217,      4,  -1166,
+   -800,   -325,  -1219,
+   -363,   -830,   -898,
+   -661,  -1134,   -960,
+   -386,   -980,  -1501,
+   -627,  -1159,  -1722,
+   -903,   -829,   -855,
+   -685,   -829,  -1313,
+  -1065,   -959,  -1405,
+    441,     25,   -847,
+    655,    -27,  -1181,
+   1159,   -110,   -705,
+    856,    253,  -1671,
+    415,    404,     -1,
+    322,    903,   -398,
+    670,    499,   -292,
+    803,    591,   -610,
+   1144,    591,   -814,
+    717,    183,    393,
+    857,    381,    106,
+    609,     62,    -27,
+    792,    198,   -325,
+    735,    805,     88,
+   1142,    812,     78,
+   1028,    366,   -292,
+   1309,    743,   -237,
+   1615,    589,    -79,
+   1010,    639,   -243,
+    999,    964,   -311,
+   1500,   1137,   -615,
+    988,    357,    646,
+   1227,    667,    683,
+   1164,   1565,    894,
+   1392,   2015,    477,
+   1138,    533,    250,
+   1437,    896,    391,
+   1765,   1118,     99,
+   1112,   1090,    802,
+   1596,    846,   1134,
+    937,   1161,    279,
+   1719,   1254,    683,
+   1338,   1086,     35,
+   1419,   1324,    428,
+   1428,   1524,     40,
+   2108,   1594,     89,
+   1015,    544,   1222,
+   1121,    925,   1263,
+   1030,   1318,   1485,
+   1295,    789,   1817,
+   1323,   1272,   1909,
+   1724,   1237,   1803,
+   1797,   1689,    858,
+   2149,   1367,   1301,
+   2302,   1867,    761,
+   2863,   2351,   1053,
+     52,    163,    -76,
+    230,    309,   -492,
+    -71,    619,     39,
+   -218,    856,    499,
+   -654,    736,   -207,
+   -535,   1259,    155,
+   -480,   1476,    643,
+    262,   1081,    102,
+    309,   1592,   -182,
+    627,   1629,    534,
+    337,    643,    456,
+    758,    670,    713,
+    202,   1126,    658,
+    612,   1131,    666,
+    686,   1223,   1136,
+   -131,    377,    525,
+     42,    708,    907,
+     87,   1488,   1035,
+    432,   2117,    904,
+    137,    981,   1332,
+   -447,   1014,   1136,
+   -839,   1793,   1246,
+   -559,    297,    198,
+   -850,    685,    446,
+  -1273,    632,    826,
+   -401,   -544,    173,
+   -753,   -793,    144,
+   -436,     -9,    772,
+   -115,   -243,   1310,
+   -670,   -269,    374,
+  -1027,    -13,    639,
+   -887,    -81,   1137,
+  -1277,   -455,    158,
+  -1411,   -720,    736,
+    172,     88,    403,
+    386,    255,    756,
+   -500,    522,    910,
+   -958,    659,   1388,
+   -395,    301,   1344,
+   -356,    768,   1813,
+   -613,    841,   2419,
+    445,   -122,    252,
+    629,    -87,    723,
+    283,   -253,    870,
+    456,   -116,   1381,
+    757,    180,   1059,
+    532,    408,   1509,
+    947,    288,   1806,
+   1325,    994,   2524,
+    892,   1219,   3023,
+   1397,   1596,   3406,
+   1143,   1552,   2546,
+   1850,   1433,   2710,
+    -10,    134,   1002,
+    154,    499,   1323,
+    508,    792,   1117,
+    509,   1340,   1616,
+    762,    862,   1608,
+    787,    740,   2320,
+    794,   1727,   1283,
+    465,   2108,   1660,
+   -120,   1451,   1613,
+   -386,   2016,   2169,
+    891,   1225,   2050,
+    456,   1480,   2185,
+   1493,   1283,   1209,
+   1397,   1636,   1518,
+   1776,   1738,   1552,
+   1572,   1698,   2141,
+   1389,   2126,   1271,
+   1959,   2413,   1119,
+   1365,   2892,   1505,
+   2206,   1971,   1623,
+   2076,   1950,   2280,
+   1717,   2291,   1867,
+   2366,   2515,   1953,
+   2865,   2838,   2522,
+   2535,   3465,   2011,
+   3381,   4127,   2638,
+    836,   2667,   2289,
+   1761,   2773,   2337,
+   1415,   3325,   2911,
+   2354,   3138,   3126,
+   2659,   4192,   4010,
+   1048,   1786,   1818,
+   1242,   2111,   2240,
+   1512,   2079,   2780,
+   1573,   2491,   3138,
+   2230,   2377,   2782,
+    416,   1773,   2704,
+    725,   2336,   3297,
+   1252,   2373,   3978,
+   2094,   2268,   3568,
+   2011,   2712,   4528,
+   1341,   3507,   3876,
+   1216,   3919,   4922,
+   1693,   4793,   6012,
+};
+
+static const int16_t lsp_band1[LSP_CB_SIZE * 3] = {
+      0,      0,      0,
+  -2114,  -1302,     76,
+  -2652,  -1278,  -1368,
+  -2847,   -828,   -349,
+  -3812,  -2190,   -349,
+  -3946,   -364,   -449,
+  -2725,  -4492,  -3607,
+  -3495,  -4764,  -1744,
+    -51,   -756,     84,
+   -153,  -1191,    504,
+    108,  -1418,   1167,
+   -835,   -896,    390,
+   -569,  -1702,     87,
+  -1151,  -1818,    933,
+  -1826,  -2547,    411,
+  -1842,  -1818,   1451,
+  -2438,  -1611,    781,
+  -2747,  -2477,   1311,
+   -940,   1252,    477,
+  -1629,   1688,    602,
+  -1202,    617,    280,
+  -1737,    393,    580,
+  -1528,   1077,   1199,
+  -2165,   -161,   1408,
+  -2504,  -1087,   2371,
+  -3458,   -175,   1395,
+  -1397,    -98,   -843,
+  -2252,   -177,  -1149,
+  -1489,   -726,  -1283,
+  -1558,   -265,  -1744,
+  -1867,   -821,  -1897,
+  -2062,  -1516,  -2340,
+  -2595,  -1142,  -2861,
+    170,     46,   -819,
+   -193,   -204,  -1151,
+    326,   -196,  -1532,
+    780,    329,   -816,
+    201,    369,  -1243,
+    650,   -209,  -1060,
+   1144,    -15,  -1216,
+   1203,   -259,  -1867,
+   -890,   -564,  -1430,
+   -638,   -852,  -1921,
+    177,   -739,  -1358,
+   -261,   -526,  -1666,
+    206,   -407,  -2255,
+    338,   -526,   -822,
+    421,  -1095,  -1009,
+    765,   -607,  -1408,
+    825,  -1295,  -2004,
+    357,   -905,  -1815,
+    -58,  -1248,  -1588,
+   -596,  -1436,  -2046,
+    -73,  -1159,  -2116,
+   -115,  -1382,  -2581,
+   -160,  -1723,  -1952,
+     -6,  -2196,  -2954,
+   -649,  -1705,  -2603,
+   -617,  -1453,  -3282,
+   -949,  -2019,  -3102,
+   -812,   1544,   1937,
+  -1854,    574,   2000,
+  -1463,   1140,   2649,
+  -2683,   1748,   1452,
+  -2486,   2241,   2523,
+    783,   1910,   1435,
+    581,   2682,   1376,
+    236,   2197,   1885,
+   -453,   2943,   2057,
+   -682,   2178,   2565,
+  -1342,   3201,   3328,
+   -288,   -184,    262,
+    121,   -149,   -183,
+    758,   -412,    206,
+   1038,   -204,    853,
+   1577,   -457,    700,
+    937,   -640,   -567,
+   1508,   -528,  -1024,
+   -225,   -527,   -427,
+   -564,  -1095,   -332,
+   -742,   -353,   -186,
+  -1288,   -459,     84,
+  -1853,   -484,   -274,
+  -1554,   -731,    825,
+  -2425,   -234,    382,
+  -1722,    293,   -271,
+  -2515,    425,   -564,
+  -2599,    818,    464,
+   -358,    118,   -375,
+   -613,    198,   -874,
+   -690,    683,   -324,
+  -1352,   1155,   -168,
+  -1093,    129,   -324,
+  -1184,    611,   -858,
+    433,    386,   -372,
+   -120,    486,   -634,
+    234,    851,   -631,
+    602,    128,     46,
+   1099,    410,    159,
+    715,   -145,   -424,
+   1198,    -85,   -593,
+   1390,    367,   -358,
+   1683,    362,   -964,
+   1711,    622,     45,
+   2033,    833,   -383,
+   2890,    549,   -506,
+      7,    401,     52,
+     72,    811,    415,
+    566,    668,     41,
+    467,   1218,    130,
+     68,    957,   -187,
+    -25,   1649,   -103,
+   -661,    260,    214,
+   -925,    -94,    612,
+   -321,   -422,    965,
+   -788,   -672,   1783,
+    400,   -673,    779,
+    741,   -595,   1635,
+   -161,    307,    657,
+   -382,    836,    871,
+   -814,    400,   1223,
+    364,    606,   1247,
+     57,     75,   1571,
+    151,    471,   2287,
+    -81,   1021,   1502,
+    227,   1470,   1097,
+    658,   1275,   1653,
+    664,   1478,   2377,
+    263,   -127,    444,
+    264,     89,    969,
+    794,    171,    576,
+    821,    186,   1226,
+    404,    462,    517,
+    339,    918,    794,
+   1280,   1423,    196,
+   1453,   2019,    365,
+   1615,   1481,    672,
+   2394,   1708,    508,
+    806,   1238,    573,
+    713,   1158,   1078,
+   1285,   1436,   1232,
+   1790,   1188,   1141,
+    765,    643,    864,
+   1032,    797,   1279,
+    900,    563,   1827,
+   1514,    673,   2312,
+   1544,   1129,   3240,
+   1469,   1050,   1594,
+   1945,   1318,   1988,
+   2397,   2026,   2060,
+   3538,   2057,   2620,
+   1249,   -118,     74,
+   1727,    194,    421,
+   2078,    -50,   -463,
+    970,    688,   -432,
+   1149,    952,   -110,
+   1254,   1275,   -651,
+   1386,    929,    401,
+   1960,   1167,    232,
+    407,   -752,   -243,
+    859,  -1118,    172,
+   -227,   -860,   -992,
+   -796,  -1175,  -1380,
+      8,  -1282,   -388,
+    353,  -1781,  -1037,
+   -732,   -397,   -807,
+   -853,    -28,  -1342,
+  -1229,  -1207,  -1959,
+  -1015,  -1125,  -2543,
+  -1452,  -1791,  -2725,
+  -1891,  -2416,  -3269,
+   -918,  -1629,   -783,
+   -580,  -2155,   -698,
+  -1097,  -2364,    -96,
+  -1387,  -1513,      7,
+  -1588,  -2076,   -664,
+  -1473,  -2740,   -784,
+  -2378,  -3149,    -56,
+  -2856,  -2092,   -169,
+  -3391,  -3708,    316,
+  -1176,   -890,   -614,
+  -1944,  -1061,   -800,
+   -299,  -1517,  -1000,
+   -640,  -1850,  -1526,
+  -1454,  -1536,  -1233,
+  -1890,  -1955,  -1756,
+  -1086,  -1921,  -2122,
+   -750,  -2325,  -2260,
+  -1325,  -2413,  -2673,
+  -1114,  -2542,  -3459,
+  -1341,  -2901,  -3963,
+  -1160,  -2226,  -1393,
+  -1001,  -2772,  -1573,
+  -1594,  -2641,  -1978,
+  -1534,  -3046,  -2624,
+  -2224,  -2196,   -675,
+  -2807,  -3054,  -1102,
+  -2008,  -2840,  -1186,
+  -1980,  -3332,  -1695,
+  -1715,  -3562,   -505,
+  -2527,  -4000,  -1887,
+  -2333,  -2734,  -2296,
+  -3440,  -2401,  -3211,
+  -2008,  -3528,  -3337,
+  -2247,  -3291,  -4510,
+   -475,    949,    155,
+   -149,   1365,    545,
+   -757,   1644,   1083,
+   -217,   2053,   1353,
+  -1433,   2301,   1462,
+    495,   1661,    529,
+     10,   2037,    740,
+   2082,   1898,    978,
+   2831,   2294,    911,
+    842,    793,    420,
+   1223,   1023,    863,
+   1237,    451,    780,
+   1744,    708,    822,
+   1533,    284,   1384,
+   2135,    609,   1538,
+   2305,    626,    540,
+   2368,   1187,    955,
+   2586,   1255,     -7,
+   3116,   1131,    726,
+   3431,   1730,    428,
+   2734,   1648,   1307,
+   2988,   1231,   2010,
+   3523,   2024,   1488,
+   1034,   1657,    871,
+   1206,   2163,   1036,
+   1807,   2372,   1233,
+   1808,   1769,   1493,
+   1573,   2332,   1779,
+   1216,   1609,   1866,
+   1480,   1898,   2513,
+    465,   2708,   2776,
+    771,   3638,   3338,
+   1869,   2599,   2623,
+   2825,   2745,   2468,
+   2638,   2439,   1585,
+   2094,   2970,   1308,
+   2022,   3057,   1999,
+   3428,   2912,   1816,
+   4536,   2974,   2129,
+   1046,   2563,   2086,
+   1363,   3562,   2318,
+   2511,   1891,   2984,
+   1866,   2306,   3986,
+   3272,   2924,   3682,
+   3146,   3564,   2272,
+   3592,   3968,   2822,
+   2431,   3369,   3069,
+   1931,   4709,   3090,
+   2629,   4220,   3986,
+   4639,   4056,   3664,
+   4035,   5334,   4912,
+};
+
+static const int16_t lsp_band2[LSP_CB_SIZE * 4] = {
+      0,      0,      0,      0,
+    601,    512,   -542,    334,
+    428,   1087,   -484,   -132,
+    652,    622,   -391,   -572,
+    378,    799,    141,   -860,
+   1040,    409,    112,   -554,
+   1123,    670,    -75,   -847,
+   1421,    494,   -315,  -1095,
+    787,   1001,    114,   -460,
+    988,   1672,    216,   -681,
+   1007,   1241,   -132,  -1247,
+   1073,    399,    186,     -5,
+   1262,    193,   -694,   -129,
+    325,    196,     51,   -641,
+    861,    -59,    350,   -458,
+   1261,    567,    586,   -346,
+   1532,    885,    210,   -517,
+   2027,    937,    113,   -792,
+   1383,   1064,    334,     38,
+   1964,   1468,    459,    133,
+   2062,   1186,    -98,   -121,
+   2577,   1445,    506,   -373,
+   2310,   1682,     -2,   -960,
+   2876,   1939,    765,    138,
+   3581,   2360,    649,   -414,
+    219,    176,   -398,   -309,
+    434,    -78,   -435,   -880,
+   -344,    301,    265,   -552,
+   -915,    470,    657,   -380,
+    419,   -432,   -163,   -453,
+    351,   -953,      8,   -562,
+    789,    -43,     20,   -958,
+    302,   -594,   -352,  -1159,
+   1040,    108,   -668,   -924,
+   1333,    210,  -1217,  -1663,
+    483,    589,   -350,  -1140,
+   1003,    824,   -802,  -1184,
+    745,     58,   -589,  -1443,
+    346,    247,   -915,  -1683,
+    270,    796,   -720,  -2043,
+   1208,    722,   -222,   -193,
+   1486,   1180,   -412,   -672,
+   1722,    179,    -69,   -521,
+   2047,    860,   -666,  -1410,
+   -146,    222,   -281,   -805,
+   -189,     90,   -114,  -1307,
+   -152,   1086,   -241,   -764,
+   -439,    733,   -601,  -1302,
+   -833,   -167,   -351,   -601,
+   -856,   -422,   -411,  -1059,
+   -747,   -355,   -582,  -1644,
+   -837,    210,   -916,  -1144,
+  -1800,     32,   -878,  -1687,
+    -48,    -23,  -1146,     52,
+   -350,   -409,  -1656,   -364,
+    265,   -728,   -858,   -577,
+    458,   -247,  -1141,   -997,
+    691,   -407,  -1988,  -1161,
+    -66,   -104,   -705,  -1249,
+   -431,    -93,  -1191,  -1844,
+    203,   -732,  -1000,  -1693,
+     10,   -832,  -1846,  -1819,
+    493,   -128,  -1436,  -1768,
+    488,   -311,  -1730,  -2540,
+   -653,   -532,  -1150,  -1172,
+  -1086,   -289,  -1706,  -1533,
+   -699,  -1205,  -1216,  -1766,
+  -1032,  -1481,  -2074,  -1523,
+   -721,  -1220,  -2277,  -2600,
+     12,   -539,  -1484,  -1131,
+    -40,   -911,  -2106,   -441,
+   -471,   -484,  -2267,  -1549,
+   -141,   -988,  -3006,  -1721,
+  -1545,  -2102,   -583,    342,
+  -1383,  -2772,   -386,    -13,
+  -2118,  -2589,  -1205,     72,
+  -2147,  -3231,   -965,    390,
+  -2949,  -3300,   -621,    637,
+  -3907,  -4138,   -865,    803,
+  -1287,   -845,   -375,   -548,
+  -1416,  -1169,   -487,  -1277,
+  -1400,  -1690,  -1027,   -418,
+  -2018,  -1909,  -1188,  -1260,
+  -1418,  -2222,  -2029,   -128,
+  -2067,  -2998,  -2693,   -310,
+   -950,  -1028,  -1538,    185,
+  -1616,   -915,  -2205,   -549,
+     19,   -821,  -1145,    352,
+    184,  -1175,  -1356,   -627,
+   -547,  -1088,  -1661,   -911,
+   -216,  -1502,  -2197,   -948,
+   -795,  -1306,  -2374,   -451,
+   -924,  -1889,  -2796,   -680,
+   -600,  -1614,  -3609,   -885,
+  -2392,  -2528,    319,    303,
+  -2908,  -2095,   -310,    573,
+  -3460,  -2141,     49,   -113,
+  -2231,   -448,    675,   -146,
+  -2805,   -532,   1231,    479,
+  -2684,   -486,   -200,    611,
+  -3525,   -971,   -198,    704,
+  -3707,    173,    349,    254,
+  -4734,  -1447,    -34,    880,
+    777,   -512,    114,    -10,
+   1250,    -66,    442,     -5,
+    604,    613,    452,   -352,
+   1224,    777,    675,  -1014,
+  -1372,    -79,  -1208,   -238,
+  -2389,    -17,  -1157,   -818,
+  -1504,   -673,  -1133,  -1060,
+  -1984,   -799,  -2005,  -1973,
+  -2037,   -798,  -1068,   -105,
+  -3190,   -899,  -1817,   -194,
+   -156,   -886,    394,   -318,
+   -258,  -1283,    551,    202,
+   -536,  -1729,    910,    331,
+   -847,  -1109,    795,   -163,
+  -1171,  -1128,    715,    519,
+  -1080,  -1319,   1685,    668,
+  -1000,  -1921,     96,    211,
+  -1487,  -2148,    831,    174,
+  -1139,   -374,    414,     -4,
+  -1517,  -1383,    396,   -352,
+  -1012,    439,    -59,   -967,
+  -1812,    706,   -440,  -1030,
+  -1971,   -329,    -34,   -827,
+  -2472,  -1588,   -151,   -606,
+  -2161,    374,   -281,     76,
+  -3012,    231,    -15,   -690,
+   1104,    566,    721,    209,
+   1685,    564,    383,     98,
+   1898,    750,    792,    -97,
+    556,    -64,    561,    -93,
+    876,    162,    913,    -22,
+    961,    675,   1296,    140,
+    756,   -396,    851,    544,
+    360,   -303,   1341,    396,
+    878,    -22,   1464,    863,
+   -309,   -273,    642,   -129,
+   -686,    -82,    842,    454,
+     -5,    -47,   1069,    998,
+    -94,    967,   1277,    298,
+   -489,    385,   1473,    746,
+   -369,   -717,   1333,    242,
+    281,   -993,   1726,    924,
+    464,    601,   1575,   1376,
+   -250,    206,   2339,   1175,
+   -438,    377,   -597,   -285,
+  -1020,    787,   -790,   -287,
+   -458,   -410,    215,    295,
+   -589,   -860,   -121,    797,
+  -1175,    122,   -437,    466,
+  -1480,   -121,    367,    924,
+    234,    323,    770,   -555,
+    145,     30,    996,     26,
+     66,    849,     93,   -145,
+   -117,   1261,    474,   -399,
+  -1495,   1051,    218,   -506,
+  -1390,    694,    994,     88,
+    616,      7,     78,    304,
+   1060,     52,    -62,    835,
+    833,    454,    649,   1359,
+   -770,    464,     47,     93,
+   -574,   1199,    -39,    379,
+    114,    -98,    488,    485,
+    727,    244,    606,    696,
+    -76,    455,    671,    546,
+   -565,    -13,    145,    819,
+   -376,    569,    448,   1128,
+    218,    122,    265,   1167,
+    230,    738,    932,   1003,
+    138,    477,     36,    450,
+    404,    787,    -73,   1000,
+    497,   1259,    387,   1231,
+     17,    207,    195,    -79,
+    562,    358,     53,   -158,
+    493,    387,    478,    189,
+    678,    831,    640,    558,
+   -197,    523,    613,     57,
+    429,    894,    769,    111,
+     67,   1174,    568,    511,
+   1242,    824,    251,    840,
+   1419,   1074,    864,    481,
+    924,   1474,    669,    724,
+   1539,   1879,    654,   1590,
+    445,    337,   1111,    541,
+    472,   1421,   1264,   1094,
+    794,    735,   1103,    668,
+   1055,    863,   1192,   1020,
+    778,   1105,    806,   1798,
+   1052,   1527,   1587,   2151,
+    881,   1552,   1265,    391,
+    726,    872,   1812,    601,
+   1469,    280,   1008,    616,
+   1403,    577,   1803,   1244,
+   1650,   1314,   1148,   1072,
+   1297,   1669,   1911,   1026,
+   2093,   1044,   2115,   1189,
+   1644,   1961,   2587,   1512,
+     25,   -315,     -9,   -106,
+    290,   -339,    428,   -444,
+    -68,   -783,    735,    772,
+    245,   -555,    468,     47,
+    334,   -895,    814,    146,
+    235,    368,   -964,   -959,
+   -203,    315,  -1566,  -1217,
+    801,     17,   -276,   -354,
+    894,   -495,   -789,   -635,
+    716,    291,  -1189,   -357,
+    560,   -260,   -733,     -2,
+    679,   -508,  -1429,    211,
+    -51,    -62,   -428,    557,
+    322,   -638,   -211,    614,
+   -878,  -1057,    -84,    -71,
+   -388,  -1415,   -167,   -318,
+   -754,  -1574,    214,   -539,
+  -1419,  -2004,    -92,   -787,
+    -47,   -856,   -347,   -255,
+     23,  -1211,   -173,    320,
+   -658,   -487,   -893,    353,
+   -783,  -1587,   -584,    507,
+  -1420,   -859,   -378,    441,
+  -2095,  -1491,   -137,    439,
+   -321,  -1450,  -1288,    -12,
+   -359,  -2113,   -553,     -8,
+   -831,  -1918,  -1561,     32,
+  -1014,  -2487,  -1359,   -939,
+   -475,   -311,   -169,   -236,
+   -907,   -426,    276,   -611,
+    -96,   -400,     50,   -710,
+   -426,  -1022,    -10,   -985,
+   -197,   -258,   -744,   -575,
+   -611,   -930,   -771,   -394,
+   -267,   -776,   -612,   -939,
+   -256,  -1346,   -802,  -1122,
+   -796,  -1570,   -825,   -754,
+    712,    876,    141,    227,
+    981,   1509,     85,    124,
+   1462,   1228,    979,    -39,
+   1734,    999,   1481,    440,
+   2293,   1116,    769,    440,
+   2504,   1480,   1241,    356,
+   2474,   1909,   1558,    810,
+    917,   1134,    607,   -134,
+    509,   1809,    781,   -123,
+   1712,   1506,    559,   -423,
+   2037,   2317,    726,   -155,
+   3031,   2676,   1203,    331,
+   3664,   3274,   1768,    531,
+   1610,   1839,    867,    183,
+   1774,   1972,   1538,     97,
+   1822,   2158,   1282,    659,
+   2222,   2758,   1818,    900,
+   3251,   2124,   1723,    996,
+   3633,   2336,   2408,   1453,
+   2923,   3517,   2567,   1318,
+};

-----------------------------------------------------------------------

Summary of changes:
 libavcodec/g723_1.c      |  106 ++++++-
 libavcodec/g723_1_data.h |  796 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 899 insertions(+), 3 deletions(-)


-- 
http://github.com/naufal/ffmpeg-soc


More information about the FFmpeg-soc mailing list