[FFmpeg-soc] [soc]AMR-WB decoder branch, master, updated.

Marcelo Póvoa marspeoplester at gmail.com
Sat Jul 3 03:00:50 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "AMR-WB decoder".

The branch, master has been updated
       via  222bb38d248bd57851851fa54e41b749eb1081e0 (commit)
      from  ae42363624c0c0379bd2dc754801bdec55eb216e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 222bb38d248bd57851851fa54e41b749eb1081e0
Author: Marcelo Povoa <marspeoplester at gmail.com>
Date:   Fri Jul 2 21:58:51 2010 -0300

    Finish decoding of the adaptive codebook

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 827b0d5..8cd0925 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -52,6 +52,8 @@ static int amrwb_decode_init(AVCodecContext *avctx)
 {
     AMRWBContext *ctx = avctx->priv_data;
     int i;
+    
+    ctx->excitation = &ctx->excitation_buf[PITCH_MAX + LP_ORDER + 1];
 
     for (i = 0; i < LP_ORDER; i++) {
         ctx->isf_q_past[i]    = isf_init[i] / (float) (1 << 15);
@@ -379,6 +381,8 @@ static void decode_pitch_vector(AMRWBContext *ctx,
                                 const int subframe)
 {
     int pitch_lag_int, pitch_lag_frac;
+    int i;
+    float *exc = ctx->excitation;
     enum Mode mode = ctx->fr_cur_mode;
     
     if (mode == MODE_6k60) {
@@ -395,12 +399,18 @@ static void decode_pitch_vector(AMRWBContext *ctx,
      
     /* Calculate the pitch vector by interpolating the past excitation at the
        pitch lag using a hamming windowed sinc function. */
-    ff_acelp_interpolatef(ctx->excitation, ctx->excitation + 1 - pitch_lag_int,
+    ff_acelp_interpolatef(exc, exc + 1 - pitch_lag_int,
                           ac_inter, 4,
                           pitch_lag_frac + 4 - 4*(pitch_lag_frac > 0),
                           LP_ORDER, AMRWB_SUBFRAME_SIZE);
 
-    memcpy(ctx->pitch_vector, ctx->excitation, AMRWB_SUBFRAME_SIZE * sizeof(float));
+    /* Check which pitch signal path should be used */
+    if (amr_subframe->ltp) {
+        memcpy(ctx->pitch_vector, exc, AMRWB_SUBFRAME_SIZE * sizeof(float));
+    } else {
+        for (i = 0; i < AMRWB_SUBFRAME_SIZE; i++)
+            ctx->pitch_vector[i] = 0.18 * exc[i - 1] + 0.64 * exc[i] + 0.18 * exc[i + 1];
+    }
 }
 
 static int amrwb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
@@ -452,11 +462,6 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     return 0;
 }
 
-static int amrwb_decode_close(AVCodecContext *avctx)
-{
-    return 0;
-}
-
 AVCodec amrwb_decoder =
 {
     .name           = "amrwb",
@@ -464,7 +469,6 @@ AVCodec amrwb_decoder =
     .id             = CODEC_ID_AMR_WB,
     .priv_data_size = sizeof(AMRWBContext),
     .init           = amrwb_decode_init,
-    .close          = amrwb_decode_close,
     .decode         = amrwb_decode_frame,
     .long_name      = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate WideBand"),
 };

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

Summary of changes:
 libavcodec/amrwbdec.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
AMR-WB decoder


More information about the FFmpeg-soc mailing list