[FFmpeg-soc] [soc]: r4951 - in amr: amrnbdata.h amrnbdec.c

cmcq subversion at mplayerhq.hu
Wed Aug 5 15:40:51 CEST 2009


Author: cmcq
Date: Wed Aug  5 15:40:50 2009
New Revision: 4951

Log:
Remove DTX speech mode and RXFrameType decoding until DTX is implemented

Modified:
   amr/amrnbdata.h
   amr/amrnbdec.c

Modified: amr/amrnbdata.h
==============================================================================
--- amr/amrnbdata.h	Wed Aug  5 15:34:54 2009	(r4950)
+++ amr/amrnbdata.h	Wed Aug  5 15:40:50 2009	(r4951)
@@ -65,23 +65,6 @@ enum Mode {
     NO_DATA = 15                          ///< no transmission
 };
 
-/** Received frame types
- *
- * FIXME: are the values important? They seem to only be used by an obsolete
- * test vector format. But I haven't chased down all the references yet.
- */
-enum RXFrameType {
-    RX_SPEECH_GOOD = 0,
-    RX_SPEECH_DEGRADED,
-    RX_ONSET,
-    RX_SPEECH_BAD,
-    RX_SID_FIRST,
-    RX_SID_UPDATE,
-    RX_SID_BAD,
-    RX_NO_DATA,
-    RX_N_FRAMETYPES     // number of frame types
-};
-
 #define LP_FILTER_ORDER 10        ///< linear predictive coding filter order
 
 /**

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Wed Aug  5 15:34:54 2009	(r4950)
+++ amr/amrnbdec.c	Wed Aug  5 15:40:50 2009	(r4951)
@@ -48,7 +48,6 @@ typedef struct AMRContext {
     AMRNBFrame                        frame; ///< decoded AMR parameters (lsf coefficients, codebook indexes, etc)
     uint8_t             bad_frame_indicator; ///< bad frame ? 1 : 0
     enum Mode                cur_frame_mode; ///< current frame mode
-    enum RXFrameType         cur_frame_type; ///< current frame type
 
     float       prev_lsf_r[LP_FILTER_ORDER]; ///< residual LSF vector from previous subframe
     float           lsp[4][LP_FILTER_ORDER]; ///< lsp vectors from current frame
@@ -124,12 +123,11 @@ static av_cold int amrnb_decode_init(AVC
  * @param p the context
  * @param buf               pointer to the input buffer
  * @param buf_size          size of the input buffer
- * @param speech_mode       pointer to the speech mode
  *
  * @return the frame mode
  */
 static enum Mode decode_bitstream(AMRContext *p, const uint8_t *buf,
-                                  int buf_size, enum Mode *speech_mode)
+                                  int buf_size)
 {
     enum Mode mode;
 
@@ -149,24 +147,7 @@ static enum Mode decode_bitstream(AMRCon
         memset(&p->frame, 0, sizeof(AMRNBFrame));
         for (i = 0; i < mode_bits[mode]; i++)
             data[order[i].index] += get_bits1(&p->gb) << order[i].bit;
-
-        if (mode == MODE_DTX) {
-            p->cur_frame_type = RX_SID_FIRST;
-            if (get_bits1(&p->gb)) // SID Type Indicator
-                p->cur_frame_type = RX_SID_UPDATE;
-            /* RFC4867 specifies AMR IF1 from 3GPP TS 26.101 which reverses
-             * the Mode Indication bits. This is also used by the reference
-             * decoder.
-             * But PacketVideo uses IF2 - it stores these bits the other way
-             * round. The sample "sound.amr" uses IF2.
-             */
-            *speech_mode = get_bits(&p->gb, 3); // IF2 speech mode indicator
-        } else
-            p->cur_frame_type = RX_SPEECH_GOOD;
-    } else if (mode == NO_DATA) {
-        p->cur_frame_type = RX_NO_DATA;
-    } else
-        p->cur_frame_type = RX_SPEECH_BAD;
+    }
 
     return mode;
 }
@@ -1062,7 +1043,6 @@ static int amrnb_decode_frame(AVCodecCon
     int buf_size       = avpkt->size;
     float *buf_out = data;                   // pointer to the output data buffer
     int i, subframe;
-    enum Mode speech_mode = MODE_475;        // mode indication for DTX frames
     float fixed_gain_factor;
     float exc_feedback[AMR_SUBFRAME_SIZE];   // unfiltered excitation to feed into the next subframe
     float fixed_vector[AMR_SUBFRAME_SIZE];   // algebraic code book (fixed) vector
@@ -1070,7 +1050,7 @@ static int amrnb_decode_frame(AVCodecCon
     float synth_fixed_gain;                  // the fixed gain that synthesis should use
     float *synth_fixed_vector;               // pointer to the fixed vector that synthesis should use
 
-    p->cur_frame_mode = decode_bitstream(p, buf, buf_size, &speech_mode);
+    p->cur_frame_mode = decode_bitstream(p, buf, buf_size);
     if (p->cur_frame_mode == MODE_DTX) {
         av_log_missing_feature(avctx, "dtx mode", 1);
         return -1;


More information about the FFmpeg-soc mailing list