case 0:
memset( &single, 0, sizeof( single ) );
single.version = XVID_VERSION;
- if( job->vquality < 0.0 || job->vquality > 1.0 )
+ if( job->vquality < 0.0 )
{
/* Rate control */
single.bitrate = 1000 * job->vbitrate;
}
else
{
- /* Constant quantizer */
- pv->quant = 31 - job->vquality * 30;
+ if( job->vquality > 0 && job->vquality < 1 )
+ {
+ /* Constant quantizer */
+ pv->quant = 31 - job->vquality * 30;
+ }
+ else
+ {
+ pv->quant = job->vquality;
+ }
+
hb_log( "encxvid: encoding at constant quantizer %d",
pv->quant );
}
if( pv->xvid )
{
- hb_log( "encxvid: closing libxvidcore" );
+ hb_deep_log( 2, "encxvid: closing libxvidcore" );
xvid_encore( pv->xvid, XVID_ENC_DESTROY, NULL, NULL);
}
}
/* Should be way too large */
- buf = hb_buffer_init( 3 * job->width * job->height / 2 );
+ buf = hb_video_buffer_init( job->width, job->height );
buf->start = in->start;
buf->stop = in->stop;
frame.vol_flags = 0;
frame.vop_flags = XVID_VOP_HALFPEL | XVID_VOP_INTER4V |
XVID_VOP_TRELLISQUANT | XVID_VOP_HQACPRED;
- if( job->pixel_ratio )
+ if( job->anamorphic.mode )
{
frame.par = XVID_PAR_EXT;
- frame.par_width = job->pixel_aspect_width;
- frame.par_height = job->pixel_aspect_height;
+ frame.par_width = job->anamorphic.par_width;
+ frame.par_height = job->anamorphic.par_height;
}
if( job->grayscale )
}
}
- hb_log( "encxvid: VOL size is %d bytes", vop_start - vol_start );
+ hb_deep_log( 2, "encxvid: VOL size is %d bytes", vop_start - vol_start );
job->config.mpeg4.length = vop_start - vol_start;
memcpy( job->config.mpeg4.bytes, &buf->data[vol_start],
job->config.mpeg4.length );