[FFmpeg-devel] [PATCH 2/3] avcodec/wmalosslessdec: optimize sign operation
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sat Feb 14 09:47:34 CET 2015
On 13.02.2015, at 17:51, "zhaoxiu.zeng" <zhaoxiu.zeng at gmail.com> wrote:
> From b08b4a38c87000fe5549de96f65de6ba77740b30 Mon Sep 17 00:00:00 2001
> From: Zeng Zhaoxiu <zhaoxiu.zeng at gmail.com>
> Date: Fri, 13 Feb 2015 23:52:29 +0800
> Subject: [PATCH 2/3] avcodec/wmalosslessdec: optimize sign operation
>
> Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng at gmail.com>
> ---
> libavcodec/wmalosslessdec.c | 34 ++++++++--------------------------
> 1 file changed, 8 insertions(+), 26 deletions(-)
>
> diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
> index 9bd5e7b..1916594 100644
> --- a/libavcodec/wmalosslessdec.c
> +++ b/libavcodec/wmalosslessdec.c
> @@ -175,6 +175,8 @@ typedef struct WmallDecodeCtx {
> int channel_coeffs[WMALL_MAX_CHANNELS][WMALL_BLOCK_MAX_SIZE];
> } WmallDecodeCtx;
>
> +/** Get sign of integer (1 for positive, -1 for negative and 0 for zero) */
> +#define WMASIGN(x) ((x > 0) - (x < 0))
Don't we already have a helper function for this operation in avutil?
I haven't checked, but I think I remember one.
More information about the ffmpeg-devel
mailing list