Revision f66e4f5f libavcodec/ratecontrol.c

View differences:

libavcodec/ratecontrol.c
280 280
        }
281 281

  
282 282
        left= buffer_size - rcc->buffer_index - 1;
283
        rcc->buffer_index += clip(left, min_rate, max_rate);
283
        rcc->buffer_index += av_clip(left, min_rate, max_rate);
284 284

  
285 285
        if(rcc->buffer_index > buffer_size){
286 286
            int stuffing= ceil((rcc->buffer_index - buffer_size)/8);
......
417 417
        qmax= (int)(qmax*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5);
418 418
    }
419 419

  
420
    qmin= clip(qmin, 1, FF_LAMBDA_MAX);
421
    qmax= clip(qmax, 1, FF_LAMBDA_MAX);
420
    qmin= av_clip(qmin, 1, FF_LAMBDA_MAX);
421
    qmax= av_clip(qmax, 1, FF_LAMBDA_MAX);
422 422

  
423 423
    if(qmax<qmin) qmax= qmin;
424 424

  
......
915 915
    for(i=0; i<rcc->num_entries; i++){
916 916
        /* av_log(s->avctx, AV_LOG_DEBUG, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",
917 917
            i, rcc->entry[i].new_qscale, rcc->entry[i].new_qscale / FF_QP2LAMBDA); */
918
        qscale_sum += clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA, s->avctx->qmin, s->avctx->qmax);
918
        qscale_sum += av_clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA, s->avctx->qmin, s->avctx->qmax);
919 919
    }
920 920
    assert(toobig <= 40);
921 921
    av_log(s->avctx, AV_LOG_DEBUG,

Also available in: Unified diff