[vlc-devel] commit: x264.c: add option to fiddle weighting for P-frames from x264_BUILD >= 79 ( Ilkka Ollakka )

git version control git at videolan.org
Sun Dec 6 21:59:35 CET 2009


vlc | branch: 1.0-bugfix | Ilkka Ollakka <ileoo at videolan.org> | Tue Oct 20 13:05:15 2009 +0300| [38207349d4281747fc79b4ea392cdc72b975c749] | committer: Ilkka Ollakka 

x264.c: add option to fiddle weighting for P-frames from x264_BUILD >= 79

Cherry-picked from 85baa88705c2319c8716114f19cfadc836659c4d

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38207349d4281747fc79b4ea392cdc72b975c749
---

 modules/codec/x264.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 6514d2d..dd73922 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -255,6 +255,12 @@ static void Close( vlc_object_t * );
 #define WEIGHTB_TEXT N_("Weighted prediction for B-frames")
 #define WEIGHTB_LONGTEXT N_( "Weighted prediction for B-frames.")
 
+#define WEIGHTP_TEXT N_("Weighted prediction for P-frames")
+#define WEIGHTP_LONGTEXT N_(" Weighted prediction for P-frames: "\
+    " - 0: Disabled\n"\
+    " - 1: Blind offset\n"\
+    " - 2: Smart analysis\n" )
+
 #define ME_TEXT N_("Integer pixel motion estimation method")
 #if X264_BUILD >= 58 /* r728 */
 #define ME_LONGTEXT N_( "Selects the motion estimation algorithm: "\
@@ -621,6 +627,12 @@ vlc_module_begin ()
               WEIGHTB_LONGTEXT, false )
 #endif
 
+#if X264_BUILD >= 79
+    add_integer( SOUT_CFG_PREFIX "weightp", 2, NULL, WEIGHTP_TEXT,
+              WEIGHTP_LONGTEXT, false )
+        change_integer_range( 0, 2 )
+#endif
+
 #if X264_BUILD >= 24 /* r221 */
     add_string( SOUT_CFG_PREFIX "me", "hex", NULL, ME_TEXT,
                 ME_LONGTEXT, false )
@@ -764,8 +776,8 @@ static const char *const ppsz_sout_options[] = {
     "pre-scenecut", "psnr", "qblur", "qp", "qcomp", "qpstep", "qpmax",
     "qpmin", "qp-max", "qp-min", "quiet", "ratetol", "ref", "scenecut",
     "sps-id", "ssim", "stats", "subme", "subpel", "tolerance", "trellis",
-    "verbose", "vbv-bufsize", "vbv-init", "vbv-maxrate", "weightb", "aq-mode",
-    "aq-strength", "profile", NULL
+    "verbose", "vbv-bufsize", "vbv-init", "vbv-maxrate", "weightb", "weightp", "aq-mode",
+    "aq-strength", "profile", "lookahead", NULL
 };
 
 static block_t *Encode( encoder_t *, picture_t * );
@@ -1152,6 +1164,11 @@ static int  Open ( vlc_object_t *p_this )
         p_sys->param.i_bframe_bias = val.i_int;
 #endif
 
+#if X264_BUILD >= 79
+    p_sys->param.analyse.i_weighted_pred = var_GetInteger( p_enc, SOUT_CFG_PREFIX "weightp" );
+#endif
+
+
 #if X264_BUILD >= 23
     var_Get( p_enc, SOUT_CFG_PREFIX "chroma-me", &val );
     p_sys->param.analyse.b_chroma_me = val.b_bool;
@@ -1313,6 +1330,9 @@ static int  Open ( vlc_object_t *p_this )
             p_sys->param.analyse.b_transform_8x8 = 0;
             p_sys->param.b_cabac = 0;
             p_sys->param.i_bframe = 0;
+#if X264_BUILD >= 79
+            p_sys->param.analyse.i_weighted_pred = X264_WEIGHTP_NONE;
+#endif
         }
         else if (!strcasecmp( val.psz_string, "main" ) )
         {




More information about the vlc-devel mailing list