"David D. Hagood" a écrit :
I found a bug in the decoding of the ADPCM data - the nybbles in the samples were being processed backwards - MSN then LSN (bits 4-7, then 0-3), rather than LSN then MSN. Since ADPCM re-syncs every 8 samples, the audio was distorted but intelligable. With this fix, the audio is correct. I've tested this patch with Delorme's AAA MapNGo 4.0, which uses ADPCM for its audio files.
NOTE: I didn't check the encoding routines, nor did I check the MSADPCM files to see if they were correct.
Changelog: ADPCM nybble processing order was incorrect.
David, please use the "-u" format for diffs. It's much safer to use, and it's good to have some context around the modified lines for quick review purpose.
Vincent
Gads. I knew better than that. Sorry, diff -u attached.
Changelog: ADPCM nybble processing order was incorrect.
? console/Makefile ? controls/Makefile ? files/Makefile ? graphics/Makefile ? graphics/enhmetafiledrv/Makefile ? graphics/metafiledrv/Makefile ? graphics/win16drv/Makefile ? graphics/win16drv/prtdrv.glue.c ? graphics/x11drv/Makefile ? if1632/Makefile ? if1632/relay16.s ? libtest/Makefile ? loader/Makefile ? loader/ne/Makefile ? memory/Makefile ? misc/Makefile ? msdos/Makefile ? relay32/Makefile ? scheduler/Makefile ? win32/Makefile ? windows/Makefile ? windows/x11drv/Makefile ? windows/x11drv/wineclipsrv Index: dlls/msacm/imaadp32/imaadp32.c =================================================================== RCS file: /home/wine/wine/dlls/msacm/imaadp32/imaadp32.c,v retrieving revision 1.5 diff -u -r1.5 imaadp32.c --- dlls/msacm/imaadp32/imaadp32.c 31 May 2002 23:25:48 -0000 1.5 +++ dlls/msacm/imaadp32/imaadp32.c 10 Jun 2002 02:53:41 -0000 @@ -284,16 +284,16 @@ { for (i = 0; i < 4; i++) { - process_nibble(*src >> 4, &stepIndexL, &sampleL); + process_nibble(*src, &stepIndexL, &sampleL); W16(dst + (2 * i + 0) * 4 + 0, sampleL); - process_nibble(*src++, &stepIndexL, &sampleL); + process_nibble(*src++ >> 4, &stepIndexL, &sampleL); W16(dst + (2 * i + 1) * 4 + 0, sampleL); } for (i = 0; i < 4; i++) { - process_nibble(*src >> 4, &stepIndexR, &sampleR); + process_nibble(*src , &stepIndexR, &sampleR); W16(dst + (2 * i + 0) * 4 + 2, sampleR); - process_nibble(*src++, &stepIndexR, &sampleR); + process_nibble(*src++ >>4, &stepIndexR, &sampleR); W16(dst + (2 * i + 1) * 4 + 2, sampleR); } dst += 32; @@ -335,9 +335,9 @@
for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2) { - process_nibble(*src >> 4, &stepIndex, &sample); + process_nibble(*src, &stepIndex, &sample); W16(dst, sample); dst += 2; - process_nibble(*src++, &stepIndex, &sample); + process_nibble(*src++ >> 4, &stepIndex, &sample); W16(dst, sample); dst += 2; } /* we have now to realign the source pointer on block */