36 |
* MinChen <chenm001@163.com> |
* MinChen <chenm001@163.com> |
37 |
* 14.04.2002 added FrameCodeB() |
* 14.04.2002 added FrameCodeB() |
38 |
* |
* |
39 |
* $Id: encoder.c,v 1.36 2002-05-09 00:15:50 chenm001 Exp $ |
* $Id: encoder.c,v 1.37 2002-06-07 10:21:48 edgomez Exp $ |
40 |
* |
* |
41 |
***************************************************************************/ |
***************************************************************************/ |
42 |
|
|
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(); |
642 |
|
|
643 |
if (pFrame->quant == 0) |
if (pFrame->quant == 0) |
644 |
{ |
{ |
645 |
pEnc->current->quant = RateControlGetQ(0); |
pEnc->current->quant = RateControlGetQ(&pEnc->rate_control,0); |
646 |
} |
} |
647 |
else |
else |
648 |
{ |
{ |
735 |
|
|
736 |
if (pFrame->quant == 0) |
if (pFrame->quant == 0) |
737 |
{ |
{ |
738 |
RateControlUpdate(pEnc->current->quant, pFrame->length, pFrame->intra); |
RateControlUpdate(&pEnc->rate_control, |
739 |
|
pEnc->current->quant, |
740 |
|
pFrame->length, |
741 |
|
pFrame->intra); |
742 |
} |
} |
743 |
|
|
744 |
#ifdef _DEBUG |
#ifdef _DEBUG |