80 |
|
pParam->fincr = (int)(pParam->fincr / div); |
81 |
|
} |
82 |
|
|
83 |
< |
if (pParam->bitrate <= 0) |
84 |
< |
pParam->bitrate = 900000; |
83 |
> |
if (pParam->rc_bitrate <= 0) |
84 |
> |
pParam->rc_bitrate = 900000; |
85 |
|
|
86 |
< |
if (pParam->rc_buffersize <= 0) |
87 |
< |
pParam->rc_buffersize = 16; |
86 |
> |
if (pParam->rc_reaction_delay_factor <= 0) |
87 |
> |
pParam->rc_reaction_delay_factor = 16; |
88 |
> |
|
89 |
> |
if (pParam->rc_averaging_period <= 0) |
90 |
> |
pParam->rc_averaging_period = 100; |
91 |
> |
|
92 |
> |
if (pParam->rc_buffer <= 0) |
93 |
> |
pParam->rc_buffer = 100; |
94 |
|
|
95 |
|
if ((pParam->min_quantizer <= 0) || (pParam->min_quantizer > 31)) |
96 |
|
pParam->min_quantizer = 1; |
124 |
|
|
125 |
|
pEnc->mbParam.quant = 4; |
126 |
|
|
127 |
< |
pEnc->bitrate = pParam->bitrate; |
127 |
> |
pEnc->bitrate = pParam->rc_bitrate; |
128 |
|
|
129 |
|
pEnc->iFrameNum = 0; |
130 |
|
pEnc->iMaxKeyInterval = pParam->max_key_interval; |
178 |
|
|
179 |
|
pParam->handle = (void *)pEnc; |
180 |
|
|
181 |
< |
if (pParam->bitrate) |
181 |
> |
if (pParam->rc_bitrate) |
182 |
|
{ |
183 |
< |
RateControlInit(pParam->bitrate, pParam->rc_buffersize, pParam->fbase * 1000 / pParam->fincr, |
184 |
< |
pParam->max_quantizer, pParam->min_quantizer); |
183 |
> |
RateControlInit(pParam->rc_bitrate, pParam->rc_reaction_delay_factor, |
184 |
> |
pParam->rc_averaging_period, pParam->rc_buffer, pParam->fbase * 1000 / pParam->fincr, |
185 |
> |
pParam->max_quantizer, pParam->min_quantizer); |
186 |
|
} |
187 |
|
|
188 |
|
init_timer(); |