summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-02-16 21:51:03 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-02-17 14:35:35 -0500
commitf2a4559c77ebce36b575e75fad102d2e9f02bb5a (patch)
tree0fdc0cc5b80812bb92d8e77aa8a3f4ab2186b8b0
parentd7840529b6aaaa24426025781e5fcde673108d39 (diff)
downloadffmpeg-streaming-f2a4559c77ebce36b575e75fad102d2e9f02bb5a.zip
ffmpeg-streaming-f2a4559c77ebce36b575e75fad102d2e9f02bb5a.tar.gz
ttadec: use branchless unsigned-to-signed unfolding
-rw-r--r--libavcodec/tta.c3
1 files changed, 1 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud