Implement bidirectional (positive offset - left, negative - right)
signed shift for ACELP-based codecs. Originally committed as revision 13117 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
0a1b29dea7
commit
ce9eac7913
@ -72,4 +72,17 @@ static int sum_of_squares(const int16_t* speech, int length, int offset, int shi
|
|||||||
return sum;
|
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 */
|
#endif /* FFMPEG_ACELP_MATH_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user