# HG changeset patch # User mru # Date 1263967314 0 # Node ID 38b3b209b4bcdba5df437940f4c99efe9861f15f # Parent 4776a56132e1280fa378ec7367564e25fb19b4a2 Move COPY3_IF_LT to lavc/mathops.h This obscure macro is only used in motion_est.c so having it in lavc makes more sense. See discussion here: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-November/056561.html diff -r 4776a56132e1 -r 38b3b209b4bc mathops.h --- a/mathops.h Wed Jan 20 03:28:57 2010 +0000 +++ b/mathops.h Wed Jan 20 06:01:54 2010 +0000 @@ -116,5 +116,14 @@ } #endif +#ifndef COPY3_IF_LT +#define COPY3_IF_LT(x, y, a, b, c, d)\ +if ((y) < (x)) {\ + (x) = (y);\ + (a) = (b);\ + (c) = (d);\ +} +#endif + #endif /* AVCODEC_MATHOPS_H */ diff -r 4776a56132e1 -r 38b3b209b4bc x86/mathops.h --- a/x86/mathops.h Wed Jan 20 03:28:57 2010 +0000 +++ b/x86/mathops.h Wed Jan 20 06:01:54 2010 +0000 @@ -66,4 +66,16 @@ } #endif +#if HAVE_CMOV +#define COPY3_IF_LT(x, y, a, b, c, d)\ +__asm__ volatile(\ + "cmpl %0, %3 \n\t"\ + "cmovl %3, %0 \n\t"\ + "cmovl %4, %1 \n\t"\ + "cmovl %5, %2 \n\t"\ + : "+&r" (x), "+&r" (a), "+r" (c)\ + : "r" (y), "r" (b), "r" (d)\ +); +#endif + #endif /* AVCODEC_X86_MATHOPS_H */