static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,

                            int buf_size, void *data)

{

    ADXContext *c          = avctx->priv_data;

    const int16_t *samples = data;

    uint8_t *dst           = frame;

    int ch;



    if (!c->header_parsed) {

        int hdrsize = adx_encode_header(avctx, dst, buf_size);

        dst += hdrsize;

        c->header_parsed = 1;

    }



    for (ch = 0; ch < avctx->channels; ch++) {

        adx_encode(c, dst, samples + ch, &c->prev[ch], avctx->channels);

        dst += BLOCK_SIZE;

    }

    return dst - frame;

}

static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,

                            int buf_size, void *data)

{

    ADXContext *c          = avctx->priv_data;

    const int16_t *samples = data;

    uint8_t *dst           = frame;

    int ch;



    if (!c->header_parsed) {

        int hdrsize = adx_encode_header(avctx, dst, buf_size);

        dst += hdrsize;

        c->header_parsed = 1;

    }



    for (ch = 0; ch < avctx->channels; ch++) {

        adx_encode(c, dst, samples + ch, &c->prev[ch], avctx->channels);

        dst += BLOCK_SIZE;

    }

    return dst - frame;

}

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

                            int VAR_2, void *VAR_3)

{

    ADXContext *c          = VAR_0->priv_data;

    const int16_t *VAR_4 = VAR_3;

    uint8_t *dst           = VAR_1;

    int VAR_5;



    if (!c->header_parsed) {

        int VAR_6 = adx_encode_header(VAR_0, dst, VAR_2);

        dst += VAR_6;

        c->header_parsed = 1;

    }



    for (VAR_5 = 0; VAR_5 < VAR_0->channels; VAR_5++) {

        adx_encode(c, dst, VAR_4 + VAR_5, &c->prev[VAR_5], VAR_0->channels);

        dst += BLOCK_SIZE;

    }

    return dst - VAR_1;

}

static int FUNC_0(AVCodecContext *VAR_0, uint8_t *VAR_1,
int VAR_2, void *VAR_3)
{ ADXContext *c          = VAR_0->priv_data; const int16_t *VAR_4 = VAR_3; uint8_t *dst           = VAR_1; int VAR_5; if (!c->header_parsed) { int VAR_6 = adx_encode_header(VAR_0, dst, VAR_2); dst += VAR_6; c->header_parsed = 1; } for (VAR_5 = 0; VAR_5 < VAR_0->channels; VAR_5++) { adx_encode(c, dst, VAR_4 + VAR_5, &c->prev[VAR_5], VAR_0->channels); dst += BLOCK_SIZE; } return dst - VAR_1; }