]> granicus.if.org Git - libx264/commitdiff
--no-fast-pskip
authorLoren Merritt <pengvado@videolan.org>
Mon, 5 Dec 2005 12:46:46 +0000 (12:46 +0000)
committerLoren Merritt <pengvado@videolan.org>
Mon, 5 Dec 2005 12:46:46 +0000 (12:46 +0000)
patch by Alex Wright.

git-svn-id: svn://svn.videolan.org/x264/trunk@384 df754926-b1dd-0310-bc7b-ec298dee348c

common/common.c
encoder/analyse.c
encoder/encoder.c
x264.c
x264.h

index 423d63c3868dcd4ba06aa6dbea03adb88f4e15f3..73878ebe7f43bf64f5431b9bcf235d3b7534a848 100644 (file)
@@ -121,6 +121,7 @@ void    x264_param_default( x264_param_t *param )
     param->analyse.b_chroma_me = 1;
     param->analyse.i_mv_range = -1; // set from level_idc
     param->analyse.i_chroma_qp_offset = 0;
+    param->analyse.b_fast_pskip = 1;
     param->analyse.b_psnr = 1;
 
     param->i_cqm_preset = X264_CQM_FLAT;
index c28c057693fe07ced88b8c91b141f15bec712eda..334220dcf7292b62365b474f1ed91c76e78d6e50 100644 (file)
@@ -1766,7 +1766,7 @@ void x264_macroblock_analyse( x264_t *h )
         int i_intra_cost, i_intra_type;
 
         /* Fast P_SKIP detection */
-        if( !h->mb.b_lossless &&
+        if( h->param.analyse.b_fast_pskip &&
            (( h->mb.i_mb_type_left == P_SKIP ) ||
             ( h->mb.i_mb_type_top == P_SKIP ) ||
             ( h->mb.i_mb_type_topleft == P_SKIP ) ||
index 50148104efd8f0af2ff5f64d0bc4fa58f8f7b1c2..68af6465b001417dadea452405b48f9e4ef696ad 100644 (file)
@@ -367,6 +367,7 @@ static int x264_validate_parameters( x264_t *h )
         h->param.analyse.b_psnr = 0;
         h->param.analyse.i_chroma_qp_offset = 0;
         h->param.analyse.i_trellis = 0;
+        h->param.analyse.b_fast_pskip = 0;
     }
 
     if( ( h->param.i_width % 16 || h->param.i_height % 16 ) && !h->mb.b_lossless )
diff --git a/x264.c b/x264.c
index 61f24b868a2789a76d9d3ddd27e0dbef35299b09..6e72a931b49add4e4752a7d981623767c6f85cfd 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -261,6 +261,7 @@ static void Help( x264_param_t *defaults )
              "                                  - 0: disabled\n"
              "                                  - 1: enabled only on the final encode of a MB\n"
              "                                  - 2: enabled on all mode decisions\n"
+             "      --no-fast-pskip         Disables early SKIP detection on P-frames\n"
              "\n"
              "      --cqm <string>          Preset quant matrices [\"flat\"]\n"
              "                                  - jvt, flat\n"
@@ -478,6 +479,7 @@ static int  Parse( int argc, char **argv,
 #define OPT_MIXED_REFS 314
 #define OPT_CRF 315
 #define OPT_B_RDO 316
+#define OPT_NO_FAST_PSKIP 317
 
         static struct option long_options[] =
         {
@@ -516,6 +518,7 @@ static int  Parse( int argc, char **argv,
             { "no-chroma-me", no_argument,  NULL, OPT_NO_CHROMA_ME },
             { "8x8dct",  no_argument,       NULL, '8' },
             { "trellis", required_argument, NULL, 't' },
+            { "no-fast-pskip", no_argument, NULL, OPT_NO_FAST_PSKIP },
             { "level",   required_argument, NULL, OPT_LEVEL },
             { "ratetol", required_argument, NULL, OPT_RATETOL },
             { "vbv-maxrate", required_argument, NULL, OPT_VBVMAXRATE },
@@ -748,6 +751,9 @@ static int  Parse( int argc, char **argv,
             case 't':
                 param->analyse.i_trellis = atoi(optarg);
                 break;
+            case OPT_NO_FAST_PSKIP:
+                param->analyse.b_fast_pskip = 0;
+                break;
             case OPT_LEVEL:
                 if( atof(optarg) < 6 )
                     param->i_level_idc = (int)(10*atof(optarg)+.5);
diff --git a/x264.h b/x264.h
index a33e75a9962cac4d8a9a89a24e22514fec204179..1de65f7f0610e3745a70b36bc630fcc57fa465b7 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -35,7 +35,7 @@
 
 #include <stdarg.h>
 
-#define X264_BUILD 41
+#define X264_BUILD 42
 
 /* x264_t:
  *      opaque handler for decoder and encoder */
@@ -200,6 +200,7 @@ typedef struct
         int          b_bframe_rdo; /* RD based mode decision for B-frames */
         int          b_mixed_references; /* allow each mb partition in P-frames to have it's own reference number */
         int          i_trellis;  /* trellis RD quantization */
+        int          b_fast_pskip; /* early SKIP detection on P-frames */
 
         int          b_psnr;    /* Do we compute PSNR stats (save a few % of cpu) */
     } analyse;