ADPCM: removed capAdd16 no longer used

This commit is contained in:
Trek H 2019-03-07 15:57:40 +10:30
parent 8642d1e087
commit c271418f58
1 changed files with 0 additions and 14 deletions

View File

@ -36,7 +36,6 @@ import (
"bytes"
"encoding/binary"
"fmt"
"math"
)
// Encoder is used to encode to ADPCM from PCM data.
@ -182,19 +181,6 @@ func (d *Decoder) decodeSample(nibble byte) int16 {
return d.pred
}
// capAdd16 adds two int16s together and caps at max/min int16 instead of overflowing
func capAdd16(a, b int16) int16 {
c := int32(a) + int32(b)
switch {
case c < math.MinInt16:
return math.MinInt16
case c > math.MaxInt16:
return math.MaxInt16
default:
return int16(c)
}
}
// calcHead sets the state for the encoder by running the first sample through
// the encoder, and writing the first sample
func (e *Encoder) calcHead(sample []byte) error {