static int ac3_encode_frame(AVCodecContext *avctx, unsigned char *frame,

                            int buf_size, void *data)

{

    AC3EncodeContext *s = avctx->priv_data;

    const SampleType *samples = data;

    int ret;



    if (s->bit_alloc.sr_code == 1)

        adjust_frame_size(s);



    deinterleave_input_samples(s, samples);



    apply_mdct(s);



    compute_rematrixing_strategy(s);



    scale_coefficients(s);



    apply_rematrixing(s);



    process_exponents(s);



    ret = compute_bit_allocation(s);

    if (ret) {

        av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");

        return ret;

    }



    quantize_mantissas(s);



    output_frame(s, frame);



    return s->frame_size;

}

static int ac3_encode_frame(AVCodecContext *avctx, unsigned char *frame,

                            int buf_size, void *data)

{

    AC3EncodeContext *s = avctx->priv_data;

    const SampleType *samples = data;

    int ret;



    if (s->bit_alloc.sr_code == 1)

        adjust_frame_size(s);



    deinterleave_input_samples(s, samples);



    apply_mdct(s);



    compute_rematrixing_strategy(s);



    scale_coefficients(s);



    apply_rematrixing(s);



    process_exponents(s);



    ret = compute_bit_allocation(s);

    if (ret) {

        av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");

        return ret;

    }



    quantize_mantissas(s);



    output_frame(s, frame);



    return s->frame_size;

}

    compute_rematrixing_strategy(s);
static int FUNC_0(AVCodecContext *VAR_0, unsigned char *VAR_1,

                            int VAR_2, void *VAR_3)

{

    AC3EncodeContext *s = VAR_0->priv_data;

    const SampleType *VAR_4 = VAR_3;

    int VAR_5;



    if (s->bit_alloc.sr_code == 1)

        adjust_frame_size(s);



    deinterleave_input_samples(s, VAR_4);



    apply_mdct(s);



    compute_rematrixing_strategy(s);



    scale_coefficients(s);



    apply_rematrixing(s);



    process_exponents(s);



    VAR_5 = compute_bit_allocation(s);

    if (VAR_5) {

        av_log(VAR_0, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");

        return VAR_5;

    }



    quantize_mantissas(s);



    output_frame(s, VAR_1);



    return s->frame_size;

}

static int FUNC_0(AVCodecContext *VAR_0, unsigned char *VAR_1,
int VAR_2, void *VAR_3)
{ AC3EncodeContext *s = VAR_0->priv_data; const SampleType *VAR_4 = VAR_3; int VAR_5; if (s->bit_alloc.sr_code == 1)
adjust_frame_size(s); deinterleave_input_samples(s, VAR_4); apply_mdct(s); compute_rematrixing_strategy(s); scale_coefficients(s); apply_rematrixing(s); process_exponents(s); VAR_5 = compute_bit_allocation(s); if (VAR_5) { av_log(VAR_0, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n"); return VAR_5; } quantize_mantissas(s); output_frame(s, VAR_1); return s->frame_size; }