mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Add inline function for signed linear subtraction.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -283,6 +283,19 @@ static force_inline void ast_slinear_saturated_add(short *input, short *value)
|
|||||||
else
|
else
|
||||||
*input = (short) res;
|
*input = (short) res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static force_inline void ast_slinear_saturated_subtract(short *input, short *value)
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
|
||||||
|
res = (int) *input - *value;
|
||||||
|
if (res > 32767)
|
||||||
|
*input = 32767;
|
||||||
|
else if (res < -32767)
|
||||||
|
*input = -32767;
|
||||||
|
else
|
||||||
|
*input = (short) res;
|
||||||
|
}
|
||||||
|
|
||||||
static force_inline void ast_slinear_saturated_multiply(short *input, short *value)
|
static force_inline void ast_slinear_saturated_multiply(short *input, short *value)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user