static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,

                               int *data_size, AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    AMRContext *s      = avctx->priv_data;

    static const uint8_t block_size[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };

    enum Mode dec_mode;

    int packet_size;



    av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",

            buf, buf_size, avctx->frame_number);



    dec_mode    = (buf[0] >> 3) & 0x000F;

    packet_size = block_size[dec_mode] + 1;



    if (packet_size > buf_size) {

        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",

               buf_size, packet_size);

        return AVERROR_INVALIDDATA;

    }



    av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",

              packet_size, buf[0], buf[1], buf[2], buf[3]);

    /* call decoder */

    Decoder_Interface_Decode(s->dec_state, buf, data, 0);

    *data_size = 160 * 2;



    return packet_size;

}

static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,

                               int *data_size, AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    AMRContext *s      = avctx->priv_data;

    static const uint8_t block_size[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };

    enum Mode dec_mode;

    int packet_size;



    av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",

            buf, buf_size, avctx->frame_number);



    dec_mode    = (buf[0] >> 3) & 0x000F;

    packet_size = block_size[dec_mode] + 1;



    if (packet_size > buf_size) {

        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",

               buf_size, packet_size);

        return AVERROR_INVALIDDATA;

    }



    av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",

              packet_size, buf[0], buf[1], buf[2], buf[3]);

    

    Decoder_Interface_Decode(s->dec_state, buf, data, 0);

    *data_size = 160 * 2;



    return packet_size;

}

static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,

                               int *VAR_2, AVPacket *VAR_3)

{

    const uint8_t *VAR_4 = VAR_3->VAR_1;

    int VAR_5       = VAR_3->size;

    AMRContext *s      = VAR_0->priv_data;

    static const uint8_t VAR_6[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };

    enum Mode VAR_7;

    int VAR_8;



    av_dlog(VAR_0, "amr_decode_frame VAR_4=%p VAR_5=%d frame_count=%d!!\n",

            VAR_4, VAR_5, VAR_0->frame_number);



    VAR_7    = (VAR_4[0] >> 3) & 0x000F;

    VAR_8 = VAR_6[VAR_7] + 1;



    if (VAR_8 > VAR_5) {

        av_log(VAR_0, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",

               VAR_5, VAR_8);

        return AVERROR_INVALIDDATA;

    }



    av_dlog(VAR_0, "VAR_8=%d VAR_4= 0x%X %X %X %X\n",

              VAR_8, VAR_4[0], VAR_4[1], VAR_4[2], VAR_4[3]);

    

    Decoder_Interface_Decode(s->dec_state, VAR_4, VAR_1, 0);

    *VAR_2 = 160 * 2;



    return VAR_8;

}

static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,
int *VAR_2, AVPacket *VAR_3)
{ const uint8_t *VAR_4 = VAR_3->VAR_1; int VAR_5       = VAR_3->size; AMRContext *s      = VAR_0->priv_data; static const uint8_t VAR_6[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 }; enum Mode VAR_7; int VAR_8; av_dlog(VAR_0, "amr_decode_frame VAR_4=%p VAR_5=%d frame_count=%d!!\n",
VAR_4, VAR_5, VAR_0->frame_number); VAR_7    = (VAR_4[0] >> 3) & 0x000F; VAR_8 = VAR_6[VAR_7] + 1; if (VAR_8 > VAR_5) { av_log(VAR_0, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
VAR_5, VAR_8); return AVERROR_INVALIDDATA; } av_dlog(VAR_0, "VAR_8=%d VAR_4= 0x%X %X %X %X\n",
VAR_8, VAR_4[0], VAR_4[1], VAR_4[2], VAR_4[3]); Decoder_Interface_Decode(s->dec_state, VAR_4, VAR_1, 0); *VAR_2 = 160 * 2; return VAR_8; }