1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 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 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 /**************************************************************************************** 19 Portions of this file are derived from the following 3GPP standard: 20 21 3GPP TS 26.173 22 ANSI-C code for the Adaptive Multi-Rate - Wideband (AMR-WB) speech codec 23 Available from http://www.3gpp.org 24 25 (C) 2007, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 Permission to distribute, modify and use this file under the standard license 27 terms listed above has been obtained from the copyright holder. 28 ****************************************************************************************/ 29 /* 30 ------------------------------------------------------------------------------ 31 32 Name: pvamrwbdecoder_api.h 33 34 Date: 05/02/2007 35 36 ------------------------------------------------------------------------------ 37 REVISION HISTORY 38 39 40 Description: 41 42 ------------------------------------------------------------------------------ 43 INCLUDE DESCRIPTION 44 45 Main header file for the Packet Video AMR Wide Band decoder library. The 46 constants, structures, and functions defined within this file, along with 47 a basic data types header file, is all that is needed to use and communicate 48 with the library. The internal data structures within the library are 49 purposely hidden. 50 51 ---* Need description of the input buffering. *------- 52 53 ---* Need an example of calling the library here *---- 54 55 ------------------------------------------------------------------------------ 56 REFERENCES 57 58 (Normally header files do not have a reference section) 59 60 ------------------------------------------------------------------------------ 61 */ 62 63 /*---------------------------------------------------------------------------- 64 ; CONTINUE ONLY IF NOT ALREADY DEFINED 65 ----------------------------------------------------------------------------*/ 66 #ifndef _PVAMRWBDECODER_API_H 67 #define _PVAMRWBDECODER_API_H 68 69 70 /*---------------------------------------------------------------------------- 71 ; INCLUDES 72 ----------------------------------------------------------------------------*/ 73 #ifdef __cplusplus 74 extern "C" 75 { 76 #endif 77 78 /*---------------------------------------------------------------------------- 79 ; MACROS 80 ; Define module specific macros here 81 ----------------------------------------------------------------------------*/ 82 83 /*---------------------------------------------------------------------------- 84 ; DEFINES 85 ; Include all pre-processor statements here. 86 ----------------------------------------------------------------------------*/ 87 88 #define AMR_WB_PCM_FRAME 320 /* Frame size at 16kHz */ 89 90 91 #define NBBITS_7k 132 /* 6.60k */ 92 #define NBBITS_9k 177 /* 8.85k */ 93 #define NBBITS_12k 253 /* 12.65k */ 94 #define NBBITS_14k 285 /* 14.25k */ 95 #define NBBITS_16k 317 /* 15.85k */ 96 #define NBBITS_18k 365 /* 18.25k */ 97 #define NBBITS_20k 397 /* 19.85k */ 98 #define NBBITS_23k 461 /* 23.05k */ 99 #define NBBITS_24k 477 /* 23.85k */ 100 101 #define NBBITS_SID 35 102 103 #define KAMRWB_NB_BITS_MAX NBBITS_24k 104 #define KAMRWB_NB_BYTES_MAX ((KAMRWB_NB_BITS_MAX>>3)+1) 105 106 #define NUM_OF_MODES 10 107 108 109 static const int16 AMR_WB_COMPRESSED[NUM_OF_MODES] = 110 { 111 NBBITS_7k, 112 NBBITS_9k, 113 NBBITS_12k, 114 NBBITS_14k, 115 NBBITS_16k, 116 NBBITS_18k, 117 NBBITS_20k, 118 NBBITS_23k, 119 NBBITS_24k, 120 NBBITS_SID 121 }; 122 123 /*---------------------------------------------------------------------------- 124 ; EXTERNAL VARIABLES REFERENCES 125 ; Declare variables used in this module but defined elsewhere 126 ----------------------------------------------------------------------------*/ 127 128 /*---------------------------------------------------------------------------- 129 ; SIMPLE TYPEDEF'S 130 ----------------------------------------------------------------------------*/ 131 132 /*---------------------------------------------------------------------------- 133 ; ENUMERATED TYPEDEF'S 134 ----------------------------------------------------------------------------*/ 135 136 137 /*---------------------------------------------------------------------------- 138 ; GLOBAL FUNCTION DEFINITIONS 139 ; Function Prototype declaration 140 ----------------------------------------------------------------------------*/ 141 142 143 /*---------------------------------------------------------------------------- 144 ; END 145 ----------------------------------------------------------------------------*/ 146 147 #ifdef __cplusplus 148 } 149 #endif 150 151 152 #endif /* PVMP4AUDIODECODER_API_H */ 153 154 155