1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-14 19:05:33 +00:00
mpv/adpcm.h
melanson a9803b9f75 reworked ADPCM decoders; changes include:
* fixed MS IMA ADPCM
 * dissolved adpcm.c/.h into appropriate ad_* decoders
 * DK4 audio is handled directly by IMA ADPCM decoder (this obsoletes
   ad_dk4adpcm.c)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5409 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-03-30 22:27:45 +00:00

34 lines
1.1 KiB
C

#ifndef ADPCM_H
#define ADPCM_H
#define IMA_ADPCM_PREAMBLE_SIZE 2
#define IMA_ADPCM_BLOCK_SIZE 0x22
#define IMA_ADPCM_SAMPLES_PER_BLOCK \
((IMA_ADPCM_BLOCK_SIZE - IMA_ADPCM_PREAMBLE_SIZE) * 2)
#define MS_ADPCM_PREAMBLE_SIZE 7
#define MS_ADPCM_SAMPLES_PER_BLOCK \
((sh_audio->wf->nBlockAlign - MS_ADPCM_PREAMBLE_SIZE) * 2)
#define DK4_ADPCM_PREAMBLE_SIZE 4
#define DK4_ADPCM_SAMPLES_PER_BLOCK \
(((sh_audio->wf->nBlockAlign - DK4_ADPCM_PREAMBLE_SIZE) * 2) + 1)
// pretend there's such a thing as mono for this format
#define DK3_ADPCM_PREAMBLE_SIZE 8
#define DK3_ADPCM_BLOCK_SIZE 0x400
// this isn't exact
#define DK3_ADPCM_SAMPLES_PER_BLOCK 6000
int qt_ima_adpcm_decode_block(unsigned short *output, unsigned char *input,
int channels);
int ms_ima_adpcm_decode_block(unsigned short *output, unsigned char *input,
int channels, int block_size);
int ms_adpcm_decode_block(unsigned short *output, unsigned char *input,
int channels, int block_size);
int dk4_adpcm_decode_block(unsigned short *output, unsigned char *input,
int channels, int block_size);
int dk3_adpcm_decode_block(unsigned short *output, unsigned char *input);
#endif