summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/eval.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-03-26 14:43:46 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-03-26 14:43:46 +0000
commita5adaebc130805962f83deccb29f47a7a2384fc8 (patch)
tree50ce22f99ced67b6d975632574ce4b392ed820ad /src/libffmpeg/libavcodec/eval.c
parent689bd7704fde776152e6883ce1b6022ec638304b (diff)
downloadxine-lib-a5adaebc130805962f83deccb29f47a7a2384fc8.tar.gz
xine-lib-a5adaebc130805962f83deccb29f47a7a2384fc8.tar.bz2
update ffmpeg. trying to keep local changes (see diff_to_ffmpeg_cvs.txt), let me
know if i overlooked something. as usual, preliminary QA: tested non debug builds and several codecs including divx3/4/5, mpeg4, xvid, msmpeg4v3, svq1, wmv7, dv (video/audio), wma i also enabled wmv8 by default since it worked fine with the streams i have. i'm not sure about current state of that so we might enable it only for non-x86 users in case of trouble. CVS patchset: 4488 CVS date: 2003/03/26 14:43:46
Diffstat (limited to 'src/libffmpeg/libavcodec/eval.c')
-rw-r--r--src/libffmpeg/libavcodec/eval.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libffmpeg/libavcodec/eval.c b/src/libffmpeg/libavcodec/eval.c
index bcaf4f59b..28a492cd4 100644
--- a/src/libffmpeg/libavcodec/eval.c
+++ b/src/libffmpeg/libavcodec/eval.c
@@ -19,10 +19,16 @@
*
*/
- /*
+/**
+ * @file eval.c
+ * simple arithmetic expression evaluator.
+ *
* see http://joe.hotchkiss.com/programming/eval/eval.html
*/
+#include "avcodec.h"
+#include "mpegvideo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -43,9 +49,9 @@ typedef struct Parser{
int stack_index;
char *s;
double *const_value;
- char **const_name; // NULL terminated
+ const char **const_name; // NULL terminated
double (**func1)(void *, double a); // NULL terminated
- char **func1_name; // NULL terminated
+ const char **func1_name; // NULL terminated
double (**func2)(void *, double a, double b); // NULL terminated
char **func2_name; // NULL terminated
void *opaque;
@@ -71,7 +77,7 @@ static double pop(Parser *p){
return p->stack[ --p->stack_index ];
}
-static int strmatch(char *s, char *prefix){
+static int strmatch(const char *s, const char *prefix){
int i;
for(i=0; prefix[i]; i++){
if(prefix[i] != s[i]) return 0;
@@ -126,7 +132,7 @@ static void evalPrimary(Parser *p){
else if( strmatch(next, "log" ) ) d= log(d);
else if( strmatch(next, "squish") ) d= 1/(1+exp(4*d));
else if( strmatch(next, "gauss" ) ) d= exp(-d*d/2)/sqrt(2*M_PI);
- else if( strmatch(next, "abs" ) ) d= abs(d);
+ else if( strmatch(next, "abs" ) ) d= fabs(d);
else if( strmatch(next, "max" ) ) d= d > d2 ? d : d2;
else if( strmatch(next, "min" ) ) d= d < d2 ? d : d2;
else if( strmatch(next, "gt" ) ) d= d > d2 ? 1.0 : 0.0;
@@ -228,8 +234,8 @@ static void evalExpression(Parser *p){
}
}
-double ff_eval(char *s, double *const_value, char **const_name,
- double (**func1)(void *, double), char **func1_name,
+double ff_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){
Parser p;