|
|
@ -32,6 +32,7 @@ |
|
|
|
#include "eval.h" |
|
|
|
#include "eval.h" |
|
|
|
#include "log.h" |
|
|
|
#include "log.h" |
|
|
|
#include "mathematics.h" |
|
|
|
#include "mathematics.h" |
|
|
|
|
|
|
|
#include "time.h" |
|
|
|
|
|
|
|
|
|
|
|
typedef struct Parser { |
|
|
|
typedef struct Parser { |
|
|
|
const AVClass *class; |
|
|
|
const AVClass *class; |
|
|
@ -156,6 +157,11 @@ struct AVExpr { |
|
|
|
double *var; |
|
|
|
double *var; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static double etime(double v) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return av_gettime() * 0.000001; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static double eval_expr(Parser *p, AVExpr *e) |
|
|
|
static double eval_expr(Parser *p, AVExpr *e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (e->type) { |
|
|
|
switch (e->type) { |
|
|
@ -377,6 +383,7 @@ static int parse_primary(AVExpr **e, Parser *p) |
|
|
|
else if (strmatch(next, "exp" )) d->a.func0 = exp; |
|
|
|
else if (strmatch(next, "exp" )) d->a.func0 = exp; |
|
|
|
else if (strmatch(next, "log" )) d->a.func0 = log; |
|
|
|
else if (strmatch(next, "log" )) d->a.func0 = log; |
|
|
|
else if (strmatch(next, "abs" )) d->a.func0 = fabs; |
|
|
|
else if (strmatch(next, "abs" )) d->a.func0 = fabs; |
|
|
|
|
|
|
|
else if (strmatch(next, "time" )) d->a.func0 = etime; |
|
|
|
else if (strmatch(next, "squish")) d->type = e_squish; |
|
|
|
else if (strmatch(next, "squish")) d->type = e_squish; |
|
|
|
else if (strmatch(next, "gauss" )) d->type = e_gauss; |
|
|
|
else if (strmatch(next, "gauss" )) d->type = e_gauss; |
|
|
|
else if (strmatch(next, "mod" )) d->type = e_mod; |
|
|
|
else if (strmatch(next, "mod" )) d->type = e_mod; |
|
|
|