309 |
|
|
310 |
#define FRAMERATE_INCR 1001 |
#define FRAMERATE_INCR 1001 |
311 |
|
|
312 |
|
int pmvfast_presets[7] = { |
313 |
|
0, PMV_QUICKSTOP16, PMV_EARLYSTOP16, PMV_EARLYSTOP16 | PMV_EARLYSTOP8, |
314 |
|
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8, |
315 |
|
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8, |
316 |
|
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | |
317 |
|
PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8 |
318 |
|
}; |
319 |
|
|
320 |
|
int quality; |
321 |
|
|
322 |
int encore(void * handle, int opt, void * param1, void * param2) |
int encore(void * handle, int opt, void * param1, void * param2) |
323 |
{ |
{ |
324 |
int xerr; |
int xerr; |
347 |
xparam.fbase = (int)(FRAMERATE_INCR * eparam->framerate); |
xparam.fbase = (int)(FRAMERATE_INCR * eparam->framerate); |
348 |
} |
} |
349 |
xparam.bitrate = eparam->bitrate; |
xparam.bitrate = eparam->bitrate; |
350 |
xparam.rc_buffersize = eparam->bitrate; |
xparam.rc_buffersize = 10 * eparam->bitrate; |
351 |
xparam.min_quantizer = eparam->min_quantizer; |
xparam.min_quantizer = eparam->min_quantizer; |
352 |
xparam.max_quantizer = eparam->max_quantizer; |
xparam.max_quantizer = eparam->max_quantizer; |
353 |
xparam.max_key_interval = eparam->max_key_interval; |
xparam.max_key_interval = eparam->max_key_interval; |
354 |
|
quality = eparam->quality; |
355 |
|
|
356 |
xerr = encoder_create(&xparam); |
xerr = encoder_create(&xparam); |
357 |
|
|
377 |
xframe.bitstream = eframe->bitstream; |
xframe.bitstream = eframe->bitstream; |
378 |
xframe.length = eframe->length; |
xframe.length = eframe->length; |
379 |
|
|
380 |
|
xframe.general = XVID_HALFPEL | XVID_H263QUANT; |
381 |
|
|
382 |
|
if(quality > 3) |
383 |
|
xframe.general |= XVID_INTER4V; |
384 |
|
|
385 |
|
xframe.motion = pmvfast_presets[quality]; |
386 |
|
|
387 |
xframe.image = eframe->image; |
xframe.image = eframe->image; |
388 |
switch (eframe->colorspace) |
switch (eframe->colorspace) |
389 |
{ |
{ |