aADPCMdec.3p
1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.TH aADPCMdec 3P local "Silicon Graphics, Inc."
.SH NAME
aADPCMdec \- ADPCM audio decompression command
.SH C SPECIFICATION
#include "mbi.h"
.br
.sp
.nf
typedef short ADPCM_STATE[2];
.fi
.sp
aADPCMdec(Acmd *pkt, unsigned char flags, short gain, ADPCM_STATE *state)
.SH PARAMETERS
.TP 10
.I pkt
Audio command list pointer.
.TP
.I flags
Set of flags to define the behaviour of the ADPCM decompression command:
\f2A_MIX\f1, result is mixed into the output buffer with the given \f2gain\f1.
If not set the result is put into the output buffer, after
multiplication by \f2gain\f1.
\f2A_INIT\f1, state is ignored when initiating decompression. If not set
the pointer to state is used to initialize the decoder.
.TP
.I gain
An S.15 number which defines the output gain.
.TP
.I state
Pointer to ADPCM decoder state in DRAM. This is used to read and write state
information and allows processing of streams to be accomplished in
small chunks.
.SH DESCRIPTION
.IR aADPCMdec
decodes a bitstream in DMEM and produces a 16 bit signed
2's complement output stream.
DMEM input and output buffers and the number of samples to process
are defined by a call to
.IR aSetBuffer().
The output stream is either mixed or
put into the output buffer, with \f2gain\f1 defining an output gain.
The code is vectorized to operate on
blocks of 16 samples.
If the number of samples,
defined through the
.IR aSetBuffer()
.IR count
parameter,
is not a multiple of 16 the decoder
will decode the smallest multiple of 16 larger than
.IR count,
however,
the state saved to DRAM will reflect the state at the start of the last
block. This means the next call with this state and the
.IR A_INIT
flag cleared will put the decoder in a state which allows
the last block to be decoded again.
This is used to implement processing of arbitrary length streams, without
the need to save leftover samples.