mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-18 18:00:07 +00:00
Merge pull request #2050 from MerryMage/adpcm
codec: Fix ADPCM distortion caused by incorrect nibble order
This commit is contained in:
commit
c3307b41db
@ -58,11 +58,11 @@ StereoBuffer16 DecodeADPCM(const u8* const data, const size_t sample_count, cons
|
|||||||
size_t outputi = framei * SAMPLES_PER_FRAME;
|
size_t outputi = framei * SAMPLES_PER_FRAME;
|
||||||
size_t datai = framei * FRAME_LEN + 1;
|
size_t datai = framei * FRAME_LEN + 1;
|
||||||
for (size_t i = 0; i < SAMPLES_PER_FRAME && outputi < sample_count; i += 2) {
|
for (size_t i = 0; i < SAMPLES_PER_FRAME && outputi < sample_count; i += 2) {
|
||||||
const s16 sample1 = decode_sample(SIGNED_NIBBLES[data[datai] & 0xF]);
|
const s16 sample1 = decode_sample(SIGNED_NIBBLES[data[datai] >> 4]);
|
||||||
ret[outputi].fill(sample1);
|
ret[outputi].fill(sample1);
|
||||||
outputi++;
|
outputi++;
|
||||||
|
|
||||||
const s16 sample2 = decode_sample(SIGNED_NIBBLES[data[datai] >> 4]);
|
const s16 sample2 = decode_sample(SIGNED_NIBBLES[data[datai] & 0xF]);
|
||||||
ret[outputi].fill(sample2);
|
ret[outputi].fill(sample2);
|
||||||
outputi++;
|
outputi++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user