Mercurial > libavcodec.hg
comparison ratecontrol.c @ 4001:34fdffe98bd0 libavcodec
Rename ABS macro to FFABS.
| author | diego |
|---|---|
| date | Wed, 11 Oct 2006 23:17:58 +0000 |
| parents | c8c591fe26f8 |
| children | 90e848a24c70 |
comparison
equal
deleted
inserted
replaced
| 4000:eeab02251056 | 4001:34fdffe98bd0 |
|---|---|
| 370 const int pict_type= rce->new_pict_type; | 370 const int pict_type= rce->new_pict_type; |
| 371 const double last_p_q = rcc->last_qscale_for[P_TYPE]; | 371 const double last_p_q = rcc->last_qscale_for[P_TYPE]; |
| 372 const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type]; | 372 const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type]; |
| 373 | 373 |
| 374 if (pict_type==I_TYPE && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==P_TYPE)) | 374 if (pict_type==I_TYPE && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==P_TYPE)) |
| 375 q= last_p_q *ABS(a->i_quant_factor) + a->i_quant_offset; | 375 q= last_p_q *FFABS(a->i_quant_factor) + a->i_quant_offset; |
| 376 else if(pict_type==B_TYPE && a->b_quant_factor>0.0) | 376 else if(pict_type==B_TYPE && a->b_quant_factor>0.0) |
| 377 q= last_non_b_q* a->b_quant_factor + a->b_quant_offset; | 377 q= last_non_b_q* a->b_quant_factor + a->b_quant_offset; |
| 378 | 378 |
| 379 /* last qscale / qdiff stuff */ | 379 /* last qscale / qdiff stuff */ |
| 380 if(rcc->last_non_b_pict_type==pict_type || pict_type!=I_TYPE){ | 380 if(rcc->last_non_b_pict_type==pict_type || pict_type!=I_TYPE){ |
| 401 int qmax= s->avctx->lmax; | 401 int qmax= s->avctx->lmax; |
| 402 | 402 |
| 403 assert(qmin <= qmax); | 403 assert(qmin <= qmax); |
| 404 | 404 |
| 405 if(pict_type==B_TYPE){ | 405 if(pict_type==B_TYPE){ |
| 406 qmin= (int)(qmin*ABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); | 406 qmin= (int)(qmin*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); |
| 407 qmax= (int)(qmax*ABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); | 407 qmax= (int)(qmax*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); |
| 408 }else if(pict_type==I_TYPE){ | 408 }else if(pict_type==I_TYPE){ |
| 409 qmin= (int)(qmin*ABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); | 409 qmin= (int)(qmin*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); |
| 410 qmax= (int)(qmax*ABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); | 410 qmax= (int)(qmax*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); |
| 411 } | 411 } |
| 412 | 412 |
| 413 qmin= clip(qmin, 1, FF_LAMBDA_MAX); | 413 qmin= clip(qmin, 1, FF_LAMBDA_MAX); |
| 414 qmax= clip(qmax, 1, FF_LAMBDA_MAX); | 414 qmax= clip(qmax, 1, FF_LAMBDA_MAX); |
| 415 | 415 |
