Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Encoding IMA Adpcm from 16-bit PCM data

1 view
Skip to first unread message

Ming-Ching Tiew

unread,
May 26, 1999, 3:00:00 AM5/26/99
to
I have the source to the routines which performs
IMA Adpcm to/from PCM data. But since I don't
have the necessary foundation to the encoding/decoding
algorithm, I only managed to get decoding of IMA
Adpcm to 16-bit linear PCM data working ( ie encoding
is not working ).

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 Tiew

unread,
May 26, 1999, 3:00:00 AM5/26/99
to
Please ignore my post, I found also the
routine which performs the calculation
of samples per block. Thanks for your
patience.

Ming-Ching

Ming-Ching Tiew <mct...@vmstech.po.my> wrote in message
OFPAFeyp#GA....@cppssbbsa02.microsoft.com...

0 new messages