Index: libhb/common.c =================================================================== --- libhb/common.c (revision 1441) +++ libhb/common.c (working copy) @@ -108,8 +108,13 @@ void hb_fix_aspect( hb_job_t * job, int keep ) { hb_title_t * title = job->title; - int i; + int i, mod; + if (job->modulus) + mod = job->modulus; + else + mod = 16; + /* don't do anything unless the title has complete size info */ if ( title->height == 0 || title->width == 0 || title->aspect == 0 ) { @@ -146,21 +151,21 @@ if( keep == HB_KEEP_WIDTH ) { - job->height = MULTIPLE_16( + job->height = MULTIPLE_MOD( (uint64_t) job->width * title->width * HB_ASPECT_BASE * ( title->height - job->crop[0] - job->crop[1] ) / ( (uint64_t) title->height * title->aspect * - ( title->width - job->crop[2] - job->crop[3] ) ) ); - job->height = MAX( 16, job->height ); + ( title->width - job->crop[2] - job->crop[3] ) ), mod ); + job->height = MAX( mod, job->height ); } else { - job->width = MULTIPLE_16( + job->width = MULTIPLE_MOD( (uint64_t) job->height * title->height * title->aspect * ( title->width - job->crop[2] - job->crop[3] ) / ( (uint64_t) title->width * HB_ASPECT_BASE * - ( title->height - job->crop[0] - job->crop[1] ) ) ); - job->width = MAX( 16, job->width ); + ( title->height - job->crop[0] - job->crop[1] ) ), mod ); + job->width = MAX( mod, job->width ); } }