• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef AMR_DEC_H_INCLUDED
19 #define AMR_DEC_H_INCLUDED
20 
21 #ifndef OSCL_MEM_H_INCLUDED
22 #include "oscl_mem.h"
23 #endif
24 
25 #ifndef OMX_Component_h
26 #include "OMX_Component.h"
27 #endif
28 
29 #ifndef FRAME_TYPE_3GPP_H
30 #include "frame_type_3gpp.h"
31 #endif
32 
33 #ifndef _DECODER_AMR_NB_H
34 #include "decoder_gsm_amr.h"
35 #endif
36 
37 #ifndef _DECODER_AMR_WB_H
38 #include "decoder_amr_wb.h"
39 #endif
40 
41 
42 
43 class OmxAmrDecoder
44 {
45     public:
46         OmxAmrDecoder();
47 
48         OMX_BOOL AmrDecInit(OMX_AUDIO_AMRFRAMEFORMATTYPE aInFormat, OMX_AUDIO_AMRBANDMODETYPE aInMode);
49 
50         void AmrDecDeinit();
51 
52         OMX_BOOL AmrDecodeFrame(OMX_S16* aOutputBuffer,
53                                 OMX_U32* aOutputLength, OMX_U8** aInBuffer,
54                                 OMX_U32* aInBufSize, OMX_S32* aIsFirstBuffer);
55 
56         OMX_BOOL AmrDecodeSilenceFrame(OMX_S16* aOutputBuffer,
57                                        OMX_U32* aOutputLength);
58 
59 
60         void ResetDecoder(); // for repositioning
61 
62         OMX_S32 iAmrInitFlag;
63 
64     private:
65 
66         Frame_Type_3GPP GetFrameTypeLength(OMX_U8* &ptr, OMX_S32 *pLength);
67         void GetStartPointsForIETFCombinedMode(OMX_U8* aPtrIn, OMX_U32 aLength,
68                                                OMX_U8* &aTocPtr, OMX_S32* aNumOfBytes);
69 
70         OMX_S16 iOmxInputFormat;
71         OMX_U8  *iTocTablePtr;
72         OMX_S32 iAMRFramesinTOC;
73 
74 
75         //CDecoder_AMR_NB* iAudioAmrDecoder;
76         CDecoder_AMRInterface* iAudioAmrDecoder;
77         tPVAmrDecoderExternal* iCodecExternals;
78 
79         OMX_U32 iOutputFrameSize;
80         OMX_BOOL iNarrowBandFlag;
81 
82         OMX_S16 iDecHomingFlag;
83         OMX_S16 iDecHomingFlagOld;
84 
85 };
86 
87 
88 
89 #endif  //#ifndef AMR_DEC_H_INCLUDED
90 
91