Basically I'm looking at a function like this ( 16bit-PCM
to 4 bit IMA Adpcm encoding ) :-
DWORD FNGLOBAL imaadpcmEncode4Bit_M16
(
HPBYTE pbSrc,
DWORD cbSrcLength,
HPBYTE pbDst,
UINT nBlockAlignment,
UINT cSamplesPerBlock,
int * pnStepIndexL,
int * pnStepIndexR
)
My trouble is that I don't know what value to supply
to cSamplesPerBlock, which is supposed to be
"The number of samples in each ADPCM block"
( I tried a value of 512, which was my "educated"
guess ).
Appreciate any help !
BTW, I can't use the ACM routines because I
intend to put the conversion inside my (kernel)
device driver.
Ming-Ching
-----------------------------------------------------------------------
// Arguments:
// HPBYTE pbSrc: Pointer to the source buffer (PCM data).
// DWORD cbSrcLength: The length of the source buffer (in bytes).
// HPBYTE pbDst: Pointer to the destination buffer (ADPCM data). Note
// that it is assumed that the destination buffer is
// large enough to hold all the encoded data; see
// acmdStreamSize() in codec.c for more details.
// UINT nBlockAlignment: The block alignment of the ADPCM data (in
// bytes); not used for encoding.
// UINT cSamplesPerBlock: The number of samples in each ADPCM block.
// int *pnStepIndexL: Pointer to the step index value (left channel)
// in the STREAMINSTANCE structure; this is used to
// maintain the step index across converts.
// int *pnStepIndexR: Pointer to the step index value (right channel)
// in the STREAMINSTANCE structure; this is used to
// maintain the step index across converts. It is only
// used for stereo converts.
Ming-Ching
Ming-Ching Tiew <mct...@vmstech.po.my> wrote in message
OFPAFeyp#GA....@cppssbbsa02.microsoft.com...