static int sipr_decode_frame(AVCodecContext *avctx, void *datap,

                             int *data_size, AVPacket *avpkt)

{

    SiprContext *ctx = avctx->priv_data;

    const uint8_t *buf=avpkt->data;

    SiprParameters parm;

    const SiprModeParam *mode_par = &modes[ctx->mode];

    GetBitContext gb;

    float *data = datap;

    int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE;

    int i;



    ctx->avctx = avctx;

    if (avpkt->size < (mode_par->bits_per_frame >> 3)) {

        av_log(avctx, AV_LOG_ERROR,

               "Error processing packet: packet size (%d) too small\n",

               avpkt->size);



        *data_size = 0;

        return -1;

    }

    if (*data_size < subframe_size * mode_par->subframe_count * sizeof(float)) {

        av_log(avctx, AV_LOG_ERROR,

               "Error processing packet: output buffer (%d) too small\n",

               *data_size);



        *data_size = 0;

        return -1;

    }



    init_get_bits(&gb, buf, mode_par->bits_per_frame);



    for (i = 0; i < mode_par->frames_per_packet; i++) {

        decode_parameters(&parm, &gb, mode_par);



        if (ctx->mode == MODE_16k)

            ff_sipr_decode_frame_16k(ctx, &parm, data);

        else

            decode_frame(ctx, &parm, data);



        data += subframe_size * mode_par->subframe_count;

    }



    *data_size = mode_par->frames_per_packet * subframe_size *

        mode_par->subframe_count * sizeof(float);



    return mode_par->bits_per_frame >> 3;

}

static int sipr_decode_frame(AVCodecContext *avctx, void *datap,

                             int *data_size, AVPacket *avpkt)

{

    SiprContext *ctx = avctx->priv_data;

    const uint8_t *buf=avpkt->data;

    SiprParameters parm;

    const SiprModeParam *mode_par = &modes[ctx->mode];

    GetBitContext gb;

    float *data = datap;

    int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE;

    int i;



    ctx->avctx = avctx;

    if (avpkt->size < (mode_par->bits_per_frame >> 3)) {

        av_log(avctx, AV_LOG_ERROR,

               "Error processing packet: packet size (%d) too small\n",

               avpkt->size);



        *data_size = 0;

        return -1;

    }

    if (*data_size < subframe_size * mode_par->subframe_count * sizeof(float)) {

        av_log(avctx, AV_LOG_ERROR,

               "Error processing packet: output buffer (%d) too small\n",

               *data_size);



        *data_size = 0;

        return -1;

    }



    init_get_bits(&gb, buf, mode_par->bits_per_frame);



    for (i = 0; i < mode_par->frames_per_packet; i++) {

        decode_parameters(&parm, &gb, mode_par);



        if (ctx->mode == MODE_16k)

            ff_sipr_decode_frame_16k(ctx, &parm, data);

        else

            decode_frame(ctx, &parm, data);



        data += subframe_size * mode_par->subframe_count;

    }



    *data_size = mode_par->frames_per_packet * subframe_size *

        mode_par->subframe_count * sizeof(float);



    return mode_par->bits_per_frame >> 3;

}

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

                             int *VAR_2, AVPacket *VAR_3)

{

    SiprContext *ctx = VAR_0->priv_data;

    const uint8_t *VAR_4=VAR_3->VAR_6;

    SiprParameters parm;

    const SiprModeParam *VAR_5 = &modes[ctx->mode];

    GetBitContext gb;

    float *VAR_6 = VAR_1;

    int VAR_7 = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE;

    int VAR_8;



    ctx->VAR_0 = VAR_0;

    if (VAR_3->size < (VAR_5->bits_per_frame >> 3)) {

        av_log(VAR_0, AV_LOG_ERROR,

               "Error processing packet: packet size (%d) too small\n",

               VAR_3->size);



        *VAR_2 = 0;

        return -1;

    }

    if (*VAR_2 < VAR_7 * VAR_5->subframe_count * sizeof(float)) {

        av_log(VAR_0, AV_LOG_ERROR,

               "Error processing packet: output buffer (%d) too small\n",

               *VAR_2);



        *VAR_2 = 0;

        return -1;

    }



    init_get_bits(&gb, VAR_4, VAR_5->bits_per_frame);



    for (VAR_8 = 0; VAR_8 < VAR_5->frames_per_packet; VAR_8++) {

        decode_parameters(&parm, &gb, VAR_5);



        if (ctx->mode == MODE_16k)

            ff_sipr_decode_frame_16k(ctx, &parm, VAR_6);

        else

            decode_frame(ctx, &parm, VAR_6);



        VAR_6 += VAR_7 * VAR_5->subframe_count;

    }



    *VAR_2 = VAR_5->frames_per_packet * VAR_7 *

        VAR_5->subframe_count * sizeof(float);



    return VAR_5->bits_per_frame >> 3;

}

static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,
int *VAR_2, AVPacket *VAR_3)
{ SiprContext *ctx = VAR_0->priv_data; const uint8_t *VAR_4=VAR_3->VAR_6; SiprParameters parm; const SiprModeParam *VAR_5 = &modes[ctx->mode]; GetBitContext gb; float *VAR_6 = VAR_1; int VAR_7 = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE; int VAR_8; ctx->VAR_0 = VAR_0; if (VAR_3->size < (VAR_5->bits_per_frame >> 3)) { av_log(VAR_0, AV_LOG_ERROR,
"Error processing packet: packet size (%d) too small\n",
VAR_3->size); *VAR_2 = 0; return -1; } if (*VAR_2 < VAR_7 * VAR_5->subframe_count * sizeof(float)) { av_log(VAR_0, AV_LOG_ERROR,
"Error processing packet: output buffer (%d) too small\n",
*VAR_2); *VAR_2 = 0; return -1; } init_get_bits(&gb, VAR_4, VAR_5->bits_per_frame); for (VAR_8 = 0; VAR_8 < VAR_5->frames_per_packet; VAR_8++) { decode_parameters(&parm, &gb, VAR_5); if (ctx->mode == MODE_16k)
ff_sipr_decode_frame_16k(ctx, &parm, VAR_6); else
decode_frame(ctx, &parm, VAR_6); VAR_6 += VAR_7 * VAR_5->subframe_count; } *VAR_2 = VAR_5->frames_per_packet * VAR_7 *
VAR_5->subframe_count * sizeof(float); return VAR_5->bits_per_frame >> 3; }