Skip to content
Snippets Groups Projects
Commit 440aab5f authored by Joshua Colp's avatar Joshua Colp
Browse files

Add inline function for signed linear subtraction.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 225d9166
No related branches found
No related tags found
No related merge requests found
......@@ -283,6 +283,19 @@ static force_inline void ast_slinear_saturated_add(short *input, short *value)
else
*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)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment