summaryrefslogtreecommitdiff
path: root/libavutil/eval.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-05 01:46:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-05 02:26:17 +0200
commit5d4fd1d1adf1ec17dd19548783f7f2eb0d64225f (patch)
tree0ed0d9be892e55bea47d777dcd78d7c1cf104adf /libavutil/eval.c
parent96676e1abfece89e20bc962255b48cb2d9e417bd (diff)
parent3824ef08e0878aa9f100f33ef22b61daf68058c2 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (36 commits) ARM: allow unaligned buffer in fixed-point NEON FFT4 fate: test more FFT etc sizes dca: set AVCodecContext frame_size for DTS audio YASM: Shut up unused variable compiler warning with --disable-yasm. x86_32: Fix build on x86_32 with --disable-yasm. iirfilter: add fate test doxygen: Add qmul docs. ogg: propagate return values and return more meaningful error values H.264: fix overreads of qscale_table Remove unused static tables and static inline functions. eval: clear Parser instances before using dct-test: remove 'ref' function pointer from tables build: Remove deleted 'check' target from .PHONY list. oggdec: Abort Ogg header parsing when encountering a data packet. Add LGPL license boilerplate to files lacking it. mxfenc: small typo fix doxygen: Fix documentation for some VP8 functions. sha: use AV_RB32() instead of assuming buffer can be cast to uint32_t* des: allow unaligned input and output buffers aes: allow unaligned input and output buffers ... Conflicts: libavcodec/dct-test.c libavcodec/libvpxenc.c libavcodec/x86/dsputil_mmx.c libavcodec/x86/h264_qpel_mmx.c libavfilter/x86/gradfun.c libavformat/oggdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/eval.c')
-rw-r--r--libavutil/eval.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libavutil/eval.c b/libavutil/eval.c
index faa74a05fd..066bf7bab5 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -472,7 +472,7 @@ int av_expr_parse(AVExpr **expr, const char *s,
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
int log_offset, void *log_ctx)
{
- Parser p;
+ Parser p = { 0 };
AVExpr *e = NULL;
char *w = av_malloc(strlen(s) + 1);
char *wp = w;
@@ -517,7 +517,7 @@ end:
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
{
- Parser p;
+ Parser p = { 0 };
p.const_values = const_values;
p.opaque = opaque;
@@ -576,6 +576,8 @@ void av_free_expr(AVExpr *e)
#ifdef TEST
#undef printf
+#include <string.h>
+
static double const_values[] = {
M_PI,
M_E,
@@ -588,7 +590,7 @@ static const char *const_names[] = {
0
};
-int main(void)
+int main(int argc, char **argv)
{
int i;
double d;
@@ -669,13 +671,16 @@ int main(void)
NULL, NULL, NULL, NULL, NULL, 0, NULL);
printf("%f == 0.931322575\n", d);
- for (i=0; i<1050; i++) {
- START_TIMER
+ if (argc > 1 && !strcmp(argv[1], "-t")) {
+ for (i = 0; i < 1050; i++) {
+ START_TIMER;
av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
const_names, const_values,
NULL, NULL, NULL, NULL, NULL, 0, NULL);
- STOP_TIMER("av_expr_parse_and_eval")
+ STOP_TIMER("av_expr_parse_and_eval");
+ }
}
+
return 0;
}
#endif