summaryrefslogtreecommitdiff
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r--libavcodec/mathops.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 880e94671f..b92a6be137 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -113,5 +113,12 @@ static inline av_const int mid_pred(int a, int b, int c)
}
#endif
+#ifndef sign_extend
+static inline av_const int sign_extend(int val, unsigned bits)
+{
+ return (val << (INT_BIT - bits)) >> (INT_BIT - bits);
+}
+#endif
+
#endif /* AVCODEC_MATHOPS_H */