合并官方最新代码#1
Open
biallo wants to merge 16 commits into
Open
Conversation
The extracted children can refer to their parent typed array views and buffer to keep from needing to make memory copies that take a lot of time to create and memory to use. As well some time can be saved by using the same Uint8Array for reading Uint8 values and strings.
The number of samples in the ADPCM can be known once the data chunk is extracted and the block size is known. From there the audio buffer can be created and its channel data passed to the decompress method. A lot of time is saved by writing to the channel data directly instead of writing to one array, copying that to another array, and then finally copying to the channel data. A surprising amount of time is saved by using one getChannelData call instead of calling to store each sample.
There are 1424 possible deltas given 89 steps and 16 codes. We can quickly compute those and reuse them to save time. Knowing the exact size of the waveform we can re-author the decompression loop to take advantage of that. We can place the block header decompression first in the outer while loop and then place an inner loop with the 2 samples per block decompression unwrapped. The first sample reads from the stream and the second uses the other 4 bits.
ADPCM JS Optimizations
…tions ADPCM Loop Optimizations
…n-sounds Handle empty and unusually formatted sounds that caused crashes
…decode-error Catch ADPCM decode error, and use an empty sound
7b60572 to
bf0a0bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Describe what this Pull Request does
Reason for changes
Explain why these changes should be made. Please include an issue # if applicable.