diff options
author | Måns Rullgård <mans@mansr.com> | 2009-03-03 00:03:55 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-03-03 00:03:55 +0000 |
commit | 101dfa7d0a15de14c599a9c5db9945419fd12fb9 (patch) | |
tree | c974bb4046c0a3f214b79c36733209001c8ac06c /libavcodec/mathops.h | |
parent | edd532db64335ef7e41b83fd3fce6e2ad2592a7e (diff) | |
download | ffmpeg-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.h | 7 |
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 */ |