]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qcelpdata.h
Convert some undefined 1<<31 shifts into 1U<<31.
[ffmpeg] / libavcodec / qcelpdata.h
index b1b3d9872374a00066f47e7bf20aaa89287aaa77..df33e9158c883284a0d5c3b3a3cca2126f7ef2c9 100644 (file)
@@ -2,20 +2,20 @@
  * QCELP decoder
  * Copyright (c) 2007 Reynaldo H. Verdejo Pinochet
  *
- * 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
  */
 
 #define AVCODEC_QCELPDATA_H
 
 /**
- * @file qcelpdata.h
+ * @file
  * Data tables for the QCELP decoder
  * @author Reynaldo H. Verdejo Pinochet
- * @remark FFmpeg merging spearheaded by Kenan Gillet
+ * @remark Libav merging spearheaded by Kenan Gillet
+ * @remark Development mentored by Benjamin Larson
  */
 
 #include <stddef.h>
@@ -58,6 +59,10 @@ typedef struct {
      */
     uint8_t lspv[10];
 
+    /**
+     * reserved bits only present in bitrate 1, 1/4 and 1/8 packets
+     */
+    uint8_t reserved;
 } QCELPFrame;
 
 /**
@@ -76,8 +81,6 @@ typedef struct {
 
 #define QCELP_OF(variable, bit, len) {offsetof(QCELPFrame, variable), bit, len}
 
-/* Disable the below code for now to allow 'make checkheaders' to pass. */
-#if 0
 /**
  * bitmap unpacking tables for RATE_FULL
  *
@@ -277,7 +280,6 @@ static const uint16_t qcelp_unpacking_bitmaps_lengths[5] = {
     FF_ARRAY_ELEMS(qcelp_rate_half_bitmap),
     FF_ARRAY_ELEMS(qcelp_rate_full_bitmap),
 };
-#endif
 
 typedef uint16_t qcelp_vector[2];
 
@@ -422,16 +424,6 @@ static const qcelp_vector * const qcelp_lspvq[5] = {
  */
 #define QCELP_SCALE 8192.
 
-/**
- * the upper boundary of the clipping, depends on QCELP_SCALE
- */
-#define QCELP_CLIP_UPPER_BOUND (8191.75/8192.)
-
-/**
- * the lower boundary of the clipping, depends on QCELP_SCALE
- */
-#define QCELP_CLIP_LOWER_BOUND -1.
-
 /**
  * table for computing Ga (decoded linear codebook gain magnitude)
  *
@@ -548,4 +540,13 @@ static const double qcelp_rnd_fir_coefs[11] = {
  */
 #define QCELP_LSP_OCTAVE_PREDICTOR 29.0/32
 
+/**
+ * initial coefficient to perform bandwidth expansion on LPC
+ *
+ * @note: 0.9883 looks like an approximation of 253/256.
+ *
+ * TIA/EIA/IS-733 2.4.3.3.6 6
+ */
+#define QCELP_BANDWIDTH_EXPANSION_COEFF 0.9883
+
 #endif /* AVCODEC_QCELPDATA_H */