summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2007-07-27 14:55:58 +0000
committerjbrjake <[email protected]>2007-07-27 14:55:58 +0000
commit5a4a250000ce8735639503aac2ee29def935865d (patch)
treed7efc0e7e44e06e80ba67827e137c970ac02743e /test/test.c
parent50c3c15c88172bb00dd787e39ce66eb11480717d (diff)
This huge patch from huevos_rancheros ports a number of video filters from mencoder to HandBrake: yadif+mcdeint, hqdn3d, pp7, and pullup+softskip+harddup. What this means is that HB now has stateless inverse telecine, temporal denoising, and motion-adaptive deinterlacing!
HandBrake is growing up =) Thank you, huevos_rancheros! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@749 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c73
1 files changed, 69 insertions, 4 deletions
diff --git a/test/test.c b/test/test.c
index 929e3eb20..d2a0a2d4f 100644
--- a/test/test.c
+++ b/test/test.c
@@ -24,7 +24,14 @@ static int longest_title = 0;
static int subtitle_scan = 0;
static char * native_language = NULL;
static int twoPass = 0;
-static int deinterlace = 0;
+static int deinterlace = 0;
+static char * deinterlace_opt = 0;
+static int deblock = 0;
+static char * deblock_opt = 0;
+static int denoise = 0;
+static char * denoise_opt = 0;
+static int detelecine = 0;
+static char * detelecine_opt = 0;
static int grayscale = 0;
static int vcodec = HB_VCODEC_FFMPEG;
static int h264_13 = 0;
@@ -427,6 +434,29 @@ static int HandleEvents( hb_handle_t * h )
job->grayscale = grayscale;
job->pixel_ratio = pixelratio;
+ /* Add selected filters */
+ job->filters = hb_list_init();
+ if( detelecine )
+ {
+ hb_filter_detelecine.settings = detelecine_opt;
+ hb_list_add( job->filters, &hb_filter_detelecine );
+ }
+ if( deinterlace )
+ {
+ hb_filter_deinterlace.settings = deinterlace_opt;
+ hb_list_add( job->filters, &hb_filter_deinterlace );
+ }
+ if( deblock )
+ {
+ hb_filter_deblock.settings = deblock_opt;
+ hb_list_add( job->filters, &hb_filter_deblock );
+ }
+ if( denoise )
+ {
+ hb_filter_denoise.settings = denoise_opt;
+ hb_list_add( job->filters, &hb_filter_denoise );
+ }
+
if( width && height )
{
job->width = width;
@@ -778,7 +808,14 @@ static void ShowHelp()
fprintf( stderr, ")\n"
"\n"
" -2, --two-pass Use two-pass mode\n"
- " -d, --deinterlace Deinterlace video\n"
+ " -d, --deinterlace Deinterlace video with yadif/mcdeint filter\n"
+ " <YM:FD:MM:QP> (default 0:-1:-1:1)\n"
+ " -7, --deblock Deblock video with pp7 filter\n"
+ " <QP:M> (default 0:2)\n"
+ " -8, --denoise Denoise video with hqdn3d filter\n"
+ " <SL:SC:TL:TC> (default 4:3:6:4.5)\n"
+ " -8, --detelecine Detelecine video with pullup filter\n"
+ " <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"
@@ -849,7 +886,10 @@ static int ParseOptions( int argc, char ** argv )
{ "encoder", required_argument, NULL, 'e' },
{ "aencoder", required_argument, NULL, 'E' },
{ "two-pass", no_argument, NULL, '2' },
- { "deinterlace", no_argument, NULL, 'd' },
+ { "deinterlace", optional_argument, NULL, 'd' },
+ { "deblock", optional_argument, NULL, '7' },
+ { "denoise", optional_argument, NULL, '8' },
+ { "detelecine", optional_argument, NULL, '9' },
{ "grayscale", no_argument, NULL, 'g' },
{ "pixelratio", no_argument, NULL, 'p' },
{ "width", required_argument, NULL, 'w' },
@@ -876,7 +916,7 @@ static int ParseOptions( int argc, char ** argv )
int c;
c = getopt_long( argc, argv,
- "hvuC:f:4i:o:t:Lc:ma:6:s:UN:e:E:2dgpw:l:n:b:q:S:B:r:R:Qx:TY:X:",
+ "hvuC:f:4i:o:t:Lc:ma:6:s:UN:e:E:2d789gpw:l:n:b:q:S:B:r:R:Qx:TY:X:",
long_options, &option_index );
if( c < 0 )
{
@@ -982,8 +1022,33 @@ static int ParseOptions( int argc, char ** argv )
twoPass = 1;
break;
case 'd':
+ if( optarg != NULL )
+ {
+ deinterlace_opt = strdup( optarg );
+ }
deinterlace = 1;
break;
+ case '7':
+ if( optarg != NULL )
+ {
+ deblock_opt = strdup( optarg );
+ }
+ deblock = 1;
+ break;
+ case '8':
+ if( optarg != NULL )
+ {
+ denoise_opt = strdup( optarg );
+ }
+ denoise = 1;
+ break;
+ case '9':
+ if( optarg != NULL )
+ {
+ detelecine_opt = strdup( optarg );
+ }
+ detelecine = 1;
+ break;
case 'g':
grayscale = 1;
break;