From 26d2496e46b50a8189c971de876fa1e27e3fe342 Mon Sep 17 00:00:00 2001 From: mru Date: Tue, 3 Mar 2009 00:03:55 +0000 Subject: [PATCH] Add sign_extend() function to mathops.h git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17738 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- libavcodec/mathops.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 880e94671..b92a6be13 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 */ -- 2.39.2