Mercurial > libavcodec.hg
comparison acelp_math.h @ 6777:6f402a181803 libavcodec
Implement bidirectional (positive offset - left, negative - right)
signed shift for ACELP-based codecs.
author | voroshil |
---|---|
date | Sun, 11 May 2008 11:49:25 +0000 |
parents | 4db65caccc9b |
children | ff5ef7becd94 |
comparison
equal
deleted
inserted
replaced
6776:4b9f28275b14 | 6777:6f402a181803 |
---|---|
70 sum += (speech[0] * speech[offset]) >> shift; | 70 sum += (speech[0] * speech[offset]) >> shift; |
71 | 71 |
72 return sum; | 72 return sum; |
73 } | 73 } |
74 | 74 |
75 /** | |
76 * \brief Shift value left or right depending on sign of offset parameter. | |
77 * \param value value to shift | |
78 * \param offset shift offset | |
79 * | |
80 * \return value << offset, if offset>=0; value >> -offset - otherwise | |
81 */ | |
82 static inline int bidir_sal(int value, int offset) | |
83 { | |
84 if(offset < 0) return value >> -offset; | |
85 else return value << offset; | |
86 } | |
87 | |
75 #endif /* FFMPEG_ACELP_MATH_H */ | 88 #endif /* FFMPEG_ACELP_MATH_H */ |