On Sat, Feb 14, 2015 at 09:47:34AM +0100, Reimar Döffinger wrote: > On 13.02.2015, at 17:51, "zhaoxiu.zeng" <zhaoxiu.z...@gmail.com> wrote: > > From b08b4a38c87000fe5549de96f65de6ba77740b30 Mon Sep 17 00:00:00 2001 > > From: Zeng Zhaoxiu <zhaoxiu.z...@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.z...@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.
I see only this one: libavcodec/diracdec.c:#define SIGN_CTX(x) (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0)) -- Clément B.
pgpVJwUkAcOy_.pgp
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel