You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-29 05:57:37 +02:00
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>
This commit is contained in:
@@ -96,22 +96,6 @@ struct AVDictionary {
|
||||
|
||||
#define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
|
||||
|
||||
/* math */
|
||||
|
||||
#if ARCH_X86 && HAVE_INLINE_ASM
|
||||
#define MASK_ABS(mask, level)\
|
||||
__asm__ volatile(\
|
||||
"cltd \n\t"\
|
||||
"xorl %1, %0 \n\t"\
|
||||
"subl %1, %0 \n\t"\
|
||||
: "+a" (level), "=&d" (mask)\
|
||||
);
|
||||
#else
|
||||
#define MASK_ABS(mask, level)\
|
||||
mask = level >> 31;\
|
||||
level = (level ^ mask) - mask;
|
||||
#endif
|
||||
|
||||
/* avoid usage of dangerous/inappropriate system functions */
|
||||
#undef malloc
|
||||
#define malloc please_use_av_malloc
|
||||
|
||||
Reference in New Issue
Block a user