301 |
|
|
302 |
if (pParam->rc_bitrate) |
if (pParam->rc_bitrate) |
303 |
{ |
{ |
304 |
RateControlInit(pParam->rc_bitrate, pParam->rc_reaction_delay_factor, |
RateControlInit(&pEnc->rate_control, |
305 |
pParam->rc_averaging_period, pParam->rc_buffer, pParam->fbase * 1000 / pParam->fincr, |
pParam->rc_bitrate, |
306 |
pParam->max_quantizer, pParam->min_quantizer); |
pParam->rc_reaction_delay_factor, |
307 |
|
pParam->rc_averaging_period, |
308 |
|
pParam->rc_buffer, |
309 |
|
pParam->fbase * 1000 / pParam->fincr, |
310 |
|
pParam->max_quantizer, |
311 |
|
pParam->min_quantizer); |
312 |
} |
} |
313 |
|
|
314 |
init_timer(); |
init_timer(); |
444 |
|
|
445 |
SWAP(pEnc->current, pEnc->reference); |
SWAP(pEnc->current, pEnc->reference); |
446 |
|
|
447 |
pEnc->current->quant = (pFrame->quant == 0) ? RateControlGetQ(0) : pFrame->quant; |
pEnc->current->quant = (pFrame->quant == 0) ? RateControlGetQ(&pEnc->rate_control, 0) : pFrame->quant; |
448 |
|
|
449 |
if(pEnc->current->quant < 1) |
if(pEnc->current->quant < 1) |
450 |
pEnc->current->quant = 1; |
pEnc->current->quant = 1; |
581 |
|
|
582 |
if (pFrame->quant == 0) |
if (pFrame->quant == 0) |
583 |
{ |
{ |
584 |
RateControlUpdate(pEnc->current->quant, pFrame->length, pFrame->intra); |
RateControlUpdate(&pEnc->rate_control, |
585 |
|
pEnc->current->quant, |
586 |
|
pFrame->length, |
587 |
|
pFrame->intra); |
588 |
} |
} |
589 |
|
|
590 |
pEnc->iFrameNum++; |
pEnc->iFrameNum++; |
645 |
|
|
646 |
if (pFrame->quant == 0) |
if (pFrame->quant == 0) |
647 |
{ |
{ |
648 |
pEnc->current->quant = RateControlGetQ(0); |
pEnc->current->quant = RateControlGetQ(&pEnc->rate_control,0); |
649 |
} |
} |
650 |
else |
else |
651 |
{ |
{ |
738 |
|
|
739 |
if (pFrame->quant == 0) |
if (pFrame->quant == 0) |
740 |
{ |
{ |
741 |
RateControlUpdate(pEnc->current->quant, pFrame->length, pFrame->intra); |
RateControlUpdate(&pEnc->rate_control, |
742 |
|
pEnc->current->quant, |
743 |
|
pFrame->length, |
744 |
|
pFrame->intra); |
745 |
} |
} |
746 |
|
|
747 |
#ifdef _DEBUG |
#ifdef _DEBUG |