[Ffmpeg-devel] [PATCH] use libavutil macros in libpostproc

Aurelien Jacobs aurel
Tue Oct 10 02:01:36 CEST 2006


On Tue, 10 Oct 2006 01:23:23 +0200
Diego Biurrun <diego at biurrun.de> wrote:

> $subject, plus put the SIGN macro in libavutil/common.h as well, it
> might be useful in other places.
> 
> Index: libavutil/common.h
> ===================================================================
> --- libavutil/common.h	(revision 6612)
> +++ libavutil/common.h	(working copy)
> @@ -193,6 +193,7 @@
>  /* assume b>0 */
>  #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
>  #define ABS(a) ((a) >= 0 ? (a) : (-(a)))
> +#define SIGN(a) ((a) > 0 ? 1 : -1)

Maybe use this instead ? (but I don't know if it's worth)

  +#define SIGN(a) ((((a) > 0) - 1) | 1)     /* same as ((a) > 0 ? 1 : -1) */

Aurel




More information about the ffmpeg-devel mailing list