Bug 1119266 - Properly wrap the table index in ComputeCustom on ARM. r=karlt

On ARM, casting a negative float to an unsigned integer yields zero, whereas on
x86, it wraps. When the OscillatorNode had a negative frequency, the code would
just interpolate between the first and second value of the wave table, instead
of interpolating backward.
This commit is contained in:
Paul Adenot 2015-01-12 13:32:11 +01:00
parent b85d910517
commit 96c8cd7b84
2 changed files with 2 additions and 3 deletions

View File

@ -258,8 +258,8 @@ public:
}
// Bilinear interpolation between adjacent samples in each table.
float floorPhase = floorf(mPhase);
uint32_t j1 = floorPhase;
j1 &= indexMask;
int j1Signed = static_cast<int>(floorPhase);
uint32_t j1 = j1Signed & indexMask;
uint32_t j2 = j1 + 1;
j2 &= indexMask;

View File

@ -127,7 +127,6 @@ skip-if = (toolkit == 'gonk' && !debug) || android_version == '10' # Android: bu
[test_oscillatorNode.html]
[test_oscillatorNode2.html]
[test_oscillatorNodeNegativeFrequency.html]
skip-if = (toolkit == 'gonk') || (toolkit == 'android')
[test_oscillatorNodePassThrough.html]
[test_oscillatorNodeStart.html]
[test_oscillatorTypeChange.html]