diff options
-rw-r--r-- | libhb/hb.c | 2 | ||||
-rw-r--r-- | libhb/work.c | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index a9e76b926..1dda37578 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1209,7 +1209,7 @@ void hb_set_anamorphic_size( hb_job_t * job, } /* While x264 is smart enough to reduce fractions on its own, libavcodec - needs some help with the math, so lose superfluous factors. */ + * needs some help with the math, so lose superfluous factors. */ hb_reduce( output_par_width, output_par_height, pixel_aspect_width, pixel_aspect_height ); } diff --git a/libhb/work.c b/libhb/work.c index c26739a31..7ea9878bf 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -567,19 +567,24 @@ static void do_job( hb_job_t * job ) if( job->anamorphic.mode ) { + /* While x264 is smart enough to reduce fractions on its own, libavcodec and + * the MacGUI need some help with the math, so lose superfluous factors. */ + hb_reduce( &job->anamorphic.par_width, &job->anamorphic.par_height, + job->anamorphic.par_width, job->anamorphic.par_height ); if( job->vcodec & HB_VCODEC_FFMPEG_MASK ) { /* Just to make working with ffmpeg even more fun, - lavc's MPEG-4 encoder can't handle PAR values >= 255, - even though AVRational does. Adjusting downwards - distorts the display aspect slightly, but such is life. */ - while ((job->anamorphic.par_width & ~0xFF) || - (job->anamorphic.par_height & ~0xFF)) + * lavc's MPEG-4 encoder can't handle PAR values >= 255, + * even though AVRational does. Adjusting downwards + * distorts the display aspect slightly, but such is life. */ + while( ( job->anamorphic.par_width & ~0xFF ) || + ( job->anamorphic.par_height & ~0xFF ) ) { - job->anamorphic.par_width >>= 1; + job->anamorphic.par_width >>= 1; job->anamorphic.par_height >>= 1; + hb_reduce( &job->anamorphic.par_width, &job->anamorphic.par_height, + job->anamorphic.par_width, job->anamorphic.par_height ); } - hb_reduce( &job->anamorphic.par_width, &job->anamorphic.par_height, job->anamorphic.par_width, job->anamorphic.par_height ); } } |