| 1 | /* |
| 2 | ** Copyright 2003-2010, VisualOn, Inc. |
| 3 | ** |
| 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 |
| 7 | ** |
| 8 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ** |
| 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 express or implied. |
| 13 | ** See the License for the specific language governing permissions and |
| 14 | ** limitations under the License. |
| 15 | */ |
| 16 | /******************************************************************************* |
| 17 | File: voAMRWB.h |
| 18 | |
| 19 | Content: AMR-WB codec APIs & data types |
| 20 | |
| 21 | *******************************************************************************/ |
| 22 | #ifndef __VOAMRWB_H__ |
| 23 | #define __VOAMRWB_H__ |
| 24 | |
| 25 | #include "voAudio.h" |
| 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif /* __cplusplus */ |
| 29 | #pragma pack(push, 4) |
| 30 | |
| 31 | /*!* the bit rate the codec supports*/ |
| 32 | typedef enum { |
| 33 | VOAMRWB_MDNONE = -1, /*!< Invalid mode */ |
| 34 | VOAMRWB_MD66 = 0, /*!< 6.60kbps */ |
| 35 | VOAMRWB_MD885 = 1, /*!< 8.85kbps */ |
| 36 | VOAMRWB_MD1265 = 2, /*!< 12.65kbps */ |
| 37 | VOAMRWB_MD1425 = 3, /*!< 14.25kbps */ |
| 38 | VOAMRWB_MD1585 = 4, /*!< 15.85bps */ |
| 39 | VOAMRWB_MD1825 = 5, /*!< 18.25bps */ |
| 40 | VOAMRWB_MD1985 = 6, /*!< 19.85kbps */ |
| 41 | VOAMRWB_MD2305 = 7, /*!< 23.05kbps */ |
| 42 | VOAMRWB_MD2385 = 8, /*!< 23.85kbps> */ |
| 43 | VOAMRWB_N_MODES = 9, /*!< Invalid mode */ |
| 44 | VOAMRWB_MODE_MAX = VO_MAX_ENUM_VALUE |
| 45 | |
| 46 | }VOAMRWBMODE; |
| 47 | |
| 48 | /*!* the frame format the codec supports*/ |
| 49 | typedef enum { |
| 50 | VOAMRWB_DEFAULT = 0, /*!< the frame type is the header (defined in RFC3267) + rawdata*/ |
| 51 | /*One word (2-byte) for sync word (0x6b21)*/ |
| 52 | /*One word (2-byte) for frame length N.*/ |
| 53 | /*N words (2-byte) containing N bits (bit 0 = 0x007f, bit 1 = 0x0081).*/ |
| 54 | VOAMRWB_ITU = 1, |
| 55 | /*One word (2-byte) for sync word (0x6b21).*/ |
| 56 | /*One word (2-byte) to indicate the frame type.*/ |
| 57 | /*One word (2-byte) to indicate the mode.*/ |
| 58 | /*N words (2-byte) containing N bits (bit 0 = 0xff81, bit 1 = 0x007f).*/ |
| 59 | VOAMRWB_RFC3267 = 2, /* see RFC 3267 */ |
| 60 | VOAMRWB_TMAX = VO_MAX_ENUM_VALUE |
| 61 | }VOAMRWBFRAMETYPE; |
| 62 | |
| 63 | |
| 64 | #define VO_PID_AMRWB_Module 0x42261000 |
| 65 | #define VO_PID_AMRWB_FORMAT (VO_PID_AMRWB_Module | 0x0002) |
| 66 | #define VO_PID_AMRWB_CHANNELS (VO_PID_AMRWB_Module | 0x0003) |
| 67 | #define VO_PID_AMRWB_SAMPLERATE (VO_PID_AMRWB_Module | 0x0004) |
| 68 | #define VO_PID_AMRWB_FRAMETYPE (VO_PID_AMRWB_Module | 0x0005) |
| 69 | #define VO_PID_AMRWB_MODE (VO_PID_AMRWB_Module | 0x0006) |
| 70 | #define VO_PID_AMRWB_DTX (VO_PID_AMRWB_Module | 0x0007) |
| 71 | |
| 72 | /** |
| 73 | * Get audio codec API interface |
| 74 | * \param pEncHandle [out] Return the AMRWB Encoder handle. |
| 75 | * \retval VO_ERR_OK Succeeded. |
| 76 | */ |
| 77 | VO_S32 VO_API voGetAMRWBEncAPI(VO_AUDIO_CODECAPI *pEncHandle); |
| 78 | |
| 79 | |
| 80 | #pragma pack(pop) |
| 81 | #ifdef __cplusplus |
| 82 | } /* extern "C" */ |
| 83 | #endif /* __cplusplus */ |
| 84 | |
| 85 | |
| 86 | #endif //__VOAMRWB_H__ |
| 87 |