g722_interface.cpp

来自「G722语音压缩算法」· C++ 代码 · 共 41 行

CPP
41
字号
//---------------------------------------------------------------------------

#include "G722_Interface.h"
extern int g722_init_state(pG722_Handle);
extern int g722_encoder(pG722_Handle ,short *, UINT16 *,int);
extern int g722_decoder(pG722_Handle ,UINT16 *,short *,int);
//---------------------------------------------------------------------------

int G722_EncodeInit( pG722_Handle handle)       //      Encode
{
        g722_init_state( handle );
        return 1;
}
//---------------------------------------------------------------------------

int G722_DecodeInit( pG722_Handle handle)       //      Decode
{
        g722_init_state( handle );
        return 1;
}
//---------------------------------------------------------------------------

// encode
int G722_Encode( pG722_Handle handle, short pcmIn[], UINT16 code[], int n )
{       int i;
        i=g722_encoder( handle, pcmIn, code, n>>2 );
        return i;
}
//---------------------------------------------------------------------------

//decode
int G722_Decode( pG722_Handle handle, UINT16 code[], short pcmOut[], int n )
{       int i;
        i=g722_decoder( handle, code, pcmOut, n );
        return i;
}
//---------------------------------------------------------------------------



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?