Author: akhaldi
Date: Wed Apr 23 14:24:59 2014
New Revision: 62912
URL:
http://svn.reactos.org/svn/reactos?rev=62912&view=rev
Log:
[MSADP32.ACM]
* Sync with Wine 1.7.17.
CORE-8080
Modified:
trunk/reactos/dll/win32/msadp32.acm/msadp32.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/msadp32.acm/msadp32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msadp32.acm/msad…
==============================================================================
--- trunk/reactos/dll/win32/msadp32.acm/msadp32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msadp32.acm/msadp32.c [iso-8859-1] Wed Apr 23 14:24:59 2014
@@ -225,6 +225,11 @@
if (*idelta < 16) *idelta = 16;
}
+static inline unsigned char C168(short s)
+{
+ return HIBYTE(s) ^ (unsigned char)0x80;
+}
+
static void cvtSSms16K(const ACMDRVSTREAMINSTANCE *adsi,
const unsigned char* src, LPDWORD nsrc,
unsigned char* dst, LPDWORD ndst)
@@ -236,10 +241,10 @@
int nsamp;
int nsamp_blk = ((ADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock;
DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign,
- *ndst / (nsamp_blk * 2 * 2));
+ *ndst / (nsamp_blk *
adsi->pwfxDst->nBlockAlign));
*nsrc = nblock * adsi->pwfxSrc->nBlockAlign;
- *ndst = nblock * nsamp_blk * 2 * 2;
+ *ndst = nblock * nsamp_blk * adsi->pwfxDst->nBlockAlign;
nsamp_blk -= 2; /* see below for samples from block head */
for (; nblock > 0; nblock--)
@@ -258,18 +263,34 @@
sample2L = R16(src); src += 2;
sample2R = R16(src); src += 2;
- /* store samples from block head */
- W16(dst, sample2L); dst += 2;
- W16(dst, sample2R); dst += 2;
- W16(dst, sample1L); dst += 2;
- W16(dst, sample1R); dst += 2;
-
- for (nsamp = nsamp_blk; nsamp > 0; nsamp--)
- {
- process_nibble(*src >> 4, &ideltaL, &sample1L, &sample2L,
&coeffL);
- W16(dst, sample1L); dst += 2;
- process_nibble(*src++ & 0x0F, &ideltaR, &sample1R, &sample2R,
&coeffR);
- W16(dst, sample1R); dst += 2;
+ if(adsi->pwfxDst->wBitsPerSample == 8){
+ /* store samples from block head */
+ *dst = C168(sample2L); ++dst;
+ *dst = C168(sample2R); ++dst;
+ *dst = C168(sample1L); ++dst;
+ *dst = C168(sample1R); ++dst;
+
+ for (nsamp = nsamp_blk; nsamp > 0; nsamp--)
+ {
+ process_nibble(*src >> 4, &ideltaL, &sample1L,
&sample2L, &coeffL);
+ *dst = C168(sample1L); ++dst;
+ process_nibble(*src++ & 0x0F, &ideltaR, &sample1R,
&sample2R, &coeffR);
+ *dst = C168(sample1R); ++dst;
+ }
+ }else if(adsi->pwfxDst->wBitsPerSample == 16){
+ /* store samples from block head */
+ W16(dst, sample2L); dst += 2;
+ W16(dst, sample2R); dst += 2;
+ W16(dst, sample1L); dst += 2;
+ W16(dst, sample1R); dst += 2;
+
+ for (nsamp = nsamp_blk; nsamp > 0; nsamp--)
+ {
+ process_nibble(*src >> 4, &ideltaL, &sample1L,
&sample2L, &coeffL);
+ W16(dst, sample1L); dst += 2;
+ process_nibble(*src++ & 0x0F, &ideltaR, &sample1R,
&sample2R, &coeffR);
+ W16(dst, sample1R); dst += 2;
+ }
}
src = in_src + adsi->pwfxSrc->nBlockAlign;
}
@@ -285,10 +306,10 @@
int nsamp;
int nsamp_blk = ((ADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock;
DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign,
- *ndst / (nsamp_blk * 2));
+ *ndst / (nsamp_blk *
adsi->pwfxDst->nBlockAlign));
*nsrc = nblock * adsi->pwfxSrc->nBlockAlign;
- *ndst = nblock * nsamp_blk * 2;
+ *ndst = nblock * nsamp_blk * adsi->pwfxDst->nBlockAlign;
nsamp_blk -= 2; /* see below for samples from block head */
for (; nblock > 0; nblock--)
@@ -303,16 +324,30 @@
sample2 = R16(src); src += 2;
/* store samples from block head */
- W16(dst, sample2); dst += 2;
- W16(dst, sample1); dst += 2;
-
- for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
- {
- process_nibble(*src >> 4, &idelta, &sample1, &sample2,
&coeff);
- W16(dst, sample1); dst += 2;
- process_nibble(*src++ & 0x0F, &idelta, &sample1, &sample2,
&coeff);
- W16(dst, sample1); dst += 2;
+ if(adsi->pwfxDst->wBitsPerSample == 8){
+ *dst = C168(sample2); ++dst;
+ *dst = C168(sample1); ++dst;
+
+ for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
+ {
+ process_nibble(*src >> 4, &idelta, &sample1, &sample2,
&coeff);
+ *dst = C168(sample1); ++dst;
+ process_nibble(*src++ & 0x0F, &idelta, &sample1,
&sample2, &coeff);
+ *dst = C168(sample1); ++dst;
+ }
+ }else if(adsi->pwfxDst->wBitsPerSample == 16){
+ W16(dst, sample2); dst += 2;
+ W16(dst, sample1); dst += 2;
+
+ for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
+ {
+ process_nibble(*src >> 4, &idelta, &sample1, &sample2,
&coeff);
+ W16(dst, sample1); dst += 2;
+ process_nibble(*src++ & 0x0F, &idelta, &sample1,
&sample2, &coeff);
+ W16(dst, sample1); dst += 2;
+ }
}
+
src = in_src + adsi->pwfxSrc->nBlockAlign;
}
}
@@ -555,12 +590,9 @@
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM &&
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
{
- /* resampling or mono <=> stereo not available
- * ADPCM algo only define 16 bit per sample output
- */
+ /* resampling or mono <=> stereo not available */
if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
- adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
- adsi->pwfxDst->wBitsPerSample != 16)
+ adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels)
goto theEnd;
#if 0
@@ -579,9 +611,9 @@
#endif
/* adpcm decoding... */
- if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels
== 2)
+ if (adsi->pwfxDst->nChannels == 2)
aad->convert = cvtSSms16K;
- if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels
== 1)
+ else if (adsi->pwfxDst->nChannels == 1)
aad->convert = cvtMMms16K;
}
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Apr 23 14:24:59 2014
@@ -109,7 +109,7 @@
reactos/dll/win32/mprapi # Synced to Wine-1.7.1
reactos/dll/win32/msacm32 # Synced to Wine-1.7.17
reactos/dll/win32/msacm32/msacm32.drv # Synced to Wine-1.7.17
-reactos/dll/win32/msadp32.acm # Synced to Wine-1.7.1
+reactos/dll/win32/msadp32.acm # Synced to Wine-1.7.17
reactos/dll/win32/mscat32 # Synced to Wine-1.7.1
reactos/dll/win32/mscms # Synced to Wine-1.7.1
reactos/dll/win32/mscoree # Synced to Wine-1.5.4