summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2008-05-13 14:55:56 +0000
committerjbrjake <[email protected]>2008-05-13 14:55:56 +0000
commitd60380e61ec922484e9c5614592884dbf351970d (patch)
tree1dafa7426adaf6679e2256bb7bd94c988a0aea76
parentecd08ad8b06a8cf9218b3063cf09815dec1d3c27 (diff)
Allow the user to directly set a pixel aspect height and width, instead of using the autodetection in strict and loose anamorphic. This allows rescaling 1:1 PAR material to be anamorphic.
To use in an interface, simply set job->pixel_ratio to 3, job->height and job->width to the desired output size, and job->pixel_aspect_height and job->pixel_aspect_width to the desired PAR. For now this is only for really advanced users who know what numbers they want for those values. Controlled through the CLI as optional arguments to -P. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1459 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/scan.c4
-rw-r--r--test/test.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/libhb/scan.c b/libhb/scan.c
index b139e5e4c..1fe3353ed 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -176,12 +176,12 @@ static void ScanFunc( void * _data )
/* Autocrop by default. Gnark gnark */
memcpy( job->crop, title->crop, 4 * sizeof( int ) );
- if( title->aspect == 16 )
+ if( title->aspect == 16 && !job->pixel_aspect_width && !job->pixel_aspect_height)
{
hb_reduce( &job->pixel_aspect_width, &job->pixel_aspect_height,
16 * title->height, 9 * title->width );
}
- else
+ else if( !job->pixel_aspect_width && !job->pixel_aspect_height )
{
hb_reduce( &job->pixel_aspect_width, &job->pixel_aspect_height,
4 * title->height, 3 * title->width );
diff --git a/test/test.c b/test/test.c
index f2996b449..1731edddf 100644
--- a/test/test.c
+++ b/test/test.c
@@ -68,6 +68,8 @@ static int mux = 0;
static int pixelratio = 0;
static int loosePixelratio = 0;
static int modulus = 0;
+static int par_height = 0;
+static int par_width = 0;
static int chapter_start = 0;
static int chapter_end = 0;
static int chapter_markers = 0;
@@ -792,6 +794,12 @@ static int HandleEvents( hb_handle_t * h )
{
job->modulus = modulus;
}
+ if( par_width && par_height )
+ {
+ job->pixel_ratio = 3;
+ job->pixel_aspect_width = par_width;
+ job->pixel_aspect_height = par_height;
+ }
}
else
{
@@ -1458,8 +1466,9 @@ static void ShowHelp()
" -g, --grayscale Grayscale encoding\n"
" -p, --pixelratio Store pixel aspect ratio in video stream\n"
" -P, --loosePixelratio Store pixel aspect ratio with specified width\n"
- " <modulus> Takes as optional argument what number you want\n"
+ " <MOD:PARX:PARY> Takes as optional arguments what number you want\n"
" the dimensions to divide cleanly by (default 16)\n"
+ " and the pixel ratio to use (default autodetected)\n)"
"\n"
@@ -1864,7 +1873,7 @@ static int ParseOptions( int argc, char ** argv )
loosePixelratio = 1;
if( optarg != NULL )
{
- modulus = atoi( optarg );
+ sscanf( optarg, "%i:%i:%i", &modulus, &par_width, &par_height );
}
break;
case 'e':