557 |
if ((profiles[codec->config.profile].flags & PROFILE_INTERLACE) && codec->config.interlacing) |
if ((profiles[codec->config.profile].flags & PROFILE_INTERLACE) && codec->config.interlacing) |
558 |
frame.vol_flags |= XVID_VOL_INTERLACING; |
frame.vol_flags |= XVID_VOL_INTERLACING; |
559 |
|
|
560 |
if (codec->config.display_aspect_ratio !=0) { |
if (codec->config.ar_mode == 0) { /* PAR */ |
561 |
int ar_x; |
if (codec->config.display_aspect_ratio != 5) { |
562 |
int ar_y; |
frame.par = codec->config.display_aspect_ratio + 1; |
563 |
|
} else { |
564 |
if (codec->config.display_aspect_ratio == 1) { |
frame.par = XVID_PAR_EXT; |
565 |
ar_x = 4; |
frame.par_width = codec->config.par_x; |
566 |
ar_y = 3; |
frame.par_height= codec->config.par_y; |
|
} |
|
|
if (codec->config.display_aspect_ratio == 2) { |
|
|
ar_x = 16; |
|
|
ar_y = 9; |
|
567 |
} |
} |
568 |
|
} else { /* AR */ |
569 |
/* custom pixel aspect ratio -> calculated from DAR */ |
/* custom pixel aspect ratio -> calculated from DAR */ |
570 |
frame.par = XVID_PAR_EXT; |
frame.par = XVID_PAR_EXT; |
571 |
frame.par_width = (100 * inhdr->biHeight) / ar_y; |
frame.par_width = (100 * inhdr->biHeight) / codec->config.ar_y; |
572 |
frame.par_height= (100 * inhdr->biWidth) / ar_x; |
frame.par_height= (100 * inhdr->biWidth) / codec->config.ar_x; |
|
} else { |
|
|
/* assuming defaults for now... */ |
|
|
frame.par = XVID_PAR_11_VGA; |
|
573 |
} |
} |
574 |
|
|
575 |
/* vop stuff */ |
/* vop stuff */ |
595 |
frame.motion |= XVID_ME_DETECT_STATIC_MOTION; |
frame.motion |= XVID_ME_DETECT_STATIC_MOTION; |
596 |
} |
} |
597 |
|
|
598 |
|
if (codec->config.turbo) |
599 |
|
frame.motion |= XVID_ME_FASTREFINE16 | XVID_ME_FASTREFINE8 | |
600 |
|
XVID_ME_SKIP_DELTASEARCH | XVID_ME_FAST_MODEINTERPOLATE | |
601 |
|
XVID_ME_BFRAME_EARLYSTOP; |
602 |
|
|
603 |
frame.motion |= pmvfast_presets[codec->config.motion_search]; |
frame.motion |= pmvfast_presets[codec->config.motion_search]; |
604 |
|
|
605 |
switch (codec->config.vhq_mode) |
switch (codec->config.vhq_mode) |