You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

656 lines
19KB

  1. /*
  2. * Copyright (c) 2002-2006 Michael Niedermayer <michaelni@gmx.at>
  3. * Copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * Libav is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * simple arithmetic expression evaluator.
  24. *
  25. * see http://joe.hotchkiss.com/programming/eval/eval.html
  26. */
  27. #include "avutil.h"
  28. #include "eval.h"
  29. #include "log.h"
  30. #include "mathematics.h"
  31. typedef struct Parser {
  32. const AVClass *class;
  33. int stack_index;
  34. char *s;
  35. const double *const_values;
  36. const char * const *const_names; // NULL terminated
  37. double (* const *funcs1)(void *, double a); // NULL terminated
  38. const char * const *func1_names; // NULL terminated
  39. double (* const *funcs2)(void *, double a, double b); // NULL terminated
  40. const char * const *func2_names; // NULL terminated
  41. void *opaque;
  42. int log_offset;
  43. void *log_ctx;
  44. #define VARS 10
  45. double var[VARS];
  46. } Parser;
  47. static const AVClass class = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) };
  48. static const int8_t si_prefixes['z' - 'E' + 1] = {
  49. ['y'-'E']= -24,
  50. ['z'-'E']= -21,
  51. ['a'-'E']= -18,
  52. ['f'-'E']= -15,
  53. ['p'-'E']= -12,
  54. ['n'-'E']= - 9,
  55. ['u'-'E']= - 6,
  56. ['m'-'E']= - 3,
  57. ['c'-'E']= - 2,
  58. ['d'-'E']= - 1,
  59. ['h'-'E']= 2,
  60. ['k'-'E']= 3,
  61. ['K'-'E']= 3,
  62. ['M'-'E']= 6,
  63. ['G'-'E']= 9,
  64. ['T'-'E']= 12,
  65. ['P'-'E']= 15,
  66. ['E'-'E']= 18,
  67. ['Z'-'E']= 21,
  68. ['Y'-'E']= 24,
  69. };
  70. double av_strtod(const char *numstr, char **tail)
  71. {
  72. double d;
  73. char *next;
  74. d = strtod(numstr, &next);
  75. /* if parsing succeeded, check for and interpret postfixes */
  76. if (next!=numstr) {
  77. if (*next >= 'E' && *next <= 'z') {
  78. int e= si_prefixes[*next - 'E'];
  79. if (e) {
  80. if (next[1] == 'i') {
  81. d*= pow( 2, e/0.3);
  82. next+=2;
  83. } else {
  84. d*= pow(10, e);
  85. next++;
  86. }
  87. }
  88. }
  89. if (*next=='B') {
  90. d*=8;
  91. next++;
  92. }
  93. }
  94. /* if requested, fill in tail with the position after the last parsed
  95. character */
  96. if (tail)
  97. *tail = next;
  98. return d;
  99. }
  100. #define IS_IDENTIFIER_CHAR(c) ((c) - '0' <= 9U || (c) - 'a' <= 25U || (c) - 'A' <= 25U || (c) == '_')
  101. static int strmatch(const char *s, const char *prefix)
  102. {
  103. int i;
  104. for (i=0; prefix[i]; i++) {
  105. if (prefix[i] != s[i]) return 0;
  106. }
  107. /* return 1 only if the s identifier is terminated */
  108. return !IS_IDENTIFIER_CHAR(s[i]);
  109. }
  110. struct AVExpr {
  111. enum {
  112. e_value, e_const, e_func0, e_func1, e_func2,
  113. e_squish, e_gauss, e_ld, e_isnan, e_isinf,
  114. e_mod, e_max, e_min, e_eq, e_gt, e_gte,
  115. e_pow, e_mul, e_div, e_add,
  116. e_last, e_st, e_while, e_floor, e_ceil, e_trunc,
  117. e_sqrt, e_not,
  118. } type;
  119. double value; // is sign in other types
  120. union {
  121. int const_index;
  122. double (*func0)(double);
  123. double (*func1)(void *, double);
  124. double (*func2)(void *, double, double);
  125. } a;
  126. struct AVExpr *param[2];
  127. };
  128. static double eval_expr(Parser *p, AVExpr *e)
  129. {
  130. switch (e->type) {
  131. case e_value: return e->value;
  132. case e_const: return e->value * p->const_values[e->a.const_index];
  133. case e_func0: return e->value * e->a.func0(eval_expr(p, e->param[0]));
  134. case e_func1: return e->value * e->a.func1(p->opaque, eval_expr(p, e->param[0]));
  135. case e_func2: return e->value * e->a.func2(p->opaque, eval_expr(p, e->param[0]), eval_expr(p, e->param[1]));
  136. case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
  137. case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); }
  138. case e_ld: return e->value * p->var[av_clip(eval_expr(p, e->param[0]), 0, VARS-1)];
  139. case e_isnan: return e->value * !!isnan(eval_expr(p, e->param[0]));
  140. case e_isinf: return e->value * !!isinf(eval_expr(p, e->param[0]));
  141. case e_floor: return e->value * floor(eval_expr(p, e->param[0]));
  142. case e_ceil : return e->value * ceil (eval_expr(p, e->param[0]));
  143. case e_trunc: return e->value * trunc(eval_expr(p, e->param[0]));
  144. case e_sqrt: return e->value * sqrt (eval_expr(p, e->param[0]));
  145. case e_not: return e->value * eval_expr(p, e->param[0]) == 0;
  146. case e_while: {
  147. double d = NAN;
  148. while (eval_expr(p, e->param[0]))
  149. d=eval_expr(p, e->param[1]);
  150. return d;
  151. }
  152. default: {
  153. double d = eval_expr(p, e->param[0]);
  154. double d2 = eval_expr(p, e->param[1]);
  155. switch (e->type) {
  156. case e_mod: return e->value * (d - floor(d/d2)*d2);
  157. case e_max: return e->value * (d > d2 ? d : d2);
  158. case e_min: return e->value * (d < d2 ? d : d2);
  159. case e_eq: return e->value * (d == d2 ? 1.0 : 0.0);
  160. case e_gt: return e->value * (d > d2 ? 1.0 : 0.0);
  161. case e_gte: return e->value * (d >= d2 ? 1.0 : 0.0);
  162. case e_pow: return e->value * pow(d, d2);
  163. case e_mul: return e->value * (d * d2);
  164. case e_div: return e->value * (d / d2);
  165. case e_add: return e->value * (d + d2);
  166. case e_last:return e->value * d2;
  167. case e_st : return e->value * (p->var[av_clip(d, 0, VARS-1)]= d2);
  168. }
  169. }
  170. }
  171. return NAN;
  172. }
  173. static int parse_expr(AVExpr **e, Parser *p);
  174. void av_expr_free(AVExpr *e)
  175. {
  176. if (!e) return;
  177. av_expr_free(e->param[0]);
  178. av_expr_free(e->param[1]);
  179. av_freep(&e);
  180. }
  181. static int parse_primary(AVExpr **e, Parser *p)
  182. {
  183. AVExpr *d = av_mallocz(sizeof(AVExpr));
  184. char *next = p->s, *s0 = p->s;
  185. int ret, i;
  186. if (!d)
  187. return AVERROR(ENOMEM);
  188. /* number */
  189. d->value = av_strtod(p->s, &next);
  190. if (next != p->s) {
  191. d->type = e_value;
  192. p->s= next;
  193. *e = d;
  194. return 0;
  195. }
  196. d->value = 1;
  197. /* named constants */
  198. for (i=0; p->const_names && p->const_names[i]; i++) {
  199. if (strmatch(p->s, p->const_names[i])) {
  200. p->s+= strlen(p->const_names[i]);
  201. d->type = e_const;
  202. d->a.const_index = i;
  203. *e = d;
  204. return 0;
  205. }
  206. }
  207. p->s= strchr(p->s, '(');
  208. if (p->s==NULL) {
  209. av_log(p, AV_LOG_ERROR, "Undefined constant or missing '(' in '%s'\n", s0);
  210. p->s= next;
  211. av_expr_free(d);
  212. return AVERROR(EINVAL);
  213. }
  214. p->s++; // "("
  215. if (*next == '(') { // special case do-nothing
  216. av_freep(&d);
  217. if ((ret = parse_expr(&d, p)) < 0)
  218. return ret;
  219. if (p->s[0] != ')') {
  220. av_log(p, AV_LOG_ERROR, "Missing ')' in '%s'\n", s0);
  221. av_expr_free(d);
  222. return AVERROR(EINVAL);
  223. }
  224. p->s++; // ")"
  225. *e = d;
  226. return 0;
  227. }
  228. if ((ret = parse_expr(&(d->param[0]), p)) < 0) {
  229. av_expr_free(d);
  230. return ret;
  231. }
  232. if (p->s[0]== ',') {
  233. p->s++; // ","
  234. parse_expr(&d->param[1], p);
  235. }
  236. if (p->s[0] != ')') {
  237. av_log(p, AV_LOG_ERROR, "Missing ')' or too many args in '%s'\n", s0);
  238. av_expr_free(d);
  239. return AVERROR(EINVAL);
  240. }
  241. p->s++; // ")"
  242. d->type = e_func0;
  243. if (strmatch(next, "sinh" )) d->a.func0 = sinh;
  244. else if (strmatch(next, "cosh" )) d->a.func0 = cosh;
  245. else if (strmatch(next, "tanh" )) d->a.func0 = tanh;
  246. else if (strmatch(next, "sin" )) d->a.func0 = sin;
  247. else if (strmatch(next, "cos" )) d->a.func0 = cos;
  248. else if (strmatch(next, "tan" )) d->a.func0 = tan;
  249. else if (strmatch(next, "atan" )) d->a.func0 = atan;
  250. else if (strmatch(next, "asin" )) d->a.func0 = asin;
  251. else if (strmatch(next, "acos" )) d->a.func0 = acos;
  252. else if (strmatch(next, "exp" )) d->a.func0 = exp;
  253. else if (strmatch(next, "log" )) d->a.func0 = log;
  254. else if (strmatch(next, "abs" )) d->a.func0 = fabs;
  255. else if (strmatch(next, "squish")) d->type = e_squish;
  256. else if (strmatch(next, "gauss" )) d->type = e_gauss;
  257. else if (strmatch(next, "mod" )) d->type = e_mod;
  258. else if (strmatch(next, "max" )) d->type = e_max;
  259. else if (strmatch(next, "min" )) d->type = e_min;
  260. else if (strmatch(next, "eq" )) d->type = e_eq;
  261. else if (strmatch(next, "gte" )) d->type = e_gte;
  262. else if (strmatch(next, "gt" )) d->type = e_gt;
  263. else if (strmatch(next, "lte" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; }
  264. else if (strmatch(next, "lt" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gte; }
  265. else if (strmatch(next, "ld" )) d->type = e_ld;
  266. else if (strmatch(next, "isnan" )) d->type = e_isnan;
  267. else if (strmatch(next, "isinf" )) d->type = e_isinf;
  268. else if (strmatch(next, "st" )) d->type = e_st;
  269. else if (strmatch(next, "while" )) d->type = e_while;
  270. else if (strmatch(next, "floor" )) d->type = e_floor;
  271. else if (strmatch(next, "ceil" )) d->type = e_ceil;
  272. else if (strmatch(next, "trunc" )) d->type = e_trunc;
  273. else if (strmatch(next, "sqrt" )) d->type = e_sqrt;
  274. else if (strmatch(next, "not" )) d->type = e_not;
  275. else {
  276. for (i=0; p->func1_names && p->func1_names[i]; i++) {
  277. if (strmatch(next, p->func1_names[i])) {
  278. d->a.func1 = p->funcs1[i];
  279. d->type = e_func1;
  280. *e = d;
  281. return 0;
  282. }
  283. }
  284. for (i=0; p->func2_names && p->func2_names[i]; i++) {
  285. if (strmatch(next, p->func2_names[i])) {
  286. d->a.func2 = p->funcs2[i];
  287. d->type = e_func2;
  288. *e = d;
  289. return 0;
  290. }
  291. }
  292. av_log(p, AV_LOG_ERROR, "Unknown function in '%s'\n", s0);
  293. av_expr_free(d);
  294. return AVERROR(EINVAL);
  295. }
  296. *e = d;
  297. return 0;
  298. }
  299. static AVExpr *new_eval_expr(int type, int value, AVExpr *p0, AVExpr *p1)
  300. {
  301. AVExpr *e = av_mallocz(sizeof(AVExpr));
  302. if (!e)
  303. return NULL;
  304. e->type =type ;
  305. e->value =value ;
  306. e->param[0] =p0 ;
  307. e->param[1] =p1 ;
  308. return e;
  309. }
  310. static int parse_pow(AVExpr **e, Parser *p, int *sign)
  311. {
  312. *sign= (*p->s == '+') - (*p->s == '-');
  313. p->s += *sign&1;
  314. return parse_primary(e, p);
  315. }
  316. static int parse_factor(AVExpr **e, Parser *p)
  317. {
  318. int sign, sign2, ret;
  319. AVExpr *e0, *e1, *e2;
  320. if ((ret = parse_pow(&e0, p, &sign)) < 0)
  321. return ret;
  322. while(p->s[0]=='^'){
  323. e1 = e0;
  324. p->s++;
  325. if ((ret = parse_pow(&e2, p, &sign2)) < 0) {
  326. av_expr_free(e1);
  327. return ret;
  328. }
  329. e0 = new_eval_expr(e_pow, 1, e1, e2);
  330. if (!e0) {
  331. av_expr_free(e1);
  332. av_expr_free(e2);
  333. return AVERROR(ENOMEM);
  334. }
  335. if (e0->param[1]) e0->param[1]->value *= (sign2|1);
  336. }
  337. if (e0) e0->value *= (sign|1);
  338. *e = e0;
  339. return 0;
  340. }
  341. static int parse_term(AVExpr **e, Parser *p)
  342. {
  343. int ret;
  344. AVExpr *e0, *e1, *e2;
  345. if ((ret = parse_factor(&e0, p)) < 0)
  346. return ret;
  347. while (p->s[0]=='*' || p->s[0]=='/') {
  348. int c= *p->s++;
  349. e1 = e0;
  350. if ((ret = parse_factor(&e2, p)) < 0) {
  351. av_expr_free(e1);
  352. return ret;
  353. }
  354. e0 = new_eval_expr(c == '*' ? e_mul : e_div, 1, e1, e2);
  355. if (!e0) {
  356. av_expr_free(e1);
  357. av_expr_free(e2);
  358. return AVERROR(ENOMEM);
  359. }
  360. }
  361. *e = e0;
  362. return 0;
  363. }
  364. static int parse_subexpr(AVExpr **e, Parser *p)
  365. {
  366. int ret;
  367. AVExpr *e0, *e1, *e2;
  368. if ((ret = parse_term(&e0, p)) < 0)
  369. return ret;
  370. while (*p->s == '+' || *p->s == '-') {
  371. e1 = e0;
  372. if ((ret = parse_term(&e2, p)) < 0) {
  373. av_expr_free(e1);
  374. return ret;
  375. }
  376. e0 = new_eval_expr(e_add, 1, e1, e2);
  377. if (!e0) {
  378. av_expr_free(e1);
  379. av_expr_free(e2);
  380. return AVERROR(ENOMEM);
  381. }
  382. };
  383. *e = e0;
  384. return 0;
  385. }
  386. static int parse_expr(AVExpr **e, Parser *p)
  387. {
  388. int ret;
  389. AVExpr *e0, *e1, *e2;
  390. if (p->stack_index <= 0) //protect against stack overflows
  391. return AVERROR(EINVAL);
  392. p->stack_index--;
  393. if ((ret = parse_subexpr(&e0, p)) < 0)
  394. return ret;
  395. while (*p->s == ';') {
  396. p->s++;
  397. e1 = e0;
  398. if ((ret = parse_subexpr(&e2, p)) < 0) {
  399. av_expr_free(e1);
  400. return ret;
  401. }
  402. e0 = new_eval_expr(e_last, 1, e1, e2);
  403. if (!e0) {
  404. av_expr_free(e1);
  405. av_expr_free(e2);
  406. return AVERROR(ENOMEM);
  407. }
  408. };
  409. p->stack_index++;
  410. *e = e0;
  411. return 0;
  412. }
  413. static int verify_expr(AVExpr *e)
  414. {
  415. if (!e) return 0;
  416. switch (e->type) {
  417. case e_value:
  418. case e_const: return 1;
  419. case e_func0:
  420. case e_func1:
  421. case e_squish:
  422. case e_ld:
  423. case e_gauss:
  424. case e_isnan:
  425. case e_isinf:
  426. case e_floor:
  427. case e_ceil:
  428. case e_trunc:
  429. case e_sqrt:
  430. case e_not:
  431. return verify_expr(e->param[0]);
  432. default: return verify_expr(e->param[0]) && verify_expr(e->param[1]);
  433. }
  434. }
  435. int av_expr_parse(AVExpr **expr, const char *s,
  436. const char * const *const_names,
  437. const char * const *func1_names, double (* const *funcs1)(void *, double),
  438. const char * const *func2_names, double (* const *funcs2)(void *, double, double),
  439. int log_offset, void *log_ctx)
  440. {
  441. Parser p = { 0 };
  442. AVExpr *e = NULL;
  443. char *w = av_malloc(strlen(s) + 1);
  444. char *wp = w;
  445. const char *s0 = s;
  446. int ret = 0;
  447. if (!w)
  448. return AVERROR(ENOMEM);
  449. while (*s)
  450. if (!isspace(*s++)) *wp++ = s[-1];
  451. *wp++ = 0;
  452. p.class = &class;
  453. p.stack_index=100;
  454. p.s= w;
  455. p.const_names = const_names;
  456. p.funcs1 = funcs1;
  457. p.func1_names = func1_names;
  458. p.funcs2 = funcs2;
  459. p.func2_names = func2_names;
  460. p.log_offset = log_offset;
  461. p.log_ctx = log_ctx;
  462. if ((ret = parse_expr(&e, &p)) < 0)
  463. goto end;
  464. if (*p.s) {
  465. av_expr_free(e);
  466. av_log(&p, AV_LOG_ERROR, "Invalid chars '%s' at the end of expression '%s'\n", p.s, s0);
  467. ret = AVERROR(EINVAL);
  468. goto end;
  469. }
  470. if (!verify_expr(e)) {
  471. av_expr_free(e);
  472. ret = AVERROR(EINVAL);
  473. goto end;
  474. }
  475. *expr = e;
  476. end:
  477. av_free(w);
  478. return ret;
  479. }
  480. double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
  481. {
  482. Parser p = { 0 };
  483. p.const_values = const_values;
  484. p.opaque = opaque;
  485. return eval_expr(&p, e);
  486. }
  487. int av_expr_parse_and_eval(double *d, const char *s,
  488. const char * const *const_names, const double *const_values,
  489. const char * const *func1_names, double (* const *funcs1)(void *, double),
  490. const char * const *func2_names, double (* const *funcs2)(void *, double, double),
  491. void *opaque, int log_offset, void *log_ctx)
  492. {
  493. AVExpr *e = NULL;
  494. int ret = av_expr_parse(&e, s, const_names, func1_names, funcs1, func2_names, funcs2, log_offset, log_ctx);
  495. if (ret < 0) {
  496. *d = NAN;
  497. return ret;
  498. }
  499. *d = av_expr_eval(e, const_values, opaque);
  500. av_expr_free(e);
  501. return isnan(*d) ? AVERROR(EINVAL) : 0;
  502. }
  503. #ifdef TEST
  504. #undef printf
  505. #include <string.h>
  506. static const double const_values[] = {
  507. M_PI,
  508. M_E,
  509. 0
  510. };
  511. static const char *const const_names[] = {
  512. "PI",
  513. "E",
  514. 0
  515. };
  516. int main(int argc, char **argv)
  517. {
  518. int i;
  519. double d;
  520. const char **expr, *exprs[] = {
  521. "",
  522. "1;2",
  523. "-20",
  524. "-PI",
  525. "+PI",
  526. "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
  527. "80G/80Gi",
  528. "1k",
  529. "1Gi",
  530. "1gi",
  531. "1GiFoo",
  532. "1k+1k",
  533. "1Gi*3foo",
  534. "foo",
  535. "foo(",
  536. "foo()",
  537. "foo)",
  538. "sin",
  539. "sin(",
  540. "sin()",
  541. "sin)",
  542. "sin 10",
  543. "sin(1,2,3)",
  544. "sin(1 )",
  545. "1",
  546. "1foo",
  547. "bar + PI + E + 100f*2 + foo",
  548. "13k + 12f - foo(1, 2)",
  549. "1gi",
  550. "1Gi",
  551. "st(0, 123)",
  552. "st(1, 123); ld(1)",
  553. /* compute 1+2+...+N */
  554. "st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)",
  555. /* compute Fib(N) */
  556. "st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)",
  557. "while(0, 10)",
  558. "st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))",
  559. "isnan(1)",
  560. "isnan(NAN)",
  561. "isnan(INF)",
  562. "isinf(1)",
  563. "isinf(NAN)",
  564. "isinf(INF)",
  565. "floor(NAN)",
  566. "floor(123.123)",
  567. "floor(-123.123)",
  568. "trunc(123.123)",
  569. "trunc(-123.123)",
  570. "ceil(123.123)",
  571. "ceil(-123.123)",
  572. "sqrt(1764)",
  573. "isnan(sqrt(-1))",
  574. "not(1)",
  575. "not(NAN)",
  576. "not(0)",
  577. NULL
  578. };
  579. for (expr = exprs; *expr; expr++) {
  580. printf("Evaluating '%s'\n", *expr);
  581. av_expr_parse_and_eval(&d, *expr,
  582. const_names, const_values,
  583. NULL, NULL, NULL, NULL, NULL, 0, NULL);
  584. printf("'%s' -> %f\n\n", *expr, d);
  585. }
  586. av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
  587. const_names, const_values,
  588. NULL, NULL, NULL, NULL, NULL, 0, NULL);
  589. printf("%f == 12.7\n", d);
  590. av_expr_parse_and_eval(&d, "80G/80Gi",
  591. const_names, const_values,
  592. NULL, NULL, NULL, NULL, NULL, 0, NULL);
  593. printf("%f == 0.931322575\n", d);
  594. if (argc > 1 && !strcmp(argv[1], "-t")) {
  595. for (i = 0; i < 1050; i++) {
  596. START_TIMER;
  597. av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
  598. const_names, const_values,
  599. NULL, NULL, NULL, NULL, NULL, 0, NULL);
  600. STOP_TIMER("av_expr_parse_and_eval");
  601. }
  602. }
  603. return 0;
  604. }
  605. #endif