os/mm/mmlibs/mmfw/Codecs/Inc/Gsm610CodecCommon/gsm610fr.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __GSM610FR__
sl@0
    17
#define __GSM610FR__
sl@0
    18
sl@0
    19
//  INCLUDES
sl@0
    20
#include <e32base.h>
sl@0
    21
sl@0
    22
#include "rpeltp.h"
sl@0
    23
sl@0
    24
// DEFINES
sl@0
    25
#define PACKSIZE 65 // Size of one bit packed block (2 frames)
sl@0
    26
sl@0
    27
//  CLASS DEFINITIONS
sl@0
    28
/*
sl@0
    29
-----------------------------------------------------------------------------
sl@0
    30
sl@0
    31
    CGSM610FR_Encoder
sl@0
    32
sl@0
    33
    GSM 6.10 full rate (FR) speech encoder.
sl@0
    34
sl@0
    35
-----------------------------------------------------------------------------
sl@0
    36
*/
sl@0
    37
class CGSM610FR_Encoder
sl@0
    38
    {
sl@0
    39
public:
sl@0
    40
    IMPORT_C void ConstructL();
sl@0
    41
    IMPORT_C ~CGSM610FR_Encoder();
sl@0
    42
    IMPORT_C void StartL();
sl@0
    43
    IMPORT_C void ExecuteL(TUint8* aInBuf, TUint8* OutBuf);
sl@0
    44
    IMPORT_C void StopL();
sl@0
    45
private:
sl@0
    46
    void PackFrame0(struct codes* aCodeBuf, TInt8* pbuf);
sl@0
    47
    void PackFrame1(struct codes* aCodeBuf, TInt8* pbuf);
sl@0
    48
private:
sl@0
    49
    struct codes iCodeBuf;       // buffer for speech codewords, one frame
sl@0
    50
    TBool iOddFrame;              // is the current frame odd or even frame?
sl@0
    51
private:
sl@0
    52
    friend void reset_encoder(CGSM610FR_Encoder* aEncoder);
sl@0
    53
    friend void prepr(CGSM610FR_Encoder* aEncoder, int2 sof[], int2 so[]);
sl@0
    54
    friend void preemp(CGSM610FR_Encoder* aEncoder, int2 s[], int2 sof[]);
sl@0
    55
    friend void ltpcomp(CGSM610FR_Encoder* aEncoder, int2 *Nc, int2 *bc, int2 d[], int k_start);
sl@0
    56
    friend void ltpfil(CGSM610FR_Encoder* aEncoder, int2 e[], int2 dpp[], int2 d[], int2 bc, int2 Nc, int k_start);
sl@0
    57
    friend void ltpupd( CGSM610FR_Encoder* aEncoder, int2 dpp[], int2 ep[] );
sl@0
    58
    friend void LPC_analysis(CGSM610FR_Encoder* aEncoder, int2 ibuf[], struct codes *ecodes);
sl@0
    59
    friend void invfil(CGSM610FR_Encoder* aEncoder, int2 d[], int2 s[], int2 rp[], int k_start, int k_end);
sl@0
    60
private:
sl@0
    61
    int2 z1;            /* delay 1 of offset comp */
sl@0
    62
    int4 L_z2;          /* delay 2 of offset comp */
sl@0
    63
    int2 mp;            /* delay of preemphasis */
sl@0
    64
    int2 u[8];          /* LPC analysis filter delay */
sl@0
    65
    int2 dp[120];       /* Encoder LTP delay */
sl@0
    66
    int2 LARpp_prev[8]; /* Encoder LARs of the prev frame */
sl@0
    67
sl@0
    68
    };
sl@0
    69
sl@0
    70
sl@0
    71
/*
sl@0
    72
-----------------------------------------------------------------------------
sl@0
    73
sl@0
    74
    CGSM610FR_Decoder
sl@0
    75
sl@0
    76
    GSM 6.10 full rate (FR) speech decoder.
sl@0
    77
sl@0
    78
-----------------------------------------------------------------------------
sl@0
    79
*/
sl@0
    80
class CGSM610FR_Decoder
sl@0
    81
    {
sl@0
    82
public:
sl@0
    83
   IMPORT_C void ConstructL();
sl@0
    84
   IMPORT_C ~CGSM610FR_Decoder();
sl@0
    85
   IMPORT_C void StartL();
sl@0
    86
   IMPORT_C void ExecuteL(TUint8* aSrc, TUint8* aDst);
sl@0
    87
   IMPORT_C void StopL();
sl@0
    88
private:
sl@0
    89
    void UnpackFrame0(struct codes* aCodeBuf, TInt8* pbuf);
sl@0
    90
    void UnpackFrame1(struct codes* aCodeBuf, TInt8* pbuf);
sl@0
    91
private:
sl@0
    92
    struct codes iCodeBuf;       // buffer for speech codewords, one frame
sl@0
    93
    TBool iOddFrame;             // is the current frame odd or even frame?
sl@0
    94
private:
sl@0
    95
    friend void reset_decoder(CGSM610FR_Decoder* aDecoder);
sl@0
    96
    friend void ltpsyn(CGSM610FR_Decoder* aDecoder, int2 erp[], int2 wt[], int2 bcr, int2 Ncr);
sl@0
    97
    friend void postpr(CGSM610FR_Decoder* aDecoder, int2 srop[], int2 sr[]);
sl@0
    98
    friend void LPC_synthesis(CGSM610FR_Decoder* aDecoder, struct codes *dcodes, int2 wt[], int2 obuf[]);
sl@0
    99
    friend void synfil(CGSM610FR_Decoder* aDecoder, int2 sr[], int2 wt[], int2 rrp[], int k_start, int k_end);
sl@0
   100
private:
sl@0
   101
    int2 msr;            /* de emphasis delay */
sl@0
   102
    int2 v[9];           /* LPC synthesis filter delay */
sl@0
   103
    int2 drp[120];       /* Decoder LTP delay */
sl@0
   104
    int2 nrp;            /* LTP delay of the previous frame */
sl@0
   105
    int2 LARrpp_prev[8]; /* Decoder LARs of the prev frame */
sl@0
   106
    };
sl@0
   107
sl@0
   108
sl@0
   109
#endif //__GSM610FR__
sl@0
   110
sl@0
   111
//-----------------------------------------------------------------------------
sl@0
   112
//  End of File
sl@0
   113
//-----------------------------------------------------------------------------