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

Marcelo Póvoa marspeoplester at gmail.com
Sun Jul 25 07:08:52 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  0ca8fed46c9ff9b50f5d51f2d1fa79d8583aedab (commit)
       via  dae60194c8f5fa005f3e74c9632c8f624b4ee33e (commit)
       via  7d21ff9007c7720896ca40a96cc1db5d4b5c7b62 (commit)
      from  97cc97cb5735e660655029a0820fb8baf7fbd256 (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 0ca8fed46c9ff9b50f5d51f2d1fa79d8583aedab
Author: Marcelo Povoa <marspeoplester at gmail.com>
Date:   Sun Jul 25 00:53:41 2010 -0300

    Improve precision in the resulting fixed vector from
    anti-sparseness processing by adapting the pitch lag

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index a5fae3d..208c7c4 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -425,7 +425,7 @@ static void decode_pitch_vector(AMRWBContext *ctx,
         decode_pitch_lag_high(&pitch_lag_int, &pitch_lag_frac, amr_subframe->adap,
                               &ctx->base_pitch_lag, subframe);
 
-    ctx->pitch_lag_int = pitch_lag_int;
+    ctx->pitch_lag_int = pitch_lag_int + (pitch_lag_frac < 0 ? -1 : 0);
     pitch_lag_int     += pitch_lag_frac > 0;
 
     /* Calculate the pitch vector by interpolating the past excitation at the
@@ -681,9 +681,6 @@ static void decode_gains(const uint8_t vq_gain, const enum Mode mode,
 static void pitch_sharpening(AMRWBContext *ctx, AMRFixed *fixed_sparse,
                              float *fixed_vector)
 {
-    /* XXX: The resulting fixed_vector is a bit different comparing
-     * to opencore, probably because the filters are applied in reverse order */
-
     /* Periodicity enhancement part */
     fixed_sparse->pitch_lag = ctx->pitch_lag_int;
     fixed_sparse->pitch_fac = 0.85;
@@ -1149,7 +1146,6 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         decode_gains(cur_subframe->vq_gain, ctx->fr_cur_mode,
                      &fixed_gain_factor, &ctx->pitch_gain[4]);
 
-        /* XXX: not tested yet */
         pitch_sharpening(ctx, &fixed_sparse, ctx->fixed_vector);
 
         ctx->fixed_gain[4] =
@@ -1164,8 +1160,6 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
                                       ctx->fixed_vector, ctx->fixed_gain[4]);
         ctx->tilt_coef = voice_fac * 0.25 + 0.25;
 
-        /* XXX: Tested against the ref code until here */
-
         /* Construct current excitation */
         for (i = 0; i < AMRWB_SUBFRAME_SIZE; i++) {
             ctx->excitation[i] *= ctx->pitch_gain[4];
@@ -1177,12 +1171,16 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         }
 
         /* Post-processing of excitation elements */
+        /* XXX: Noise_enhancer was not tested yet, needs that 1.5dB check */
         synth_fixed_gain = noise_enhancer(ctx->fixed_gain[4], &ctx->prev_tr_gain,
                                           voice_fac, stab_fac);
 
         synth_fixed_vector = anti_sparseness(ctx, ctx->fixed_vector,
                                              spare_vector);
 
+        /* XXX: Tested against the ref code until here, it "succeeds" at least
+         * for cases in which the "opencore bug" don't interfere */
+
         pitch_enhancer(synth_fixed_vector, voice_fac);
 
         if (synthesis(ctx, ctx->lp_coef[sub], synth_exc, synth_fixed_gain,

commit dae60194c8f5fa005f3e74c9632c8f624b4ee33e
Author: Marcelo Povoa <marspeoplester at gmail.com>
Date:   Sun Jul 25 00:48:37 2010 -0300

    Change reordering tables to parse individual tracks
    in the 6k60 mode pulse indexing

diff --git a/libavcodec/amrwbdata.h b/libavcodec/amrwbdata.h
index 93e76d5..d8a1068 100644
--- a/libavcodec/amrwbdata.h
+++ b/libavcodec/amrwbdata.h
@@ -97,20 +97,20 @@ static const uint16_t order_MODE_6k60[] = {
      7,   AMR_BIT(isp_id[3]),  59,  60,  61,  62,  63,  76,  77,
      6,   AMR_BIT(isp_id[4]),  78,  79,  81,  80,  82,  83,
      8,      AMR_OF(0, adap),  12,  13,  14,  15,  27,  28,  54,  66,
-    12, AMR_OF(0, pul_il[0]),  84,  92, 100, 108, 116, 124,  85,  96,
-                              104, 112, 120, 128,
+     6, AMR_OF(0, pul_il[0]),  84,  92, 100, 108, 116, 124,
+     6, AMR_OF(0, pul_il[1]),  85,  96, 104, 112, 120, 128,
      6,   AMR_OF(0, vq_gain),  33,  16,  37,  20,   4,   8,
      5,      AMR_OF(1, adap),  39,  46,  56,  68,  74,
-    12, AMR_OF(1, pul_il[0]),  86,  93, 101, 109, 117, 125,  87,  97,
-                              105, 113, 121, 129,
+     6, AMR_OF(1, pul_il[0]),  86,  93, 101, 109, 117, 125,
+     6, AMR_OF(1, pul_il[1]),  87,  97, 105, 113, 121, 129,
      6,   AMR_OF(1, vq_gain),  29,  17,  35,  21,   5,   9,
      5,      AMR_OF(2, adap),  42,  47,  53,  55,  67,
-    12, AMR_OF(2, pul_il[0]),  88,  94, 102, 110, 118, 126,  89,  98,
-                              106, 114, 122, 130,
+     6, AMR_OF(2, pul_il[0]),  88,  94, 102, 110, 118, 126,
+     6, AMR_OF(2, pul_il[1]),  89,  98, 106, 114, 122, 130,
      6,   AMR_OF(2, vq_gain),  34,  18,  36,  22,   6,  24,
      5,      AMR_OF(3, adap),  40,  41,  57,  69,  75,
-    12, AMR_OF(3, pul_il[0]),  90,  95, 103, 111, 119, 127,  91,  99,
-                              107, 115, 123, 131,
+     6, AMR_OF(3, pul_il[0]),  90,  95, 103, 111, 119, 127,
+     6, AMR_OF(3, pul_il[1]),  91,  99, 107, 115, 123, 131,
      6,   AMR_OF(3, vq_gain),  30,  19,  26,  23,   7,  25,
      0
 };

commit 7d21ff9007c7720896ca40a96cc1db5d4b5c7b62
Author: Marcelo Povoa <marspeoplester at gmail.com>
Date:   Sat Jul 24 21:23:46 2010 -0300

    Fix a bug in decoded pitch lag scale for low modes and
    remember not to apply anti_sparseness in high modes

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 0fb6da7..a5fae3d 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -404,7 +404,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
                                 AMRWB_P_DELAY_MAX - 15);
     } else {
         *lag_int  = (pitch_index + 1) >> 1;
-        *lag_frac = pitch_index - (*lag_int << 1);
+        *lag_frac = (pitch_index - (*lag_int << 1)) << 1;
         *lag_int += *base_lag_int;
     }
 }
@@ -681,6 +681,9 @@ static void decode_gains(const uint8_t vq_gain, const enum Mode mode,
 static void pitch_sharpening(AMRWBContext *ctx, AMRFixed *fixed_sparse,
                              float *fixed_vector)
 {
+    /* XXX: The resulting fixed_vector is a bit different comparing
+     * to opencore, probably because the filters are applied in reverse order */
+
     /* Periodicity enhancement part */
     fixed_sparse->pitch_lag = ctx->pitch_lag_int;
     fixed_sparse->pitch_fac = 0.85;
@@ -725,6 +728,9 @@ static float *anti_sparseness(AMRWBContext *ctx,
 {
     int ir_filter_nr;
 
+    if (ctx->fr_cur_mode > MODE_8k85) // no filtering in high modes
+        return fixed_vector;
+
     if (ctx->pitch_gain[4] < 0.6) {
         ir_filter_nr = 0;      // strong filtering
     } else if (ctx->pitch_gain[4] < 0.9) {

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

Summary of changes:
 libavcodec/amrwbdata.h |   16 ++++++++--------
 libavcodec/amrwbdec.c  |   14 +++++++++-----
 2 files changed, 17 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
AMR-WB decoder


More information about the FFmpeg-soc mailing list