This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

G.729/iLBC/G.722: speech codec question

Genius 9355 points

From a previous discussion I gather that  the current codec user guide is incorrect when it says XDM_RESET is not supported on the speech codecs. So, my customer is now trying to use XDM_RESET with G.729 speech decoder.

They tried doing XDM_RESET on the decoder in the middle of processing an audio stream, that is between two encoded frames, then it  takes several frames before the decoder will produce a good output. So, is this the way to handle packet losses or should they do something else when dealing with that?

By the way, the XDM_REset documentation issue will need to be fixed in G.729, G.722 and iILBC user guides.

Rgds

-Dipa-

  • Dipa,

    "They tried doing XDM_RESET on the decoder in the middle of processing an audio stream, that is between two encoded frames, then it  takes several frames before the decoder will produce a good output"

    This is the expected behavior when we reset (XDM_RESET) the state of the codec. However, this is not the way to handle the packet losses at decoder. The decoder Inargs->frameType flag indicates whether the input frame is lost (ISPHDEC1_FTYPE_SPEECHLOST) or received correctly (ISPHDEC1_FTYPE_SPEECHGOOD). So, we need to set this flag to ISPHDEC1_FTYPE_SPEECHLOST for packet losses.

    "By the way, the XDM_REset documentation issue will need to be fixed in G.729, G.722 and iILBC user guides"

    We will update the documents for XDM_RESET issue in the next releases.

    -Venkat

  • Venkat,

    Are all the frametypes outlined supported?

    typedef enum {

        ISPHDEC1_FTYPE_SPEECHGOOD = 0,  /**< Regular speech frame received

                                         *   without errors/loss.

                                         */

        ISPHDEC1_FTYPE_SIDUPDATE = 1,   /**< SID update frames. */

        ISPHDEC1_FTYPE_NODATA = 2,      /**< Untransmitted frame for codecs which

                                         *   support internal DTX.

                                         */

        ISPHDEC1_FTYPE_SPEECHLOST = 3,  /**< Complete loss of speech frame. */

        ISPHDEC1_FTYPE_DEGRADED = 4,    /**< Speech frame with a correct CRC,

                                         *   some invalid data.

                                         */

        ISPHDEC1_FTYPE_BAD = 5,         /**< Speech frame (likely), but invalid. */

        ISPHDEC1_FTYPE_SIDFIRST = 6,    /**< The first frame of comfort noise. */

        ISPHDEC1_FTYPE_SIDBAD = 7,      /**< Corrupt SID update frame. */

        ISPHDEC1_FTYPE_ONSET = 8        /**< Frames which precede the first speech

                                         *   frame of a speech burst.

                                         */

    } ISPHDEC1_FrameType;

     

    In the test app I only see the first 4 mentioned. 

    Also, what is SIDUPDATE vs SIDFIRST? How is each one to be used?

     

    Rgds

    -dipa-

  • Dipa,

    This is the enumeration defined for frametype, however, each codec can use only subset of these or all.

    Most of the codecs use only the first 4 values, GSM-AMR uses all the frametypes.

    SIDFIRST and SIDUPDATE indicate that the input frame is a silence. If it is the first frame of silence, frametype is set to SIDFIRST otherwise to SIDUPDATE.

    -Venkat