Merge pull request #400 from retrotalker/apu

interpolation - clamp output
This commit is contained in:
bearoso 2018-08-18 13:17:28 -05:00 committed by GitHub
commit ade94ccac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -433,6 +433,8 @@ inline int SPC_DSP::interpolate( voice_t const* v )
out = (0x1000 - fract) * in [0];
out += fract * in [1];
out >>= 12;
CLAMP16( out );
break;
}
@ -448,6 +450,8 @@ inline int SPC_DSP::interpolate( voice_t const* v )
out += rev [257] * in [2];
out += rev [ 0] * in [3];
out >>= 11;
CLAMP16( out );
break;
}
@ -465,6 +469,8 @@ inline int SPC_DSP::interpolate( voice_t const* v )
out += filt [6] * in [6];
out += filt [7] * in [7];
out >>= 14;
CLAMP16( out );
break;
}