static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,

                               const AVFrame *frame, int *got_packet_ptr)

{

    int ret;

    gsm_signal *samples = (gsm_signal *)frame->data[0];

    struct gsm_state *state = avctx->priv_data;



    if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align)))

        return ret;



    switch(avctx->codec_id) {

    case AV_CODEC_ID_GSM:

        gsm_encode(state, samples, avpkt->data);

        break;

    case AV_CODEC_ID_GSM_MS:

        gsm_encode(state, samples,                  avpkt->data);

        gsm_encode(state, samples + GSM_FRAME_SIZE, avpkt->data + 32);

    }



    *got_packet_ptr = 1;

    return 0;

}

static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,

                               const AVFrame *frame, int *got_packet_ptr)

{

    int ret;

    gsm_signal *samples = (gsm_signal *)frame->data[0];

    struct gsm_state *state = avctx->priv_data;



    if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align)))

        return ret;



    switch(avctx->codec_id) {

    case AV_CODEC_ID_GSM:

        gsm_encode(state, samples, avpkt->data);

        break;

    case AV_CODEC_ID_GSM_MS:

        gsm_encode(state, samples,                  avpkt->data);

        gsm_encode(state, samples + GSM_FRAME_SIZE, avpkt->data + 32);

    }



    *got_packet_ptr = 1;

    return 0;

}

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

                               const AVFrame *VAR_2, int *VAR_3)

{

    int VAR_4;

    gsm_signal *samples = (gsm_signal *)VAR_2->data[0];

    struct gsm_state *VAR_5 = VAR_0->priv_data;



    if ((VAR_4 = ff_alloc_packet2(VAR_0, VAR_1, VAR_0->block_align)))

        return VAR_4;



    switch(VAR_0->codec_id) {

    case AV_CODEC_ID_GSM:

        gsm_encode(VAR_5, samples, VAR_1->data);

        break;

    case AV_CODEC_ID_GSM_MS:

        gsm_encode(VAR_5, samples,                  VAR_1->data);

        gsm_encode(VAR_5, samples + GSM_FRAME_SIZE, VAR_1->data + 32);

    }



    *VAR_3 = 1;

    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, AVPacket *VAR_1,
const AVFrame *VAR_2, int *VAR_3)
{ int VAR_4; gsm_signal *samples = (gsm_signal *)VAR_2->data[0]; struct gsm_state *VAR_5 = VAR_0->priv_data; if ((VAR_4 = ff_alloc_packet2(VAR_0, VAR_1, VAR_0->block_align)))
return VAR_4; switch(VAR_0->codec_id) { case AV_CODEC_ID_GSM:
gsm_encode(VAR_5, samples, VAR_1->data); break; case AV_CODEC_ID_GSM_MS:
gsm_encode(VAR_5, samples,                  VAR_1->data); gsm_encode(VAR_5, samples + GSM_FRAME_SIZE, VAR_1->data + 32); } *VAR_3 = 1; return 0; }