[x264-devel] [PATCH] Create eval.h header corresponding to eval.c file and use it in ratecontrol.c

Loic Le Loarer lll+vlc at m4x.org
Sun Aug 3 20:09:27 CEST 2008


---
 encoder/eval.c        |    2 ++
 encoder/eval.h        |   31 +++++++++++++++++++++++++++++++
 encoder/ratecontrol.c |    5 +----
 3 files changed, 34 insertions(+), 4 deletions(-)
 create mode 100644 encoder/eval.h

diff --git a/encoder/eval.c b/encoder/eval.c
index 6608548..d0a6a21 100644
--- a/encoder/eval.c
+++ b/encoder/eval.c
@@ -30,6 +30,8 @@
 #include <string.h>
 #include <math.h>
 
+#include "eval.h"
+
 #ifndef NAN
   #define NAN 0
 #endif
diff --git a/encoder/eval.h b/encoder/eval.h
new file mode 100644
index 0000000..92fa9bc
--- /dev/null
+++ b/encoder/eval.h
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * simple arithmetic expression evaluator
+ *****************************************************************************
+ * Copyright (c) 2002 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *****************************************************************************/
+
+/**
+ * @file eval.h
+ * simple arithmetic expression evaluator.
+ *
+ * see http://joe.hotchkiss.com/programming/eval/eval.html
+ */
+
+double x264_eval(char *s, double *const_value, const char **const_name,
+                 double (**func1)(void *, double), const char **func1_name,
+                 double (**func2)(void *, double, double), char **func2_name,
+                 void *opaque);
diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 9f0b148..d8c1b2d 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1132,10 +1132,7 @@ void x264_ratecontrol_end( x264_t *h, int bits )
  * 2 pass functions
  ***************************************************************************/
 
-double x264_eval( char *s, double *const_value, const char **const_name,
-                  double (**func1)(void *, double), const char **func1_name,
-                  double (**func2)(void *, double, double), char **func2_name,
-                  void *opaque );
+#include "eval.h"
 
 /**
  * modify the bitrate curve from pass1 for one frame
-- 
1.5.6



More information about the x264-devel mailing list