<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=windows-1252"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Sašo Kiselkov wrote:
<blockquote cite="mid45CE3B62.3010506@gmail.com" type="cite">
<pre wrap="">Antoine Cellerier wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Thu, Feb 08, 2007, Sa?o Kiselkov wrote:
</pre>
<blockquote type="cite">
<pre wrap="">So, as I understand it, var_Get always allocates new memory, so
theoretically would be sufficient to do a simple assignment of the
pointer value, instead of doing a strdup and free of the original right
afterwards, right? Oh and I will add a free into Close().
</pre>
</blockquote>
<pre wrap="">Yes, it is sufficient.
</pre>
</blockquote>
<pre wrap=""><!---->
I've updated the patch, so here it is again with the changes mentioned.
--
Saso
</pre>
<pre wrap="">
<hr size="4" width="90%">
--- vlc-0.8.6-old/modules/codec/x264.c 2006-12-09 02:12:20.000000000 +0100
+++ vlc-0.8.6/modules/codec/x264.c 2007-02-09 20:50:13.000000000 +0100
@@ -285,6 +285,14 @@
#define ASM_TEXT N_("CPU optimizations")
#define ASM_LONGTEXT N_( "Use assembler CPU optimizations.")
+#define STAT_IN_TEXT N_("Statistics input file")
+#define STAT_IN_LONGTEXT N_( "Read rate-control stastics from provided file (for multi-pass " \
+ "encoding.")
+
+#define STAT_OUT_TEXT N_("Statistics output file")
+#define STAT_OUT_LONGTEXT N_( "Write rate-control stastics to provided file (for multi-pass " \
+ "encoding.")
+
#define PSNR_TEXT N_("PSNR computation")
#define PSNR_LONGTEXT N_( "Compute and print PSNR stats. This has no effect on " \
"the actual encoding quality." )
@@ -582,6 +590,12 @@
VERBOSE_LONGTEXT, VLC_FALSE );
#endif
+ add_string( SOUT_CFG_PREFIX "stat-in", NULL, NULL, STAT_IN_TEXT,
+ STAT_IN_LONGTEXT, VLC_FALSE );
+
+ add_string( SOUT_CFG_PREFIX "stat-out", NULL, NULL, STAT_OUT_TEXT,
+ STAT_OUT_LONGTEXT, VLC_FALSE );
+
vlc_module_end();
/*****************************************************************************
@@ -597,7 +611,8 @@
"pbratio", "psnr", "qblur", "qp", "qcomp", "qpstep", "qpmax", "qpmin",
"qp-max", "qp-min", "quiet", "ratetol", "ref", "scenecut", "sps-id",
"ssim", "subme", "subpel", "tolerance", "trellis", "verbose",
- "vbv-bufsize", "vbv-init", "vbv-maxrate", "weightb", NULL
+ "vbv-bufsize", "vbv-init", "vbv-maxrate", "weightb", "stat-in", "stat-out",
+ NULL
};
static block_t *Encode( encoder_t *, picture_t * );
@@ -1062,6 +1077,35 @@
p_sys->param.i_threads = p_enc->i_threads;
#endif
+ /* Statistics input/output preferences */
+ var_Get( p_enc, SOUT_CFG_PREFIX "stat-in", &val );
+ if( val.psz_string && *val.psz_string )
+ {
+ p_sys->param.rc.b_stat_read = 1;
+ p_sys->param.rc.psz_stat_in = val.psz_string;
+
+ msg_Dbg( p_enc, "Reading encoding statistics from \"%s\"\n",
+ p_sys->param.rc.psz_stat_in );
+ }
+ else
+ {
+ p_sys->param.rc.b_stat_read = 0;
+ }
+
+ var_Get( p_enc, SOUT_CFG_PREFIX "stat-out", &val );
+ if( val.psz_string && *val.psz_string )
+ {
+ p_sys->param.rc.b_stat_write = 1;
+ p_sys->param.rc.psz_stat_out = val.psz_string;
+
+ msg_Dbg( p_enc, "Writing encoding statistics to \"%s\"\n",
+ p_sys->param.rc.psz_stat_out );
+ }
+ else
+ {
+ p_sys->param.rc.b_stat_write = 0;
+ }
+
/* Open the encoder */
p_sys->h = x264_encoder_open( &p_sys->param );
@@ -1179,6 +1223,16 @@
{
encoder_t *p_enc = (encoder_t *)p_this;
encoder_sys_t *p_sys = p_enc->p_sys;
+
+ if( p_sys->param.rc.b_stat_read )
+ {
+ free( p_sys->param.rc.psz_stat_in );
+ }
+
+ if( p_sys->param.rc.b_stat_write )
+ {
+ free( p_sys->param.rc.psz_stat_out );
+ }
x264_encoder_close( p_sys->h );
free( p_sys->p_buffer );
</pre>
</blockquote>
looks the same to me ..<br>
</body>
</html>