From: Justin Ruggles Date: Fri, 17 Feb 2012 02:51:03 +0000 (-0500) Subject: ttadec: use branchless unsigned-to-signed unfolding X-Git-Tag: v9_beta1~2916 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2a4559c77ebce36b575e75fad102d2e9f02bb5a;p=platform%2Fupstream%2Flibav.git ttadec: use branchless unsigned-to-signed unfolding --- diff --git a/libavcodec/tta.c b/libavcodec/tta.c index db9c1b2..6f4d161 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -396,8 +396,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, } // extract coded value -#define UNFOLD(x) (((x)&1) ? (++(x)>>1) : (-(x)>>1)) - *p = UNFOLD(value); + *p = 1 + ((value >> 1) ^ ((value & 1) - 1)); // run hybrid filter ttafilter_process(filter, p);