diff options
author | Mans Rullgard <mans@mansr.com> | 2012-08-08 17:13:26 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-08-09 00:58:20 +0100 |
commit | d7a4f8f8b9a4bc309d4d5ab067cfba945e690c0c (patch) | |
tree | cdf4e8c5b08c4766669d85ab14f8150b121f3c6c /libavcodec/x86/mathops.h | |
parent | 070a402b60cb4ebc6fd2ba59c13758811815bb19 (diff) | |
download | ffmpeg-d7a4f8f8b9a4bc309d4d5ab067cfba945e690c0c.tar.gz |
Move MASK_ABS macro to libavcodec/mathops.h
This macro is only used in two places, both in libavcodec, so this
is a more sensible place for it.
Two small tweaks to the macro are made:
- removing the trailing semicolon
- dropping unnecessary 'volatile' from the x86 asm
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/x86/mathops.h')
-rw-r--r-- | libavcodec/x86/mathops.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h index e056eb0a2d..cd408ac5a6 100644 --- a/libavcodec/x86/mathops.h +++ b/libavcodec/x86/mathops.h @@ -101,6 +101,12 @@ __asm__ volatile(\ ); #endif +#define MASK_ABS(mask, level) \ + __asm__ ("cltd \n\t" \ + "xorl %1, %0 \n\t" \ + "subl %1, %0 \n\t" \ + : "+a"(level), "=&d"(mask)) + // avoid +32 for shift optimization (gcc should do that ...) #define NEG_SSR32 NEG_SSR32 static inline int32_t NEG_SSR32( int32_t a, int8_t s){ |