summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2007-10-16 19:00:41 +0000
committerjbrjake <[email protected]>2007-10-16 19:00:41 +0000
commitc832b1edbbff5692fdc6b55ec245e013d1b1dce9 (patch)
tree25ab3d8313fad66b1fb3284eebbfca0ab7649740 /test/test.c
parent3a86ddf273f92ad057e40f4b6f08545d3cef86a4 (diff)
"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
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/test/test.c b/test/test.c
index b9b0c4254..2d84c6624 100644
--- a/test/test.c
+++ b/test/test.c
@@ -53,6 +53,8 @@ static int abitrate = 0;
static int mux = 0;
static int acodec = 0;
static int pixelratio = 0;
+static int loosePixelratio = 0;
+static int modulus = 0;
static int chapter_start = 0;
static int chapter_end = 0;
static int chapter_markers = 0;
@@ -449,8 +451,18 @@ static int HandleEvents( hb_handle_t * h )
job->deinterlace = deinterlace;
job->grayscale = grayscale;
- job->pixel_ratio = pixelratio;
-
+ if (loosePixelratio)
+ {
+ job->pixel_ratio = 2;
+ if (modulus)
+ {
+ job->modulus = modulus;
+ }
+ }
+ else
+ {
+ job->pixel_ratio = pixelratio;
+ }
/* Add selected filters */
job->filters = hb_list_init();
if( detelecine )
@@ -484,16 +496,23 @@ static int HandleEvents( hb_handle_t * h )
job->width = width;
hb_fix_aspect( job, HB_KEEP_WIDTH );
}
- else if( height )
+ else if( height && !loosePixelratio)
{
job->height = height;
hb_fix_aspect( job, HB_KEEP_HEIGHT );
}
- else if( !width && !height && !pixelratio )
+ else if( !width && !height && !pixelratio && !loosePixelratio )
{
hb_fix_aspect( job, HB_KEEP_WIDTH );
}
-
+ else if (!width && loosePixelratio)
+ {
+ /* Default to full width when one isn't specified for loose anamorphic */
+ job->width = title->width - job->crop[2] - job->crop[3];
+ /* The height will be thrown away in hb.c but calculate it anyway */
+ hb_fix_aspect( job, HB_KEEP_WIDTH );
+ }
+
if( vquality >= 0.0 && vquality <= 1.0 )
{
job->vquality = vquality;
@@ -874,6 +893,10 @@ static void ShowHelp()
" <L:R:T:B:SB:MP> (default 1:1:4:4:0:0)\n"
" -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"
+ " the dimensions to divide cleanly by (default 16)\n"
+
"\n"
@@ -949,6 +972,7 @@ static int ParseOptions( int argc, char ** argv )
{ "detelecine", optional_argument, NULL, '9' },
{ "grayscale", no_argument, NULL, 'g' },
{ "pixelratio", no_argument, NULL, 'p' },
+ { "loosePixelratio", optional_argument, NULL, 'P' },
{ "width", required_argument, NULL, 'w' },
{ "height", required_argument, NULL, 'l' },
{ "crop", required_argument, NULL, 'n' },
@@ -973,7 +997,7 @@ static int ParseOptions( int argc, char ** argv )
int c;
c = getopt_long( argc, argv,
- "hvuC:f:4i:o:t:Lc:ma:6:s:UFN:e:E:2d789gpw:l:n:b:q:S:B:r:R:Qx:TY:X:",
+ "hvuC:f:4i:o:t:Lc:ma:6:s:UFN:e:E:2d789gpP::w:l:n:b:q:S:B:r:R:Qx:TY:X:",
long_options, &option_index );
if( c < 0 )
{
@@ -1115,6 +1139,13 @@ static int ParseOptions( int argc, char ** argv )
case 'p':
pixelratio = 1;
break;
+ case 'P':
+ loosePixelratio = 1;
+ if( optarg != NULL )
+ {
+ modulus = atoi( optarg );
+ }
+ break;
case 'e':
if( !strcasecmp( optarg, "ffmpeg" ) )
{