]> git.sesse.net Git - x264/blobdiff - x264.c
Altivec functions for MC using the cached halfpel planes.
[x264] / x264.c
diff --git a/x264.c b/x264.c
index a9ba4906920ef0e9541be3c25e797cb5d964251d..415e314f567341bb024f10051981301a7dd67c98 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -102,10 +102,12 @@ static void Help( x264_param_t *defaults )
              "\n"
              "  -h, --help                  Print this help\n"
              "\n"
-             "  -I, --idrframe <integer>    Each 'number' I frames are IDR frames [%d]\n"
-             "  -i, --iframe <integer>      Max interval between I frames [%d]\n"
+             "  -I, --keyint <integer  >    Maximum GOP size [%d]\n"
+             "  -i, --min-keyint <integer>  Minimum GOP size [%d]\n"
              "      --scenecut <integer>    How aggresively to insert extra I frames [%d]\n"
              "  -b, --bframe <integer>      Number of B-frames between I and P [%d]\n"
+             "      --no-b-adapt            Disable adaptive B-frame decision\n"
+             "      --b-bias <integer>      Influences how often B-frames are used [%d]\n"
              "\n"
              "  -c, --cabac                 Enable CABAC\n"
              "  -r, --ref <integer>         Number of reference frames [%d]\n"
@@ -137,8 +139,10 @@ static void Help( x264_param_t *defaults )
              "                                  - none, all\n"
              "      --direct <string>       Direct MV prediction mode [\"temporal\"]\n"
              "                                  - none, spatial, temporal\n"
+             "  -w, --weightb               Weighted prediction for B-frames\n"
              "  -m, --subme <integer>       Subpixel motion estimation quality: 1=fast, 5=best. [%d]\n"
              "\n"
+             "      --level <integer>       Specify IDC level\n"
              "  -s, --sar width:height      Specify Sample Aspect Ratio\n"
              "      --fps <float|rational>  Specify framerate\n"
              "      --frames <integer>      Maximum number of frames to encode\n"
@@ -150,10 +154,11 @@ static void Help( x264_param_t *defaults )
              "  -v, --verbose               Print stats for each frame\n"
              "\n",
             X264_BUILD,
-            defaults->i_idrframe,
-            defaults->i_iframe,
+            defaults->i_keyint_max,
+            defaults->i_keyint_min,
             defaults->i_scenecut_threshold,
             defaults->i_bframe,
+            defaults->i_bframe_bias,
             defaults->i_frame_reference,
             defaults->i_deblocking_filter_alphac0,
             defaults->rc.i_qp_constant,
@@ -213,14 +218,19 @@ static int  Parse( int argc, char **argv,
 #define OPT_FRAMES 273
 #define OPT_FPS 274
 #define OPT_DIRECT 275
+#define OPT_LEVEL 276
+#define OPT_NOBADAPT 277
+#define OPT_BBIAS 278
 
         static struct option long_options[] =
         {
             { "help",    no_argument,       NULL, 'h' },
             { "bitrate", required_argument, NULL, 'B' },
             { "bframe",  required_argument, NULL, 'b' },
-            { "iframe",  required_argument, NULL, 'i' },
-            { "idrframe",required_argument, NULL, 'I' },
+            { "no-b-adapt", no_argument,    NULL, OPT_NOBADAPT },
+            { "b-bias",  required_argument, NULL, OPT_BBIAS },
+            { "min-keyint",required_argument,NULL,'i' },
+            { "keyint",  required_argument, NULL, 'I' },
             { "scenecut",required_argument, NULL, OPT_SCENECUT },
             { "nf",      no_argument,       NULL, 'n' },
             { "filter",  required_argument, NULL, 'f' },
@@ -237,7 +247,9 @@ static int  Parse( int argc, char **argv,
             { "output",  required_argument, NULL, 'o' },
             { "analyse", required_argument, NULL, 'A' },
             { "direct",  required_argument, NULL, OPT_DIRECT },
+            { "weightb", no_argument,       NULL, 'w' },
             { "subme",   required_argument, NULL, 'm' },
+            { "level",   required_argument, NULL, OPT_LEVEL },
             { "rcsens",  required_argument, NULL, OPT_RCSENS },
             { "rcbuf",   required_argument, NULL, OPT_RCBUF },
             { "rcinitbuf",required_argument,NULL, OPT_RCIBUF },
@@ -257,7 +269,7 @@ static int  Parse( int argc, char **argv,
 
         int c;
 
-        c = getopt_long( argc, argv, "hi:I:b:r:cxB:q:nf:o:s:A:m:p:v",
+        c = getopt_long( argc, argv, "hi:I:b:r:cxB:q:nf:o:s:A:m:p:vw",
                          long_options, &long_options_index);
 
         if( c == -1 )
@@ -280,11 +292,17 @@ static int  Parse( int argc, char **argv,
             case 'b':
                 param->i_bframe = atol( optarg );
                 break;
+            case OPT_NOBADAPT:
+                param->b_bframe_adaptive = 0;
+                break;
+            case OPT_BBIAS:
+                param->i_bframe_bias = atol( optarg );
+                break;
             case 'i':
-                param->i_iframe = atol( optarg );
+                param->i_keyint_min = atol( optarg );
                 break;
             case 'I':
-                param->i_idrframe = atol( optarg );
+                param->i_keyint_max = atol( optarg );
                 break;
             case OPT_SCENECUT:
                 param->i_scenecut_threshold = atol( optarg );
@@ -365,7 +383,7 @@ static int  Parse( int argc, char **argv,
             case 'A':
                 param->analyse.inter = 0;
                 if( strstr( optarg, "none" ) )  param->analyse.inter = 0x000000;
-                if( strstr( optarg, "all" ) )   param->analyse.inter = X264_ANALYSE_I4x4|X264_ANALYSE_PSUB16x16|X264_ANALYSE_PSUB8x8;
+                if( strstr( optarg, "all" ) )   param->analyse.inter = X264_ANALYSE_I4x4|X264_ANALYSE_PSUB16x16|X264_ANALYSE_PSUB8x8|X264_ANALYSE_BSUB16x16;
 
                 if( strstr( optarg, "i4x4" ) )      param->analyse.inter |= X264_ANALYSE_I4x4;
                 if( strstr( optarg, "psub16x16" ) ) param->analyse.inter |= X264_ANALYSE_PSUB16x16;
@@ -382,9 +400,15 @@ static int  Parse( int argc, char **argv,
                 else
                     param->analyse.i_direct_mv_pred = atoi( optarg );
                 break;
+            case 'w':
+                param->analyse.b_weighted_bipred = 1;
+                break;
             case 'm':
                 param->analyse.i_subpel_refine = atoi(optarg);
                 break;
+            case OPT_LEVEL:
+                param->i_level_idc = atoi(optarg);
+                break;
             case OPT_RCBUF:
                 param->rc.i_rc_buffer_size = atoi(optarg);
                 break;
@@ -407,7 +431,7 @@ static int  Parse( int argc, char **argv,
                     param->rc.b_stat_write = 1;
                 else if( i_pass == 2 )
                     param->rc.b_stat_read = 1;
-                else if( i_pass > 2 )   /* XXX untested */
+                else if( i_pass > 2 )
                     param->rc.b_stat_read =
                     param->rc.b_stat_write = 1;
                 break;
@@ -699,7 +723,7 @@ static int  Encode( x264_param_t  *param, FILE *fyuv, FILE *fout )
 
         /* Do not force any parameters */
         pic.i_type = X264_TYPE_AUTO;
-        if( x264_encoder_encode( h, &nal, &i_nal, &pic ) < 0 )
+        if( x264_encoder_encode( h, &nal, &i_nal, &pic, &pic ) < 0 )
         {
             fprintf( stderr, "x264_encoder_encode failed\n" );
         }