mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Use Math.abs in Sonic.java
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=166820970
This commit is contained in:
parent
bbb0308295
commit
64b1566ad4
1 changed files with 1 additions and 1 deletions
|
|
@ -241,7 +241,7 @@ import java.util.Arrays;
|
||||||
for (int i = 0; i < period; i++) {
|
for (int i = 0; i < period; i++) {
|
||||||
short sVal = samples[position + i];
|
short sVal = samples[position + i];
|
||||||
short pVal = samples[position + period + i];
|
short pVal = samples[position + period + i];
|
||||||
diff += sVal >= pVal ? sVal - pVal : pVal - sVal;
|
diff += Math.abs(sVal - pVal);
|
||||||
}
|
}
|
||||||
// Note that the highest number of samples we add into diff will be less than 256, since we
|
// Note that the highest number of samples we add into diff will be less than 256, since we
|
||||||
// skip samples. Thus, diff is a 24 bit number, and we can safely multiply by numSamples
|
// skip samples. Thus, diff is a 24 bit number, and we can safely multiply by numSamples
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue