summaryrefslogtreecommitdiffstats
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-03-03 00:03:55 +0000
committerMåns Rullgård <mans@mansr.com>2009-03-03 00:03:55 +0000
commit101dfa7d0a15de14c599a9c5db9945419fd12fb9 (patch)
treec974bb4046c0a3f214b79c36733209001c8ac06c /libavcodec/mathops.h
parentedd532db64335ef7e41b83fd3fce6e2ad2592a7e (diff)
downloadffmpeg-streaming-101dfa7d0a15de14c599a9c5db9945419fd12fb9.zip
ffmpeg-streaming-101dfa7d0a15de14c599a9c5db9945419fd12fb9.tar.gz
Add sign_extend() function to mathops.h
Originally committed as revision 17738 to svn://svn.ffmpeg.org/ffmpeg/trunk
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 880e946..b92a6be 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 */
OpenPOWER on IntegriCloud