[FFmpeg-cvslog] r13117 - trunk/libavcodec/acelp_math.h
voroshil
subversion
Sun May 11 13:49:26 CEST 2008
Author: voroshil
Date: Sun May 11 13:49:25 2008
New Revision: 13117
Log:
Implement bidirectional (positive offset - left, negative - right)
signed shift for ACELP-based codecs.
Modified:
trunk/libavcodec/acelp_math.h
Modified: trunk/libavcodec/acelp_math.h
==============================================================================
--- trunk/libavcodec/acelp_math.h (original)
+++ trunk/libavcodec/acelp_math.h Sun May 11 13:49:25 2008
@@ -72,4 +72,17 @@ static int sum_of_squares(const int16_t*
return sum;
}
+/**
+ * \brief Shift value left or right depending on sign of offset parameter.
+ * \param value value to shift
+ * \param offset shift offset
+ *
+ * \return value << offset, if offset>=0; value >> -offset - otherwise
+ */
+static inline int bidir_sal(int value, int offset)
+{
+ if(offset < 0) return value >> -offset;
+ else return value << offset;
+}
+
#endif /* FFMPEG_ACELP_MATH_H */
More information about the ffmpeg-cvslog
mailing list