summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavcodec/tta.c2
-rw-r--r--libavcodec/ttaenc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 87bfe7b..5fdbac8 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -312,7 +312,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
filter->shift, filter->round);
// fixed order prediction
-#define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
+#define PRED(x, k) (int32_t)((((uint64_t)(x) << (k)) - (x)) >> (k))
switch (s->bps) {
case 1: *p += PRED(*predictor, 4); break;
case 2:
diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c
index 75d1664..ccd41a9 100644
--- a/libavcodec/ttaenc.c
+++ b/libavcodec/ttaenc.c
@@ -144,7 +144,7 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
temp = value;
-#define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
+#define PRED(x, k) (int32_t)((((uint64_t)(x) << (k)) - (x)) >> (k))
switch (s->bps) {
case 1: value -= PRED(c->predictor, 4); break;
case 2:
OpenPOWER on IntegriCloud