1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
18 //////////////////////////////////////////////////////////////////////////////////
20 // File: pvgsmamrdecoderinterface.h //
22 //////////////////////////////////////////////////////////////////////////////////
24 #ifndef _PVGSMAMR_DECODER_INTERFACE_H
25 #define _PVGSMAMR_DECODER_INTERFACE_H
27 /*----------------------------------------------------------------------------
28 ; ENUMERATED TYPEDEF'S
29 ----------------------------------------------------------------------------*/
34 * One word (2-byte) to indicate type of frame type.
35 * One word (2-byte) to indicate frame type.
36 * One word (2-byte) to indicate mode.
37 * N words (2-byte) containing N bits (bit 0 = 0xff81, bit 1 = 0x007f).
39 ETS = 0, /* Both AMR-Narrowband and AMR-Wideband */
42 * One word (2-byte) for sync word (good frames: 0x6b21, bad frames: 0x6b20)
43 * One word (2-byte) for frame length N.
44 * N words (2-byte) containing N bits (bit 0 = 0x007f, bit 1 = 0x0081).
46 ITU, /* AMR-Wideband */
49 * AMR-WB MIME/storage format, see RFC 3267 (sections 5.1 and 5.3) for details
53 WMF, /* AMR-Narrowband */
55 IF2 /* AMR-Narrowband */
61 /*----------------------------------------------------------------------------
62 ; STRUCTURES TYPEDEF'S
63 ----------------------------------------------------------------------------*/
71 typedef struct tPVAmrDecoderExternal
75 * Pointer to the input buffer that contains the encoded bistream data.
76 * The data is filled in such that the first bit transmitted is
77 * the most-significant bit (MSB) of the first array element.
78 * The buffer is accessed in a linear fashion for speed, and the number of
79 * bytes consumed varies frame to frame. This is use for mime/ietf data
81 uint8_t *pInputBuffer;
85 * Pointer to the input buffer that contains the encoded stream data.
86 * The data is filled such that the first bit transmitted is
87 * in the first int16_t element.
88 * The buffer is accessed in a linear fashion for speed, and the number of
89 * bytes consumed varies frame to frame.
91 int16_t *pInputSampleBuffer;
94 * INPUT: (but what is pointed to is an output)
95 * Pointer to the output buffer to hold the 16-bit PCM audio samples.
97 int16_t *pOutputBuffer;
101 * Number of requested output audio channels. This relieves the calling
102 * environment from having to perform stereo-to-mono or mono-to-stereo
105 int32_t desiredChannels;
109 * Format type of the encoded bitstream.
111 bitstream_format input_format;
115 * The sampling rate decoded from the bitstream, in units of
116 * samples/second. For this release of the library this value does
117 * not change from frame to frame, but future versions will.
119 int32_t samplingRate;
123 * This value is the bitrate in units of bits/second. IT
124 * is calculated using the number of bits consumed for the current frame,
125 * and then multiplying by the sampling_rate, divided by points in a frame.
126 * This value can changes frame to frame.
132 * The number of channels decoded from the bitstream. The output data
133 * will have be the amount specified in the variable desiredChannels,
134 * this output is informative only, and can be ignored.
136 int32_t encodedChannels;
140 * This value is the number of output PCM samples per channel.
147 * This value is the quality indicator. 1 (good) 0 (bad)
154 * GSM AMR NB and WB mode (i.e. bit-rate )
161 * GSM AMR NB and WB frame type ( speech_good, speech_bad, sid, etc.)
166 int16_t reset_flag_old;
180 } tPVAmrDecoderExternal;