[vlc-devel] commit: x264.c: add psy-rd string to modify psy-rd settings (Ilkka Ollakka )

git version control git at videolan.org
Wed Jul 22 10:06:48 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Jul 22 10:32:17 2009 +0300| [828d9e7766473dc7c7bf819b0a795589a4c9066d] | committer: Ilkka Ollakka 

x264.c: add psy-rd string to modify psy-rd settings

psy-rd should be default on when subme >= 6 (x264 library mentions
this), and I'm not sure how much this options is used in 'normal use'

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

 modules/codec/x264.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 484db53..9aa41d0 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -272,6 +272,13 @@ static void Close( vlc_object_t * );
     "-1 is automatic, based on number of threads." )
 #endif
 
+#if X264_BUILD >= 65
+#define PSY_RD_TEXT N_( "Strength of psychovisual optimization, default is \"1.0:0.0\"")
+#define PSY_RD_LONGTEXT N_( "First parameter controls if RD is on (subme>=6) or off"\
+        "second parameter controls if Trellis is used on psychovisual optimization," \
+        "default off")
+#endif
+
 #define SUBME_TEXT N_("Subpixel motion estimation and partition decision " \
     "quality")
 #if X264_BUILD >= 65 
@@ -480,6 +487,11 @@ vlc_module_begin ()
                  FILTER_LONGTEXT, false )
         add_deprecated_alias( SOUT_CFG_PREFIX "filter" ) /* Deprecated since 0.8.6 */
 
+#if X264_BUILD >= 65
+    add_string( SOUT_CFG_PREFIX "psy-rd", "1.0:0.0", NULL, PSY_RD_TEXT,
+                PSY_RD_LONGTEXT, false )
+
+#endif
     add_string( SOUT_CFG_PREFIX "level", "5.1", NULL, LEVEL_TEXT,
                LEVEL_LONGTEXT, false )
 
@@ -730,7 +742,7 @@ static const char *const ppsz_sout_options[] = {
     "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",NULL
+    "aq-strength", "psy-rd", NULL
 };
 
 static block_t *Encode( encoder_t *, picture_t * );
@@ -926,6 +938,18 @@ static int  Open ( vlc_object_t *p_this )
         free( val.psz_string );
     }
 
+#if X264_BUILD >= 65
+    var_Get( p_enc, SOUT_CFG_PREFIX "psy-rd", &val );
+    if( val.psz_string )
+    {
+        char *p = strchr( val.psz_string, ':' );
+        p_sys->param.analyse.f_psy_rd = atof( val.psz_string );
+        p_sys->param.analyse.f_psy_trellis = p ? atof( p+1 ) : 0;
+        free( val.psz_string );
+    }
+
+#endif
+
     var_Get( p_enc, SOUT_CFG_PREFIX "level", &val );
     if( val.psz_string )
     {




More information about the vlc-devel mailing list