]> git.sesse.net Git - x264/blobdiff - x264.c
oops, scenecut detection failed to activate when using threads and not using B-frames
[x264] / x264.c
diff --git a/x264.c b/x264.c
index 1614aa878c0b3abcdcdf16869f6493bfbabc2352..7718a06664582c9d5dca1f8cf35bb4ca2e7b6bb0 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * x264: h264 encoder/decoder testing program.
+ * x264: h264 encoder testing program.
  *****************************************************************************
  * Copyright (C) 2003 Laurent Aimar
  * $Id: x264.c,v 1.1 2004/06/03 19:24:12 fenrir Exp $
@@ -92,6 +92,12 @@ int main( int argc, char **argv )
 {
     x264_param_t param;
     cli_opt_t opt;
+    int ret;
+
+#ifdef PTW32_STATIC_LIB
+    pthread_win32_process_attach_np();
+    pthread_win32_thread_attach_np();
+#endif
 
 #ifdef _MSC_VER
     _setmode(_fileno(stdin), _O_BINARY);
@@ -107,7 +113,14 @@ int main( int argc, char **argv )
     /* Control-C handler */
     signal( SIGINT, SigIntHandler );
 
-    return Encode( &param, &opt );
+    ret = Encode( &param, &opt );
+
+#ifdef PTW32_STATIC_LIB
+    pthread_win32_thread_detach_np();
+    pthread_win32_process_detach_np();
+#endif
+
+    return ret;
 }
 
 static char const *strtable_lookup( const char * const table[], int index )
@@ -156,6 +169,8 @@ static void Help( x264_param_t *defaults, int b_longhelp )
     H0( "  -I, --keyint <integer>      Maximum GOP size [%d]\n", defaults->i_keyint_max );
     H1( "  -i, --min-keyint <integer>  Minimum GOP size [%d]\n", defaults->i_keyint_min );
     H1( "      --scenecut <integer>    How aggressively to insert extra I-frames [%d]\n", defaults->i_scenecut_threshold );
+    H1( "      --pre-scenecut          Faster, less precise scenecut detection.\n"
+        "                                  Required and implied by multi-threading.\n" );
     H0( "  -b, --bframes <integer>     Number of B-frames between I and P [%d]\n", defaults->i_bframe );
     H1( "      --no-b-adapt            Disable adaptive B-frame decision\n" );
     H1( "      --b-bias <integer>      Influences how often B-frames are used [%d]\n", defaults->i_bframe_bias );
@@ -171,7 +186,7 @@ static void Help( x264_param_t *defaults, int b_longhelp )
     H0( "\n" );
     H0( "  -q, --qp <integer>          Set QP (0=lossless) [%d]\n", defaults->rc.i_qp_constant );
     H0( "  -B, --bitrate <integer>     Set bitrate (kbit/s)\n" );
-    H0( "      --crf <integer>         Quality-based VBR (nominal QP)\n" );
+    H0( "      --crf <float>           Quality-based VBR (nominal QP)\n" );
     H1( "      --vbv-maxrate <integer> Max local bitrate (kbit/s) [%d]\n", defaults->rc.i_vbv_max_bitrate );
     H0( "      --vbv-bufsize <integer> Enable CBR and set size of the VBV buffer (kbit) [%d]\n", defaults->rc.i_vbv_buffer_size );
     H1( "      --vbv-init <float>      Initial VBV buffer occupancy [%.1f]\n", defaults->rc.f_vbv_buffer_init );
@@ -223,6 +238,8 @@ static void Help( x264_param_t *defaults, int b_longhelp )
         "                                  - esa: exhaustive search (slow)\n" );
     else H0( "                                  - dia, hex, umh\n" );
     H0( "      --merange <integer>     Maximum motion vector search range [%d]\n", defaults->analyse.i_me_range );
+    H1( "      --mvrange <integer>     Maximum motion vector length [-1 (auto)]\n" );
+    H1( "      --mvrange-thread <int>  Minimum buffer between threads [-1 (auto)]\n" );
     H0( "  -m, --subme <integer>       Subpixel motion estimation and partition\n"
         "                                  decision quality: 1=fast, 7=best. [%d]\n", defaults->analyse.i_subpel_refine );
     H0( "      --b-rdo                 RD based mode decision for B-frames. Requires subme 6.\n" );
@@ -296,8 +313,9 @@ static void Help( x264_param_t *defaults, int b_longhelp )
     H0( "      --quiet                 Quiet Mode\n" );
     H0( "      --no-psnr               Disable PSNR computation\n" );
     H0( "      --no-ssim               Disable SSIM computation\n" );
-    H0( "      --threads <integer>     Parallel encoding (uses slices)\n" );
+    H0( "      --threads <integer>     Parallel encoding\n" );
     H0( "      --thread-input          Run Avisynth in its own thread\n" );
+    H1( "      --non-deterministic     Slightly improve quality of SMP, at the cost of repeatability\n" );
     H1( "      --no-asm                Disable all CPU optimizations\n" );
     H1( "      --visualize             Show MB types overlayed on the encoded video\n" );
     H1( "      --sps-id <integer>      Set SPS and PPS id numbers [%d]\n", defaults->i_sps_id );
@@ -361,8 +379,9 @@ static int  Parse( int argc, char **argv,
             { "min-keyint",required_argument,NULL,'i' },
             { "keyint",  required_argument, NULL, 'I' },
             { "scenecut",required_argument, NULL, 0 },
+            { "pre-scenecut", no_argument,  NULL, 0 },
             { "nf",      no_argument,       NULL, 0 },
-            { "nodeblock", no_argument,     NULL, 0 },
+            { "no-deblock", no_argument,    NULL, 0 },
             { "filter",  required_argument, NULL, 0 },
             { "deblock", required_argument, NULL, 'f' },
             { "interlaced", no_argument,    NULL, 0 },
@@ -386,6 +405,8 @@ static int  Parse( int argc, char **argv,
             { "weightb", no_argument,       NULL, 'w' },
             { "me",      required_argument, NULL, 0 },
             { "merange", required_argument, NULL, 0 },
+            { "mvrange", required_argument, NULL, 0 },
+            { "mvrange-thread", required_argument, NULL, 0 },
             { "subme",   required_argument, NULL, 'm' },
             { "b-rdo",   no_argument,       NULL, 0 },
             { "mixed-refs", no_argument,    NULL, 0 },
@@ -415,6 +436,7 @@ static int  Parse( int argc, char **argv,
             { "qpfile",  required_argument, NULL, OPT_QPFILE },
             { "threads", required_argument, NULL, 0 },
             { "thread-input", no_argument,  NULL, OPT_THREAD_INPUT },
+            { "non-deterministic", no_argument, NULL, 0 },
             { "no-psnr", no_argument,       NULL, 0 },
             { "no-ssim", no_argument,       NULL, 0 },
             { "quiet",   no_argument,       NULL, OPT_QUIET },