1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/Codecs/Inc/Gsm610CodecCommon/gsm610fr.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,113 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __GSM610FR__
1.20 +#define __GSM610FR__
1.21 +
1.22 +// INCLUDES
1.23 +#include <e32base.h>
1.24 +
1.25 +#include "rpeltp.h"
1.26 +
1.27 +// DEFINES
1.28 +#define PACKSIZE 65 // Size of one bit packed block (2 frames)
1.29 +
1.30 +// CLASS DEFINITIONS
1.31 +/*
1.32 +-----------------------------------------------------------------------------
1.33 +
1.34 + CGSM610FR_Encoder
1.35 +
1.36 + GSM 6.10 full rate (FR) speech encoder.
1.37 +
1.38 +-----------------------------------------------------------------------------
1.39 +*/
1.40 +class CGSM610FR_Encoder
1.41 + {
1.42 +public:
1.43 + IMPORT_C void ConstructL();
1.44 + IMPORT_C ~CGSM610FR_Encoder();
1.45 + IMPORT_C void StartL();
1.46 + IMPORT_C void ExecuteL(TUint8* aInBuf, TUint8* OutBuf);
1.47 + IMPORT_C void StopL();
1.48 +private:
1.49 + void PackFrame0(struct codes* aCodeBuf, TInt8* pbuf);
1.50 + void PackFrame1(struct codes* aCodeBuf, TInt8* pbuf);
1.51 +private:
1.52 + struct codes iCodeBuf; // buffer for speech codewords, one frame
1.53 + TBool iOddFrame; // is the current frame odd or even frame?
1.54 +private:
1.55 + friend void reset_encoder(CGSM610FR_Encoder* aEncoder);
1.56 + friend void prepr(CGSM610FR_Encoder* aEncoder, int2 sof[], int2 so[]);
1.57 + friend void preemp(CGSM610FR_Encoder* aEncoder, int2 s[], int2 sof[]);
1.58 + friend void ltpcomp(CGSM610FR_Encoder* aEncoder, int2 *Nc, int2 *bc, int2 d[], int k_start);
1.59 + friend void ltpfil(CGSM610FR_Encoder* aEncoder, int2 e[], int2 dpp[], int2 d[], int2 bc, int2 Nc, int k_start);
1.60 + friend void ltpupd( CGSM610FR_Encoder* aEncoder, int2 dpp[], int2 ep[] );
1.61 + friend void LPC_analysis(CGSM610FR_Encoder* aEncoder, int2 ibuf[], struct codes *ecodes);
1.62 + friend void invfil(CGSM610FR_Encoder* aEncoder, int2 d[], int2 s[], int2 rp[], int k_start, int k_end);
1.63 +private:
1.64 + int2 z1; /* delay 1 of offset comp */
1.65 + int4 L_z2; /* delay 2 of offset comp */
1.66 + int2 mp; /* delay of preemphasis */
1.67 + int2 u[8]; /* LPC analysis filter delay */
1.68 + int2 dp[120]; /* Encoder LTP delay */
1.69 + int2 LARpp_prev[8]; /* Encoder LARs of the prev frame */
1.70 +
1.71 + };
1.72 +
1.73 +
1.74 +/*
1.75 +-----------------------------------------------------------------------------
1.76 +
1.77 + CGSM610FR_Decoder
1.78 +
1.79 + GSM 6.10 full rate (FR) speech decoder.
1.80 +
1.81 +-----------------------------------------------------------------------------
1.82 +*/
1.83 +class CGSM610FR_Decoder
1.84 + {
1.85 +public:
1.86 + IMPORT_C void ConstructL();
1.87 + IMPORT_C ~CGSM610FR_Decoder();
1.88 + IMPORT_C void StartL();
1.89 + IMPORT_C void ExecuteL(TUint8* aSrc, TUint8* aDst);
1.90 + IMPORT_C void StopL();
1.91 +private:
1.92 + void UnpackFrame0(struct codes* aCodeBuf, TInt8* pbuf);
1.93 + void UnpackFrame1(struct codes* aCodeBuf, TInt8* pbuf);
1.94 +private:
1.95 + struct codes iCodeBuf; // buffer for speech codewords, one frame
1.96 + TBool iOddFrame; // is the current frame odd or even frame?
1.97 +private:
1.98 + friend void reset_decoder(CGSM610FR_Decoder* aDecoder);
1.99 + friend void ltpsyn(CGSM610FR_Decoder* aDecoder, int2 erp[], int2 wt[], int2 bcr, int2 Ncr);
1.100 + friend void postpr(CGSM610FR_Decoder* aDecoder, int2 srop[], int2 sr[]);
1.101 + friend void LPC_synthesis(CGSM610FR_Decoder* aDecoder, struct codes *dcodes, int2 wt[], int2 obuf[]);
1.102 + friend void synfil(CGSM610FR_Decoder* aDecoder, int2 sr[], int2 wt[], int2 rrp[], int k_start, int k_end);
1.103 +private:
1.104 + int2 msr; /* de emphasis delay */
1.105 + int2 v[9]; /* LPC synthesis filter delay */
1.106 + int2 drp[120]; /* Decoder LTP delay */
1.107 + int2 nrp; /* LTP delay of the previous frame */
1.108 + int2 LARrpp_prev[8]; /* Decoder LARs of the prev frame */
1.109 + };
1.110 +
1.111 +
1.112 +#endif //__GSM610FR__
1.113 +
1.114 +//-----------------------------------------------------------------------------
1.115 +// End of File
1.116 +//-----------------------------------------------------------------------------