]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/g729data.h
Simplify av_log_missing_feature().
[ffmpeg] / libavcodec / g729data.h
index ee140a81b5049c583633e1d9d84858433c19c7d9..48010a76830d252e64f9289b46f2f9545179e5e1 100644 (file)
@@ -2,30 +2,29 @@
  * data for G.729 decoder
  * Copyright (c) 2007 Vladimir Voroshilov
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef FFMPEG_G729DATA_H
-#define FFMPEG_G729DATA_H
+#ifndef AVCODEC_G729DATA_H
+#define AVCODEC_G729DATA_H
 
 #include <stdint.h>
 
-/// Moving Average (MA) prediction order
-#define MA_NP                      4
+#define MA_NP                4  ///< Moving Average (MA) prediction order
 
 #define VQ_1ST_BITS          7  ///< first stage vector of quantizer (size in bits)
 #define VQ_2ND_BITS          5  ///< second stage vector of quantizer (size in bits)
@@ -40,8 +39,7 @@
  * first stage LSP codebook
  * (10-dimensional, with 128 entries (3.24 of G.729)
  */
-static const int16_t cb_lsp_1st[1<<VQ_1ST_BITS][10] =
-{ /* (2.13) */
+static const int16_t cb_lsp_1st[1<<VQ_1ST_BITS][10] = { /* (2.13) */
   { 1486,  2168,  3751,  9074, 12134, 13944, 17983, 19173, 21190, 21820},
   { 1730,  2640,  3450,  4870,  6126,  7876, 15644, 17817, 20294, 21902},
   { 1568,  2256,  3088,  4874, 11063, 13393, 18307, 19293, 21109, 21741},
@@ -176,8 +174,7 @@ static const int16_t cb_lsp_1st[1<<VQ_1ST_BITS][10] =
  * second stage LSP codebook, high and low parts
    (both 5-dimensional, with 32 entries (3.2.4 of G.729)
  */
-static const int16_t cb_lsp_2nd[1<<VQ_2ND_BITS][10] =
-{ /* (2.13) */
+static const int16_t cb_lsp_2nd[1<<VQ_2ND_BITS][10] = { /* (2.13) */
   { -435,  -815,  -742,  1033,  -518,   582, -1201,   829,    86,   385},
   { -833,  -891,   463,    -8, -1251,  1450,    72,  -231,   864,   661},
   {-1021,   231,  -306,   321,  -220,  -163,  -526,  -754, -1633,   267},
@@ -212,4 +209,70 @@ static const int16_t cb_lsp_2nd[1<<VQ_2ND_BITS][10] =
   { -163,   674,   -11,  -886,   531, -1125,  -265,  -242,   724,   934}
 };
 
-#endif // FFMPEG_G729DATA_H
+/**
+ * gain codebook (first stage), 8k mode (3.9.2 of G.729)
+ */
+static const int16_t cb_gain_1st_8k[1<<GC_1ST_IDX_BITS_8K][2] = { /*(0.14) (2.13) */
+  { 3242 ,  9949 },
+  { 1551 ,  2425 },
+  { 2678 , 27162 },
+  { 1921 ,  9291 },
+  { 1831 ,  5022 },
+  {    1 ,  1516 },
+  {  356 , 14756 },
+  {   57 ,  5404 },
+};
+
+/**
+ * gain codebook (second stage), 8k mode (3.9.2 of G.729)
+ */
+static const int16_t cb_gain_2nd_8k[1<<GC_2ND_IDX_BITS_8K][2] = { /*(1.14) (1.13) */
+  {  5142 ,   592 },
+  { 17299 ,  1861 },
+  {  6160 ,  2395 },
+  { 16112 ,  3392 },
+  {   826 ,  2005 },
+  { 18973 ,  5935 },
+  {  1994 ,     0 },
+  { 15434 ,   237 },
+  { 10573 ,  2966 },
+  { 15132 ,  4914 },
+  { 11569 ,  1196 },
+  { 14194 ,  1630 },
+  {  8091 ,  4861 },
+  { 15161 , 14276 },
+  {  9120 ,   525 },
+  { 13260 ,  3256 },
+};
+
+/**
+ * 4th order Moving Average (MA) Predictor codebook (3.2.4 of G.729)
+ */
+static const int16_t cb_ma_predictor[2][MA_NP][10] = { /* (0.15) */
+  {
+    { 8421,  9109,  9175,  8965,  9034,  9057,  8765,  8775,  9106,  8673},
+    { 7018,  7189,  7638,  7307,  7444,  7379,  7038,  6956,  6930,  6868},
+    { 5472,  4990,  5134,  5177,  5246,  5141,  5206,  5095,  4830,  5147},
+    { 4056,  3031,  2614,  3024,  2916,  2713,  3309,  3237,  2857,  3473}
+  },
+  {
+    { 7733,  7880,  8188,  8175,  8247,  8490,  8637,  8601,  8359,  7569},
+    { 4210,  3031,  2552,  3473,  3876,  3853,  4184,  4154,  3909,  3968},
+    { 3214,  1930,  1313,  2143,  2493,  2385,  2755,  2706,  2542,  2919},
+    { 3024,  1592,   940,  1631,  1723,  1579,  2034,  2084,  1913,  2601}
+  }
+};
+
+static const int16_t cb_ma_predictor_sum[2][10] = { /* (0.15) */
+  { 7798,  8447,  8205,  8293,  8126,  8477,  8447,  8703,  9043,  8604},
+  {14585, 18333, 19772, 17344, 16426, 16459, 15155, 15220, 16043, 15708}
+};
+
+/**
+ * initial LSP coefficients belongs to virtual frame preceding  the
+ * first frame of the stream
+ */
+static const int16_t lsp_init[10]= { /* (0.15) */
+   30000, 26000, 21000, 15000, 8000, 0, -8000,-15000,-21000,-26000
+};
+#endif /* AVCODEC_G729DATA_H */