]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qcelpdec.c
aacdec: remove sf_scale and sf_offset.
[ffmpeg] / libavcodec / qcelpdec.c
index 25ef32447531c199359d0e3f691d5ff2e3072de0..3095a2464db6fb76464e05bab7276e80a8b82773 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
  */
 
@@ -23,7 +23,7 @@
  * @file
  * 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
  */
 
@@ -92,7 +92,7 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx)
     QCELPContext *q = avctx->priv_data;
     int i;
 
-    avctx->sample_fmt = SAMPLE_FMT_FLT;
+    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
 
     for(i=0; i<10; i++)
         q->prev_lspf[i] = (i+1)/11.;
@@ -101,8 +101,8 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx)
 }
 
 /**
- * Decodes the 10 quantized LSP frequencies from the LSPV/LSP
- * transmission codes of any bitrate and checks for badly received packets.
+ * Decode the 10 quantized LSP frequencies from the LSPV/LSP
+ * transmission codes of any bitrate and check for badly received packets.
  *
  * @param q the context
  * @param lspf line spectral pair frequencies
@@ -197,7 +197,7 @@ static int decode_lspf(QCELPContext *q, float *lspf)
 }
 
 /**
- * Converts codebook transmission codes to GAIN and INDEX.
+ * Convert codebook transmission codes to GAIN and INDEX.
  *
  * @param q the context
  * @param gain array holding the decoded gain
@@ -309,7 +309,7 @@ static int codebook_sanity_check_for_rate_quarter(const uint8_t *cbgain)
 }
 
 /**
- * Computes the scaled codebook vector Cdn From INDEX and GAIN
+ * Compute the scaled codebook vector Cdn From INDEX and GAIN
  * for all rates.
  *
  * The specification lacks some information here.
@@ -564,8 +564,8 @@ static void apply_pitch_filters(QCELPContext *q, float *cdn_vector)
 }
 
 /**
- * Reconstructs LPC coefficients from the line spectral pair frequencies
- * and performs bandwidth expansion.
+ * Reconstruct LPC coefficients from the line spectral pair frequencies
+ * and perform bandwidth expansion.
  *
  * @param lspf line spectral pair frequencies
  * @param lpc linear predictive coding coefficients
@@ -594,7 +594,7 @@ static void lspf2lpc(const float *lspf, float *lpc)
 }
 
 /**
- * Interpolates LSP frequencies and computes LPC coefficients
+ * Interpolate LSP frequencies and compute LPC coefficients
  * for a given bitrate & pitch subframe.
  *
  * TIA/EIA/IS-733 2.4.3.3.4, 2.4.8.7.2
@@ -834,10 +834,6 @@ erasure:
 
     memcpy(q->formant_mem, q->formant_mem + 160, 10 * sizeof(float));
 
-    for(i=0; i<160; i++)
-        outbuffer[i] = av_clipf(outbuffer[i], QCELP_CLIP_LOWER_BOUND,
-                                QCELP_CLIP_UPPER_BOUND);
-
     memcpy(q->prev_lspf, quantized_lspf, sizeof(q->prev_lspf));
     q->prev_bitrate = q->bitrate;
 
@@ -846,7 +842,7 @@ erasure:
     return *data_size;
 }
 
-AVCodec qcelp_decoder =
+AVCodec ff_qcelp_decoder =
 {
     .name   = "qcelp",
     .type   = AVMEDIA_TYPE_AUDIO,