From c832b1edbbff5692fdc6b55ec245e013d1b1dce9 Mon Sep 17 00:00:00 2001 From: jbrjake Date: Tue, 16 Oct 2007 19:00:41 +0000 Subject: "Loose" anamorphic: - Scales the storage frame size to arbitrary widths, like 640 for the iPod. - Uses dimensions that divide cleanly by an arbitrary number (default: 16) and adjusts the SAR to match - Uses ITU PAR values when the video is meant to be overscanned ( 7+ pixels cropped on left+right) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1029 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/work.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libhb/work.c') diff --git a/libhb/work.c b/libhb/work.c index 72d12d75a..22e081532 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -128,16 +128,26 @@ static void do_job( hb_job_t * job, int cpu_count ) job->height=title->height-job->crop[0]-job->crop[1]; job->width=title->width-job->crop[2]-job->crop[3]; } + else if ( job->pixel_ratio == 2 ) + { + + /* While keeping the DVD storage aspect, resize the job width and height + so they fit into the user's specified dimensions. */ + hb_set_anamorphic_size(job); + } - /* Keep width and height within these boundaries */ - if (job->maxHeight && (job->height > job->maxHeight) ) + /* Keep width and height within these boundaries, + but ignore for "loose" anamorphic encodes, for + which this stuff is covered in the pixel_ratio + section right above.*/ + if (job->maxHeight && (job->height > job->maxHeight) && (job->pixel_ratio != 2)) { job->height = job->maxHeight; hb_fix_aspect( job, HB_KEEP_HEIGHT ); hb_log("Height out of bounds, scaling down to %i", job->maxHeight); hb_log("New dimensions %i * %i", job->width, job->height); } - if (job->maxWidth && (job->width > job->maxWidth) ) + if (job->maxWidth && (job->width > job->maxWidth) && (job->pixel_ratio != 2)) { job->width = job->maxWidth; hb_fix_aspect( job, HB_KEEP_WIDTH ); -- cgit v1.2.3