Home | History | Annotate | Download | only in src
      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.073
     22     ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
     23     Available from http://www.3gpp.org
     24 
     25 (C) 2004, 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 
     33 
     34  Filename: /audio/gsm-amr/c/include/amrencode.h
     35 
     36      Date: 02/01/2002
     37 
     38 ------------------------------------------------------------------------------
     39  REVISION HISTORY
     40 
     41  Description: Removed hard tabs from file.
     42 
     43  Description: Added #define for WMF and IF2, and updated function prototype.
     44 
     45  Description: Renamed WMF to AMR_WMF, IF2 to AMR_IF2, and added AMR_ETS.
     46 
     47  Description: Changed output_type to output_format.
     48 
     49  Description: Added external reference to WmfEncBytesPerFrame and
     50               If2EncBytesPerFrame tables.
     51 
     52  Description: Updated function prototype for AMREncode(). Added function
     53               prototype for AMREncodeInit, AMREncodeReset, and AMREncodeExit.
     54               Added #defines for TX SID frame formatting.
     55 
     56  Description:  Replaced "int" and/or "char" with OSCL defined types.
     57 
     58  Description: Moved _cplusplus #ifdef after Include section.
     59 
     60  Description:
     61 
     62 ------------------------------------------------------------------------------
     63  INCLUDE DESCRIPTION
     64 
     65  This file contains the function prototype of AMREncode.
     66 
     67 ------------------------------------------------------------------------------
     68 */
     69 
     70 #ifndef _AMRENCODE_H_
     71 #define _AMRENCODE_H_
     72 
     73 /*----------------------------------------------------------------------------
     74 ; INCLUDES
     75 ----------------------------------------------------------------------------*/
     76 #include "typedef.h"
     77 #include "mode.h"
     78 #include "frame_type_3gpp.h"
     79 
     80 /*--------------------------------------------------------------------------*/
     81 #ifdef __cplusplus
     82 extern "C"
     83 {
     84 #endif
     85 
     86     /*----------------------------------------------------------------------------
     87     ; MACROS
     88     ; [Define module specific macros here]
     89     ----------------------------------------------------------------------------*/
     90 
     91     /*----------------------------------------------------------------------------
     92     ; DEFINES
     93     ; [Include all pre-processor statements here.]
     94     ----------------------------------------------------------------------------*/
     95 #define NUM_AMRSID_TXMODE_BITS     3
     96 #define AMRSID_TXMODE_BIT_OFFSET   36
     97 #define AMRSID_TXTYPE_BIT_OFFSET   35
     98 
     99     /* Output format types */
    100 #define AMR_TX_WMF 0
    101 #define AMR_TX_IF2 1
    102 #define AMR_TX_ETS 2
    103 
    104     /*----------------------------------------------------------------------------
    105     ; EXTERNAL VARIABLES REFERENCES
    106     ; [Declare variables used in this module but defined elsewhere]
    107     ----------------------------------------------------------------------------*/
    108     extern const Word16 WmfEncBytesPerFrame[];
    109     extern const Word16 If2EncBytesPerFrame[];
    110 
    111     /*----------------------------------------------------------------------------
    112     ; SIMPLE TYPEDEF'S
    113     ----------------------------------------------------------------------------*/
    114 
    115     /*----------------------------------------------------------------------------
    116     ; ENUMERATED TYPEDEF'S
    117     ----------------------------------------------------------------------------*/
    118 
    119     /*----------------------------------------------------------------------------
    120     ; STRUCTURES TYPEDEF'S
    121     ----------------------------------------------------------------------------*/
    122 
    123     /*----------------------------------------------------------------------------
    124     ; GLOBAL FUNCTION DEFINITIONS
    125     ; [List function prototypes here]
    126     ----------------------------------------------------------------------------*/
    127     Word16 AMREncodeInit(
    128         void **pEncStructure,
    129         void **pSidSyncStructure,
    130         Flag dtx_enable);
    131 
    132     Word16 AMREncodeReset(
    133         void *pEncStructure,
    134         void *pSidSyncStructure);
    135 
    136     void AMREncodeExit(
    137         void **pEncStructure,
    138         void **pSidSyncStructure);
    139 
    140     Word16 AMREncode(
    141         void *pEncState,
    142         void *pSidSyncState,
    143         enum Mode mode,
    144         Word16 *pEncInput,
    145         UWord8 *pEncOutput,
    146         enum Frame_Type_3GPP *p3gpp_frame_type,
    147         Word16 output_format
    148     );
    149 
    150 #ifdef __cplusplus
    151 }
    152 #endif
    153 
    154 #endif  /* _AMRENCODE_H_ */
    155 
    156 
    157