static int init_pass2(MpegEncContext *s)

{

    RateControlContext *rcc = &s->rc_context;

    AVCodecContext *a       = s->avctx;

    int i, toobig;

    double fps             = get_fps(s->avctx);

    double complexity[5]   = { 0 }; // approximate bits at quant=1

    uint64_t const_bits[5] = { 0 }; // quantizer independent bits

    uint64_t all_const_bits;

    uint64_t all_available_bits = (uint64_t)(s->bit_rate *

                                             (double)rcc->num_entries / fps);

    double rate_factor          = 0;

    double step;

    const int filter_size = (int)(a->qblur * 4) | 1;

    double expected_bits;

    double *qscale, *blurred_qscale, qscale_sum;



    /* find complexity & const_bits & decide the pict_types */

    for (i = 0; i < rcc->num_entries; i++) {

        RateControlEntry *rce = &rcc->entry[i];



        rce->new_pict_type                = rce->pict_type;

        rcc->i_cplx_sum[rce->pict_type]  += rce->i_tex_bits * rce->qscale;

        rcc->p_cplx_sum[rce->pict_type]  += rce->p_tex_bits * rce->qscale;

        rcc->mv_bits_sum[rce->pict_type] += rce->mv_bits;

        rcc->frame_count[rce->pict_type]++;



        complexity[rce->new_pict_type] += (rce->i_tex_bits + rce->p_tex_bits) *

                                          (double)rce->qscale;

        const_bits[rce->new_pict_type] += rce->mv_bits + rce->misc_bits;

    }



    all_const_bits = const_bits[AV_PICTURE_TYPE_I] +

                     const_bits[AV_PICTURE_TYPE_P] +

                     const_bits[AV_PICTURE_TYPE_B];



    if (all_available_bits < all_const_bits) {

        av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is too low\n");

        return -1;

    }



    qscale         = av_malloc(sizeof(double) * rcc->num_entries);

    blurred_qscale = av_malloc(sizeof(double) * rcc->num_entries);

    toobig = 0;



    for (step = 256 * 256; step > 0.0000001; step *= 0.5) {

        expected_bits = 0;

        rate_factor  += step;



        rcc->buffer_index = s->avctx->rc_buffer_size / 2;



        /* find qscale */

        for (i = 0; i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];



            qscale[i] = get_qscale(s, &rcc->entry[i], rate_factor, i);

            rcc->last_qscale_for[rce->pict_type] = qscale[i];

        }

        assert(filter_size % 2 == 1);



        /* fixed I/B QP relative to P mode */

        for (i = FFMAX(0, rcc->num_entries - 300); i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];



            qscale[i] = get_diff_limited_q(s, rce, qscale[i]);

        }



        for (i = rcc->num_entries - 1; i >= 0; i--) {

            RateControlEntry *rce = &rcc->entry[i];



            qscale[i] = get_diff_limited_q(s, rce, qscale[i]);

        }



        /* smooth curve */

        for (i = 0; i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];

            const int pict_type   = rce->new_pict_type;

            int j;

            double q = 0.0, sum = 0.0;



            for (j = 0; j < filter_size; j++) {

                int index    = i + j - filter_size / 2;

                double d     = index - i;

                double coeff = a->qblur == 0 ? 1.0 : exp(-d * d / (a->qblur * a->qblur));



                if (index < 0 || index >= rcc->num_entries)

                    continue;

                if (pict_type != rcc->entry[index].new_pict_type)

                    continue;

                q   += qscale[index] * coeff;

                sum += coeff;

            }

            blurred_qscale[i] = q / sum;

        }



        /* find expected bits */

        for (i = 0; i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];

            double bits;



            rce->new_qscale = modify_qscale(s, rce, blurred_qscale[i], i);



            bits  = qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;

            bits += 8 * ff_vbv_update(s, bits);



            rce->expected_bits = expected_bits;

            expected_bits     += bits;

        }



        av_dlog(s->avctx,

                "expected_bits: %f all_available_bits: %d rate_factor: %f\n",

                expected_bits, (int)all_available_bits, rate_factor);

        if (expected_bits > all_available_bits) {

            rate_factor -= step;

            ++toobig;

        }

    }

    av_free(qscale);

    av_free(blurred_qscale);



    /* check bitrate calculations and print info */

    qscale_sum = 0.0;

    for (i = 0; i < rcc->num_entries; i++) {

        av_dlog(s, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",

                i,

                rcc->entry[i].new_qscale,

                rcc->entry[i].new_qscale / FF_QP2LAMBDA);

        qscale_sum += av_clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA,

                              s->avctx->qmin, s->avctx->qmax);

    }

    assert(toobig <= 40);

    av_log(s->avctx, AV_LOG_DEBUG,

           "[lavc rc] requested bitrate: %d bps  expected bitrate: %d bps\n",

           s->bit_rate,

           (int)(expected_bits / ((double)all_available_bits / s->bit_rate)));

    av_log(s->avctx, AV_LOG_DEBUG,

           "[lavc rc] estimated target average qp: %.3f\n",

           (float)qscale_sum / rcc->num_entries);

    if (toobig == 0) {

        av_log(s->avctx, AV_LOG_INFO,

               "[lavc rc] Using all of requested bitrate is not "

               "necessary for this video with these parameters.\n");

    } else if (toobig == 40) {

        av_log(s->avctx, AV_LOG_ERROR,

               "[lavc rc] Error: bitrate too low for this video "

               "with these parameters.\n");

        return -1;

    } else if (fabs(expected_bits / all_available_bits - 1.0) > 0.01) {

        av_log(s->avctx, AV_LOG_ERROR,

               "[lavc rc] Error: 2pass curve failed to converge\n");

        return -1;

    }



    return 0;

}

static int init_pass2(MpegEncContext *s)

{

    RateControlContext *rcc = &s->rc_context;

    AVCodecContext *a       = s->avctx;

    int i, toobig;

    double fps             = get_fps(s->avctx);

    double complexity[5]   = { 0 }; 

    uint64_t const_bits[5] = { 0 }; 

    uint64_t all_const_bits;

    uint64_t all_available_bits = (uint64_t)(s->bit_rate *

                                             (double)rcc->num_entries / fps);

    double rate_factor          = 0;

    double step;

    const int filter_size = (int)(a->qblur * 4) | 1;

    double expected_bits;

    double *qscale, *blurred_qscale, qscale_sum;



    

    for (i = 0; i < rcc->num_entries; i++) {

        RateControlEntry *rce = &rcc->entry[i];



        rce->new_pict_type                = rce->pict_type;

        rcc->i_cplx_sum[rce->pict_type]  += rce->i_tex_bits * rce->qscale;

        rcc->p_cplx_sum[rce->pict_type]  += rce->p_tex_bits * rce->qscale;

        rcc->mv_bits_sum[rce->pict_type] += rce->mv_bits;

        rcc->frame_count[rce->pict_type]++;



        complexity[rce->new_pict_type] += (rce->i_tex_bits + rce->p_tex_bits) *

                                          (double)rce->qscale;

        const_bits[rce->new_pict_type] += rce->mv_bits + rce->misc_bits;

    }



    all_const_bits = const_bits[AV_PICTURE_TYPE_I] +

                     const_bits[AV_PICTURE_TYPE_P] +

                     const_bits[AV_PICTURE_TYPE_B];



    if (all_available_bits < all_const_bits) {

        av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is too low\n");

        return -1;

    }



    qscale         = av_malloc(sizeof(double) * rcc->num_entries);

    blurred_qscale = av_malloc(sizeof(double) * rcc->num_entries);

    toobig = 0;



    for (step = 256 * 256; step > 0.0000001; step *= 0.5) {

        expected_bits = 0;

        rate_factor  += step;



        rcc->buffer_index = s->avctx->rc_buffer_size / 2;



        

        for (i = 0; i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];



            qscale[i] = get_qscale(s, &rcc->entry[i], rate_factor, i);

            rcc->last_qscale_for[rce->pict_type] = qscale[i];

        }

        assert(filter_size % 2 == 1);



        

        for (i = FFMAX(0, rcc->num_entries - 300); i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];



            qscale[i] = get_diff_limited_q(s, rce, qscale[i]);

        }



        for (i = rcc->num_entries - 1; i >= 0; i--) {

            RateControlEntry *rce = &rcc->entry[i];



            qscale[i] = get_diff_limited_q(s, rce, qscale[i]);

        }



        

        for (i = 0; i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];

            const int pict_type   = rce->new_pict_type;

            int j;

            double q = 0.0, sum = 0.0;



            for (j = 0; j < filter_size; j++) {

                int index    = i + j - filter_size / 2;

                double d     = index - i;

                double coeff = a->qblur == 0 ? 1.0 : exp(-d * d / (a->qblur * a->qblur));



                if (index < 0 || index >= rcc->num_entries)

                    continue;

                if (pict_type != rcc->entry[index].new_pict_type)

                    continue;

                q   += qscale[index] * coeff;

                sum += coeff;

            }

            blurred_qscale[i] = q / sum;

        }



        

        for (i = 0; i < rcc->num_entries; i++) {

            RateControlEntry *rce = &rcc->entry[i];

            double bits;



            rce->new_qscale = modify_qscale(s, rce, blurred_qscale[i], i);



            bits  = qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;

            bits += 8 * ff_vbv_update(s, bits);



            rce->expected_bits = expected_bits;

            expected_bits     += bits;

        }



        av_dlog(s->avctx,

                "expected_bits: %f all_available_bits: %d rate_factor: %f\n",

                expected_bits, (int)all_available_bits, rate_factor);

        if (expected_bits > all_available_bits) {

            rate_factor -= step;

            ++toobig;

        }

    }

    av_free(qscale);

    av_free(blurred_qscale);



    

    qscale_sum = 0.0;

    for (i = 0; i < rcc->num_entries; i++) {

        av_dlog(s, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",

                i,

                rcc->entry[i].new_qscale,

                rcc->entry[i].new_qscale / FF_QP2LAMBDA);

        qscale_sum += av_clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA,

                              s->avctx->qmin, s->avctx->qmax);

    }

    assert(toobig <= 40);

    av_log(s->avctx, AV_LOG_DEBUG,

           "[lavc rc] requested bitrate: %d bps  expected bitrate: %d bps\n",

           s->bit_rate,

           (int)(expected_bits / ((double)all_available_bits / s->bit_rate)));

    av_log(s->avctx, AV_LOG_DEBUG,

           "[lavc rc] estimated target average qp: %.3f\n",

           (float)qscale_sum / rcc->num_entries);

    if (toobig == 0) {

        av_log(s->avctx, AV_LOG_INFO,

               "[lavc rc] Using all of requested bitrate is not "

               "necessary for this video with these parameters.\n");

    } else if (toobig == 40) {

        av_log(s->avctx, AV_LOG_ERROR,

               "[lavc rc] Error: bitrate too low for this video "

               "with these parameters.\n");

        return -1;

    } else if (fabs(expected_bits / all_available_bits - 1.0) > 0.01) {

        av_log(s->avctx, AV_LOG_ERROR,

               "[lavc rc] Error: 2pass curve failed to converge\n");

        return -1;

    }



    return 0;

}

    double expected_bits;
static int FUNC_0(MpegEncContext *VAR_0)

{

    RateControlContext *rcc = &VAR_0->rc_context;

    AVCodecContext *a       = VAR_0->avctx;

    int VAR_1, VAR_2;

    double VAR_3             = get_fps(VAR_0->avctx);

    double VAR_4[5]   = { 0 }; 

    uint64_t const_bits[5] = { 0 }; 

    uint64_t all_const_bits;

    uint64_t all_available_bits = (uint64_t)(VAR_0->bit_rate *

                                             (double)rcc->num_entries / VAR_3);

    double VAR_5          = 0;

    double VAR_6;

    const int VAR_7 = (int)(a->qblur * 4) | 1;

    double VAR_8;

    double *VAR_9, *VAR_10, VAR_11;



    

    for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) {

        RateControlEntry *rce = &rcc->entry[VAR_1];



        rce->new_pict_type                = rce->pict_type;

        rcc->i_cplx_sum[rce->pict_type]  += rce->i_tex_bits * rce->VAR_9;

        rcc->p_cplx_sum[rce->pict_type]  += rce->p_tex_bits * rce->VAR_9;

        rcc->mv_bits_sum[rce->pict_type] += rce->mv_bits;

        rcc->frame_count[rce->pict_type]++;



        VAR_4[rce->new_pict_type] += (rce->i_tex_bits + rce->p_tex_bits) *

                                          (double)rce->VAR_9;

        const_bits[rce->new_pict_type] += rce->mv_bits + rce->misc_bits;

    }



    all_const_bits = const_bits[AV_PICTURE_TYPE_I] +

                     const_bits[AV_PICTURE_TYPE_P] +

                     const_bits[AV_PICTURE_TYPE_B];



    if (all_available_bits < all_const_bits) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "requested bitrate is too low\n");

        return -1;

    }



    VAR_9         = av_malloc(sizeof(double) * rcc->num_entries);

    VAR_10 = av_malloc(sizeof(double) * rcc->num_entries);

    VAR_2 = 0;



    for (VAR_6 = 256 * 256; VAR_6 > 0.0000001; VAR_6 *= 0.5) {

        VAR_8 = 0;

        VAR_5  += VAR_6;



        rcc->buffer_index = VAR_0->avctx->rc_buffer_size / 2;



        

        for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) {

            RateControlEntry *rce = &rcc->entry[VAR_1];



            VAR_9[VAR_1] = get_qscale(VAR_0, &rcc->entry[VAR_1], VAR_5, VAR_1);

            rcc->last_qscale_for[rce->pict_type] = VAR_9[VAR_1];

        }

        assert(VAR_7 % 2 == 1);



        

        for (VAR_1 = FFMAX(0, rcc->num_entries - 300); VAR_1 < rcc->num_entries; VAR_1++) {

            RateControlEntry *rce = &rcc->entry[VAR_1];



            VAR_9[VAR_1] = get_diff_limited_q(VAR_0, rce, VAR_9[VAR_1]);

        }



        for (VAR_1 = rcc->num_entries - 1; VAR_1 >= 0; VAR_1--) {

            RateControlEntry *rce = &rcc->entry[VAR_1];



            VAR_9[VAR_1] = get_diff_limited_q(VAR_0, rce, VAR_9[VAR_1]);

        }



        

        for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) {

            RateControlEntry *rce = &rcc->entry[VAR_1];

            const int pict_type   = rce->new_pict_type;

            int j;

            double q = 0.0, sum = 0.0;



            for (j = 0; j < VAR_7; j++) {

                int index    = VAR_1 + j - VAR_7 / 2;

                double d     = index - VAR_1;

                double coeff = a->qblur == 0 ? 1.0 : exp(-d * d / (a->qblur * a->qblur));



                if (index < 0 || index >= rcc->num_entries)

                    continue;

                if (pict_type != rcc->entry[index].new_pict_type)

                    continue;

                q   += VAR_9[index] * coeff;

                sum += coeff;

            }

            VAR_10[VAR_1] = q / sum;

        }



        

        for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) {

            RateControlEntry *rce = &rcc->entry[VAR_1];

            double bits;



            rce->new_qscale = modify_qscale(VAR_0, rce, VAR_10[VAR_1], VAR_1);



            bits  = qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;

            bits += 8 * ff_vbv_update(VAR_0, bits);



            rce->VAR_8 = VAR_8;

            VAR_8     += bits;

        }



        av_dlog(VAR_0->avctx,

                "VAR_8: %f all_available_bits: %d VAR_5: %f\n",

                VAR_8, (int)all_available_bits, VAR_5);

        if (VAR_8 > all_available_bits) {

            VAR_5 -= VAR_6;

            ++VAR_2;

        }

    }

    av_free(VAR_9);

    av_free(VAR_10);



    

    VAR_11 = 0.0;

    for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) {

        av_dlog(VAR_0, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",

                VAR_1,

                rcc->entry[VAR_1].new_qscale,

                rcc->entry[VAR_1].new_qscale / FF_QP2LAMBDA);

        VAR_11 += av_clip(rcc->entry[VAR_1].new_qscale / FF_QP2LAMBDA,

                              VAR_0->avctx->qmin, VAR_0->avctx->qmax);

    }

    assert(VAR_2 <= 40);

    av_log(VAR_0->avctx, AV_LOG_DEBUG,

           "[lavc rc] requested bitrate: %d bps  expected bitrate: %d bps\n",

           VAR_0->bit_rate,

           (int)(VAR_8 / ((double)all_available_bits / VAR_0->bit_rate)));

    av_log(VAR_0->avctx, AV_LOG_DEBUG,

           "[lavc rc] estimated target average qp: %.3f\n",

           (float)VAR_11 / rcc->num_entries);

    if (VAR_2 == 0) {

        av_log(VAR_0->avctx, AV_LOG_INFO,

               "[lavc rc] Using all of requested bitrate is not "

               "necessary for this video with these parameters.\n");

    } else if (VAR_2 == 40) {

        av_log(VAR_0->avctx, AV_LOG_ERROR,

               "[lavc rc] Error: bitrate too low for this video "

               "with these parameters.\n");

        return -1;

    } else if (fabs(VAR_8 / all_available_bits - 1.0) > 0.01) {

        av_log(VAR_0->avctx, AV_LOG_ERROR,

               "[lavc rc] Error: 2pass curve failed to converge\n");

        return -1;

    }



    return 0;

}

static int FUNC_0(MpegEncContext *VAR_0)
{ RateControlContext *rcc = &VAR_0->rc_context; AVCodecContext *a       = VAR_0->avctx; int VAR_1, VAR_2; double VAR_3             = get_fps(VAR_0->avctx); double VAR_4[5]   = { 0 }; uint64_t const_bits[5] = { 0 }; uint64_t all_const_bits; uint64_t all_available_bits = (uint64_t)(VAR_0->bit_rate *
(double)rcc->num_entries / VAR_3); double VAR_5          = 0; double VAR_6; const int VAR_7 = (int)(a->qblur * 4) | 1; double VAR_8; double *VAR_9, *VAR_10, VAR_11; for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) { RateControlEntry *rce = &rcc->entry[VAR_1]; rce->new_pict_type                = rce->pict_type; rcc->i_cplx_sum[rce->pict_type]  += rce->i_tex_bits * rce->VAR_9; rcc->p_cplx_sum[rce->pict_type]  += rce->p_tex_bits * rce->VAR_9; rcc->mv_bits_sum[rce->pict_type] += rce->mv_bits; rcc->frame_count[rce->pict_type]++; VAR_4[rce->new_pict_type] += (rce->i_tex_bits + rce->p_tex_bits) *
(double)rce->VAR_9; const_bits[rce->new_pict_type] += rce->mv_bits + rce->misc_bits; } all_const_bits = const_bits[AV_PICTURE_TYPE_I] +
const_bits[AV_PICTURE_TYPE_P] +
const_bits[AV_PICTURE_TYPE_B]; if (all_available_bits < all_const_bits) { av_log(VAR_0->avctx, AV_LOG_ERROR, "requested bitrate is too low\n"); return -1; } VAR_9         = av_malloc(sizeof(double) * rcc->num_entries); VAR_10 = av_malloc(sizeof(double) * rcc->num_entries); VAR_2 = 0; for (VAR_6 = 256 * 256; VAR_6 > 0.0000001; VAR_6 *= 0.5) { VAR_8 = 0; VAR_5  += VAR_6; rcc->buffer_index = VAR_0->avctx->rc_buffer_size / 2; for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) { RateControlEntry *rce = &rcc->entry[VAR_1]; VAR_9[VAR_1] = get_qscale(VAR_0, &rcc->entry[VAR_1], VAR_5, VAR_1); rcc->last_qscale_for[rce->pict_type] = VAR_9[VAR_1]; } assert(VAR_7 % 2 == 1); for (VAR_1 = FFMAX(0, rcc->num_entries - 300); VAR_1 < rcc->num_entries; VAR_1++) { RateControlEntry *rce = &rcc->entry[VAR_1]; VAR_9[VAR_1] = get_diff_limited_q(VAR_0, rce, VAR_9[VAR_1]); } for (VAR_1 = rcc->num_entries - 1; VAR_1 >= 0; VAR_1--) { RateControlEntry *rce = &rcc->entry[VAR_1]; VAR_9[VAR_1] = get_diff_limited_q(VAR_0, rce, VAR_9[VAR_1]); } for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) { RateControlEntry *rce = &rcc->entry[VAR_1]; const int pict_type   = rce->new_pict_type; int j; double q = 0.0, sum = 0.0; for (j = 0; j < VAR_7; j++) { int index    = VAR_1 + j - VAR_7 / 2; double d     = index - VAR_1; double coeff = a->qblur == 0 ? 1.0 : exp(-d * d / (a->qblur * a->qblur)); if (index < 0 || index >= rcc->num_entries)
continue; if (pict_type != rcc->entry[index].new_pict_type)
continue; q   += VAR_9[index] * coeff; sum += coeff; } VAR_10[VAR_1] = q / sum; } for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) { RateControlEntry *rce = &rcc->entry[VAR_1]; double bits; rce->new_qscale = modify_qscale(VAR_0, rce, VAR_10[VAR_1], VAR_1); bits  = qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits; bits += 8 * ff_vbv_update(VAR_0, bits); rce->VAR_8 = VAR_8; VAR_8     += bits; } av_dlog(VAR_0->avctx,
"VAR_8: %f all_available_bits: %d VAR_5: %f\n",
VAR_8, (int)all_available_bits, VAR_5); if (VAR_8 > all_available_bits) { VAR_5 -= VAR_6; ++VAR_2; } } av_free(VAR_9); av_free(VAR_10); VAR_11 = 0.0; for (VAR_1 = 0; VAR_1 < rcc->num_entries; VAR_1++) { av_dlog(VAR_0, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",
VAR_1,
rcc->entry[VAR_1].new_qscale,
rcc->entry[VAR_1].new_qscale / FF_QP2LAMBDA); VAR_11 += av_clip(rcc->entry[VAR_1].new_qscale / FF_QP2LAMBDA,
VAR_0->avctx->qmin, VAR_0->avctx->qmax); } assert(VAR_2 <= 40); av_log(VAR_0->avctx, AV_LOG_DEBUG,
"[lavc rc] requested bitrate: %d bps  expected bitrate: %d bps\n",
VAR_0->bit_rate,
(int)(VAR_8 / ((double)all_available_bits / VAR_0->bit_rate))); av_log(VAR_0->avctx, AV_LOG_DEBUG,
"[lavc rc] estimated target average qp: %.3f\n",
(float)VAR_11 / rcc->num_entries); if (VAR_2 == 0) { av_log(VAR_0->avctx, AV_LOG_INFO,
"[lavc rc] Using all of requested bitrate is not "
"necessary for this video with these parameters.\n"); } else if (VAR_2 == 40) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"[lavc rc] Error: bitrate too low for this video "
"with these parameters.\n"); return -1; } else if (fabs(VAR_8 / all_available_bits - 1.0) > 0.01) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"[lavc rc] Error: 2pass curve failed to converge\n"); return -1; } return 0; }