Commit a5c9cfbe authored by voroshil's avatar voroshil

Implement bidirectional (positive offset - left, negative - right)

signed shift for ACELP-based codecs.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13117 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7f5fc224
......@@ -72,4 +72,17 @@ static int sum_of_squares(const int16_t* speech, int length, int offset, int shi
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 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment