First public contribution.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 #define PACKSIZE 65 // Size of one bit packed block (2 frames)
29 -----------------------------------------------------------------------------
33 GSM 6.10 full rate (FR) speech encoder.
35 -----------------------------------------------------------------------------
37 class CGSM610FR_Encoder
40 IMPORT_C void ConstructL();
41 IMPORT_C ~CGSM610FR_Encoder();
42 IMPORT_C void StartL();
43 IMPORT_C void ExecuteL(TUint8* aInBuf, TUint8* OutBuf);
44 IMPORT_C void StopL();
46 void PackFrame0(struct codes* aCodeBuf, TInt8* pbuf);
47 void PackFrame1(struct codes* aCodeBuf, TInt8* pbuf);
49 struct codes iCodeBuf; // buffer for speech codewords, one frame
50 TBool iOddFrame; // is the current frame odd or even frame?
52 friend void reset_encoder(CGSM610FR_Encoder* aEncoder);
53 friend void prepr(CGSM610FR_Encoder* aEncoder, int2 sof[], int2 so[]);
54 friend void preemp(CGSM610FR_Encoder* aEncoder, int2 s[], int2 sof[]);
55 friend void ltpcomp(CGSM610FR_Encoder* aEncoder, int2 *Nc, int2 *bc, int2 d[], int k_start);
56 friend void ltpfil(CGSM610FR_Encoder* aEncoder, int2 e[], int2 dpp[], int2 d[], int2 bc, int2 Nc, int k_start);
57 friend void ltpupd( CGSM610FR_Encoder* aEncoder, int2 dpp[], int2 ep[] );
58 friend void LPC_analysis(CGSM610FR_Encoder* aEncoder, int2 ibuf[], struct codes *ecodes);
59 friend void invfil(CGSM610FR_Encoder* aEncoder, int2 d[], int2 s[], int2 rp[], int k_start, int k_end);
61 int2 z1; /* delay 1 of offset comp */
62 int4 L_z2; /* delay 2 of offset comp */
63 int2 mp; /* delay of preemphasis */
64 int2 u[8]; /* LPC analysis filter delay */
65 int2 dp[120]; /* Encoder LTP delay */
66 int2 LARpp_prev[8]; /* Encoder LARs of the prev frame */
72 -----------------------------------------------------------------------------
76 GSM 6.10 full rate (FR) speech decoder.
78 -----------------------------------------------------------------------------
80 class CGSM610FR_Decoder
83 IMPORT_C void ConstructL();
84 IMPORT_C ~CGSM610FR_Decoder();
85 IMPORT_C void StartL();
86 IMPORT_C void ExecuteL(TUint8* aSrc, TUint8* aDst);
87 IMPORT_C void StopL();
89 void UnpackFrame0(struct codes* aCodeBuf, TInt8* pbuf);
90 void UnpackFrame1(struct codes* aCodeBuf, TInt8* pbuf);
92 struct codes iCodeBuf; // buffer for speech codewords, one frame
93 TBool iOddFrame; // is the current frame odd or even frame?
95 friend void reset_decoder(CGSM610FR_Decoder* aDecoder);
96 friend void ltpsyn(CGSM610FR_Decoder* aDecoder, int2 erp[], int2 wt[], int2 bcr, int2 Ncr);
97 friend void postpr(CGSM610FR_Decoder* aDecoder, int2 srop[], int2 sr[]);
98 friend void LPC_synthesis(CGSM610FR_Decoder* aDecoder, struct codes *dcodes, int2 wt[], int2 obuf[]);
99 friend void synfil(CGSM610FR_Decoder* aDecoder, int2 sr[], int2 wt[], int2 rrp[], int k_start, int k_end);
101 int2 msr; /* de emphasis delay */
102 int2 v[9]; /* LPC synthesis filter delay */
103 int2 drp[120]; /* Decoder LTP delay */
104 int2 nrp; /* LTP delay of the previous frame */
105 int2 LARrpp_prev[8]; /* Decoder LARs of the prev frame */
109 #endif //__GSM610FR__
111 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------