mirror of https://bitbucket.org/ausocean/av.git
ADPCM: got rid of buggy overflow checks
This commit is contained in:
parent
89ccf9eac7
commit
8642d1e087
|
@ -126,9 +126,9 @@ func (e *Encoder) encodeSample(sample int16) byte {
|
|||
|
||||
// adjust predicted sample based on calculated difference
|
||||
if nib&8 != 0 {
|
||||
e.pred = capAdd16(e.pred, -diff)
|
||||
e.pred -= diff
|
||||
} else {
|
||||
e.pred = capAdd16(e.pred, diff)
|
||||
e.pred += diff
|
||||
}
|
||||
|
||||
e.index += indexTable[nib&7]
|
||||
|
@ -164,7 +164,7 @@ func (d *Decoder) decodeSample(nibble byte) int16 {
|
|||
}
|
||||
|
||||
// adjust predicted sample based on calculated difference
|
||||
d.pred = capAdd16(d.pred, diff)
|
||||
d.pred += diff
|
||||
|
||||
// adjust index into step size lookup table using nibble
|
||||
d.index += indexTable[nibble]
|
||||
|
|
Loading…
Reference in New Issue