1b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber/* ------------------------------------------------------------------
2b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * Copyright (C) 1998-2009 PacketVideo
3b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber *
4b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
5b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * you may not use this file except in compliance with the License.
6b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * You may obtain a copy of the License at
7b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber *
8b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
9b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber *
10b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * Unless required by applicable law or agreed to in writing, software
11b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
12b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * express or implied.
14b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * See the License for the specific language governing permissions
15b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * and limitations under the License.
16b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber * -------------------------------------------------------------------
17b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber */
18b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber/****************************************************************************************
19b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas HuberPortions of this file are derived from the following 3GPP standard:
20b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
21b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    3GPP TS 26.073
22b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
23b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    Available from http://www.3gpp.org
24b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
25b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
26b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas HuberPermission to distribute, modify and use this file under the standard license
27b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huberterms listed above has been obtained from the copyright holder.
28b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber****************************************************************************************/
29b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber/*
30b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber------------------------------------------------------------------------------
31b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
32b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
33b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
34b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Filename: /audio/gsm-amr/c/include/amrencode.h
35b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
36b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber     Date: 02/01/2002
37b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
38b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber------------------------------------------------------------------------------
39b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber REVISION HISTORY
40b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
41b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Removed hard tabs from file.
42b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
43b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Added #define for WMF and IF2, and updated function prototype.
44b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
45b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Renamed WMF to AMR_WMF, IF2 to AMR_IF2, and added AMR_ETS.
46b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
47b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Changed output_type to output_format.
48b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
49b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Added external reference to WmfEncBytesPerFrame and
50b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber              If2EncBytesPerFrame tables.
51b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
52b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Updated function prototype for AMREncode(). Added function
53b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber              prototype for AMREncodeInit, AMREncodeReset, and AMREncodeExit.
54b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber              Added #defines for TX SID frame formatting.
55b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
56b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description:  Replaced "int" and/or "char" with OSCL defined types.
57b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
58b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description: Moved _cplusplus #ifdef after Include section.
59b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
60b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber Description:
61b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
62b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber------------------------------------------------------------------------------
63b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber INCLUDE DESCRIPTION
64b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
65b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber This file contains the function prototype of AMREncode.
66b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
67b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber------------------------------------------------------------------------------
68b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber*/
69b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
70b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#ifndef _AMRENCODE_H_
71b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define _AMRENCODE_H_
72b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
73b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber/*----------------------------------------------------------------------------
74b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber; INCLUDES
75b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber----------------------------------------------------------------------------*/
76b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#include "typedef.h"
77b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#include "mode.h"
78b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#include "frame_type_3gpp.h"
79b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
80b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber/*--------------------------------------------------------------------------*/
81b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#ifdef __cplusplus
82b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huberextern "C"
83b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber{
84b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#endif
85b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
86b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
87b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; MACROS
88b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; [Define module specific macros here]
89b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
90b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
91b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
92b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; DEFINES
93b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; [Include all pre-processor statements here.]
94b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
95b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define NUM_AMRSID_TXMODE_BITS     3
96b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define AMRSID_TXMODE_BIT_OFFSET   36
97b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define AMRSID_TXTYPE_BIT_OFFSET   35
98b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
99b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /* Output format types */
100b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define AMR_TX_WMF 0
101b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define AMR_TX_IF2 1
102b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#define AMR_TX_ETS 2
103b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
104b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
105b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; EXTERNAL VARIABLES REFERENCES
106b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; [Declare variables used in this module but defined elsewhere]
107b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
108b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    extern const Word16 WmfEncBytesPerFrame[];
109b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    extern const Word16 If2EncBytesPerFrame[];
110b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
111b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
112b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; SIMPLE TYPEDEF'S
113b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
114b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
115b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
116b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; ENUMERATED TYPEDEF'S
117b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
118b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
119b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
120b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; STRUCTURES TYPEDEF'S
121b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
122b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
123b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    /*----------------------------------------------------------------------------
124b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; GLOBAL FUNCTION DEFINITIONS
125b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ; [List function prototypes here]
126b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    ----------------------------------------------------------------------------*/
127b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    Word16 AMREncodeInit(
128b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void **pEncStructure,
129b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void **pSidSyncStructure,
130b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        Flag dtx_enable);
131b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
132b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    Word16 AMREncodeReset(
133b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void *pEncStructure,
134b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void *pSidSyncStructure);
135b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
136b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    void AMREncodeExit(
137b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void **pEncStructure,
138b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void **pSidSyncStructure);
139b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
140b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    Word16 AMREncode(
141b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void *pEncState,
142b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        void *pSidSyncState,
143b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        enum Mode mode,
144b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        Word16 *pEncInput,
145b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        UWord8 *pEncOutput,
146b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        enum Frame_Type_3GPP *p3gpp_frame_type,
147b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber        Word16 output_format
148b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber    );
149b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
150b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#ifdef __cplusplus
151b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber}
152b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#endif
153b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
154b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber#endif  /* _AMRENCODE_H_ */
155b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
156b841f14f8e51f2365945281fbfa54ef6a1b1b5a6Andreas Huber
157