82 |
pParam->bitrate = 900000; |
pParam->bitrate = 900000; |
83 |
|
|
84 |
if (pParam->rc_buffersize <= 0) |
if (pParam->rc_buffersize <= 0) |
85 |
pParam->rc_buffersize = pParam->bitrate * pParam->fbase; |
pParam->rc_buffersize = 16; |
86 |
|
|
87 |
if ((pParam->min_quantizer <= 0) || (pParam->min_quantizer > 31)) |
if ((pParam->min_quantizer <= 0) || (pParam->min_quantizer > 31)) |
88 |
pParam->min_quantizer = 1; |
pParam->min_quantizer = 1; |
183 |
|
|
184 |
if (pParam->bitrate) |
if (pParam->bitrate) |
185 |
{ |
{ |
186 |
RateControlInit(pParam->bitrate, pParam->rc_buffersize, pParam->fbase, pParam->width, |
RateControlInit(pParam->bitrate, pParam->rc_buffersize, pParam->fbase * 100 / pParam->fincr, |
187 |
pParam->height, pParam->max_quantizer, pParam->min_quantizer); |
pParam->max_quantizer, pParam->min_quantizer); |
188 |
} |
} |
189 |
|
|
190 |
create_vlc_tables(); |
create_vlc_tables(); |
364 |
|
|
365 |
static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits) |
static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits) |
366 |
{ |
{ |
367 |
int16_t dct_codes[6][64]; |
CACHE_ALIGN int16_t dct_codes[6][64]; |
368 |
int16_t qcoeff[6][64]; |
CACHE_ALIGN int16_t qcoeff[6][64]; |
369 |
uint16_t x, y; |
uint16_t x, y; |
370 |
|
|
371 |
pEnc->iFrameNum = 0; |
pEnc->iFrameNum = 0; |
418 |
static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, bool force_inter, bool vol_header) |
static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, bool force_inter, bool vol_header) |
419 |
{ |
{ |
420 |
float fSigma; |
float fSigma; |
421 |
int16_t dct_codes[6][64]; |
|
422 |
int16_t qcoeff[6][64]; |
CACHE_ALIGN int16_t dct_codes[6][64]; |
423 |
|
CACHE_ALIGN int16_t qcoeff[6][64]; |
424 |
|
|
425 |
int iLimit; |
int iLimit; |
426 |
uint32_t x, y; |
uint32_t x, y; |
427 |
int iSearchRange; |
int iSearchRange; |