亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usc729fp.c

?? G.711,G.723.1,G.726,G.729,GSM CODEC C/C++ code
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*/////////////////////////////////////////////////////////////////////////////
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2004-2005 Intel Corporation. All Rights Reserved.
//
//     Intel(R) Integrated Performance Primitives
//     USC - Unified Speech Codec interface library
//
// By downloading and installing USC codec, you hereby agree that the
// accompanying Materials are being provided to you under the terms and
// conditions of the End User License Agreement for the Intel(R) Integrated
// Performance Primitives product previously accepted by you. Please refer
// to the file ipplic.htm located in the root directory of your Intel(R) IPP
// product installation for more information.
//
// A speech coding standards promoted by ITU, ETSI, 3GPP and other
// organizations. Implementations of these standards, or the standard enabled
// platforms may require licenses from various entities, including
// Intel Corporation.
//
//
// Purpose: G.729 floating-point speech codec: USC functions.
//
*/

#include "owng729fp.h"
#include "g729fpapi.h"
#include <string.h>
#include <usc.h>

#define  G729IFP_NUM_RATES   3
#define  G729AFP_NUM_RATES   1

static USC_Status GetInfo_G729I(USC_Handle handle, USC_CodecInfo *pInfo);
static USC_Status GetInfo_G729A(USC_Handle handle, USC_CodecInfo *pInfo);
static USC_Status NumAlloc(const USC_Option *options, int *nbanks);
static USC_Status MemAlloc_G729I(const USC_Option *options, USC_MemBank *pBanks);
static USC_Status MemAlloc_G729A(const USC_Option *options, USC_MemBank *pBanks);
static USC_Status Init_G729I(const USC_Option *options, const USC_MemBank *pBanks, USC_Handle *handle);
static USC_Status Init_G729A(const USC_Option *options, const USC_MemBank *pBanks, USC_Handle *handle);
static USC_Status Reinit_G729I(const USC_Modes *modes, USC_Handle handle );
static USC_Status Reinit_G729A(const USC_Modes *modes, USC_Handle handle );
static USC_Status Control_G729I(const USC_Modes *modes, USC_Handle handle );
static USC_Status Control_G729A(const USC_Modes *modes, USC_Handle handle );
static USC_Status Encode_G729I(USC_Handle handle, USC_PCMStream *in, USC_Bitstream *out);
static USC_Status Encode_G729A(USC_Handle handle, USC_PCMStream *in, USC_Bitstream *out);
static USC_Status Decode_G729I(USC_Handle handle, USC_Bitstream *in, USC_PCMStream *out);
static USC_Status Decode_G729A(USC_Handle handle, USC_Bitstream *in, USC_PCMStream *out);
static USC_Status GetOutStreamSizeI(const USC_Option *options, int bitrate, int nbytesSrc, int *nbytesDst);
static USC_Status GetOutStreamSizeA(const USC_Option *options, int bitrate, int nbytesSrc, int *nbytesDst);
static USC_Status SetFrameSize(const USC_Option *options, USC_Handle handle, int frameSize);

#define BITSTREAM_SIZE      15
#define G729_SPEECH_FRAME   80
#define G729_BITS_PER_SAMPLE 16
#define G729_SID_FRAMESIZE    2
#define G729_NUM_UNTR_FRAMES  2


typedef struct {
    int direction;
    int bitrate;
    int vad;
    int reserved; // for future extension
} G729_Handle_Header;

/* global usc vector table */
USCFUN USC_Fxns USC_G729IFP_Fxns=
{
    {
        USC_Codec,
        GetInfo_G729I,
        NumAlloc,
        MemAlloc_G729I,
        Init_G729I,
        Reinit_G729I,
        Control_G729I
    },
    Encode_G729I,
    Decode_G729I,
    GetOutStreamSizeI,
    SetFrameSize

};

USCFUN USC_Fxns USC_G729AFP_Fxns=
{
    {
        USC_Codec,
        GetInfo_G729A,
        NumAlloc,
        MemAlloc_G729A,
        Init_G729A,
        Reinit_G729A,
        Control_G729A
    },
    Encode_G729A,
    Decode_G729A,
    GetOutStreamSizeA,
    SetFrameSize

};

static USC_Option  params;  /* what is supported  */
static USC_PCMType pcmType; /* codec audio source */

static __ALIGN32 CONST short LostFrame[G729_SPEECH_FRAME]=
{
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0
};

static __ALIGN32 CONST USC_Rates pTblRates_G729IFP[G729IFP_NUM_RATES]={
    {11800},
    {8000},
    {6400}
};

static __ALIGN32 CONST USC_Rates pTblRates_G729AFP[G729AFP_NUM_RATES]={
    {8000}
};

static int CheckRate_G729I(int rate_bps)
{
    int rate;

    switch(rate_bps) {
      case 8000:  rate = 0; break;
      case 6400:  rate = 2; break;
      case 11800: rate = 3; break;
      default: rate = -1; break;
    }
    return rate;
}

static int CheckRate_G729A(int rate_bps)
{
    int rate;

    switch(rate_bps) {
      case 8000:  rate = 1; break;
      default: rate = -1; break;
    }
    return rate;
}

static USC_Status GetInfo_G729I(USC_Handle handle, USC_CodecInfo *pInfo)
{

    G729_Handle_Header *g729_header;

    pInfo->name = "G729IFP";
    pInfo->framesize = G729_SPEECH_FRAME*sizeof(short);
    if (handle == NULL) {
       pInfo->params.modes.bitrate = 8000;
       pInfo->params.direction = 0;
       pInfo->params.modes.vad = 1;
    } else {
       g729_header = (G729_Handle_Header*)handle;
       pInfo->params.modes.bitrate = g729_header->bitrate;
       pInfo->params.direction = g729_header->direction;
       pInfo->params.modes.vad = g729_header->vad;
    }
    pInfo->params.modes.truncate = 0;
    pInfo->maxbitsize = BITSTREAM_SIZE;
    pInfo->pcmType.sample_frequency = 8000;
    pInfo->pcmType.bitPerSample = G729_BITS_PER_SAMPLE;
    pInfo->params.modes.hpf = 0;
    pInfo->params.modes.pf = 0;
    pInfo->params.law = 0;
    pInfo->nRates = G729IFP_NUM_RATES;
    pInfo->pRateTbl = (const USC_Rates *)&pTblRates_G729IFP;

    return USC_NoError;
}

static USC_Status GetInfo_G729A(USC_Handle handle, USC_CodecInfo *pInfo)
{

    G729_Handle_Header *g729_header;

    pInfo->name = "G729AFP";
    pInfo->framesize = G729_SPEECH_FRAME*sizeof(short);
    if (handle == NULL) {
       pInfo->params.modes.bitrate = 8000;
       pInfo->params.direction = 0;
       pInfo->params.modes.vad = 1;
    } else {
       g729_header = (G729_Handle_Header*)handle;
       pInfo->params.modes.bitrate = g729_header->bitrate;
       pInfo->params.direction = g729_header->direction;
       pInfo->params.modes.vad = g729_header->vad;
    }
    pInfo->params.modes.truncate = 0;
    pInfo->maxbitsize = BITSTREAM_SIZE;
    pInfo->pcmType.sample_frequency = 8000;
    pInfo->pcmType.bitPerSample = G729_BITS_PER_SAMPLE;
    pInfo->params.modes.hpf = 0;
    pInfo->params.modes.pf = 0;
    pInfo->params.law = 0;
    pInfo->nRates = G729AFP_NUM_RATES;
    pInfo->pRateTbl = (const USC_Rates *)&pTblRates_G729AFP;

    return USC_NoError;
}

static USC_Status NumAlloc(const USC_Option *options, int *nbanks)
{
   if(options==NULL) return USC_BadDataPointer;
   if(nbanks==NULL) return USC_BadDataPointer;
   *nbanks = 1;
   return USC_NoError;
}

static USC_Status MemAlloc_G729I(const USC_Option *options, USC_MemBank *pBanks)
{
    unsigned int nbytes;
    int bitrate_idx;

   if(options==NULL) return USC_BadDataPointer;
   if(pBanks==NULL) return USC_BadDataPointer;

    pBanks->pMem = NULL;

    bitrate_idx = CheckRate_G729I(options->modes.bitrate);
    if(bitrate_idx < 0) return USC_UnsupportedBitRate;

    if (options->direction == 0) /* encode only */
    {
        apiG729FPEncoder_Alloc(G729I_CODEC, &nbytes);
    }
    else if (options->direction == 1) /* decode only */
    {
        apiG729FPDecoder_Alloc(G729I_CODEC, &nbytes);
    } else {
        return USC_NoOperation;
    }
    pBanks->nbytes = nbytes + sizeof(G729_Handle_Header); /* include header in handle */
    return USC_NoError;
}

static USC_Status MemAlloc_G729A(const USC_Option *options, USC_MemBank *pBanks)
{
    unsigned int nbytes;
    int bitrate_idx;

   if(options==NULL) return USC_BadDataPointer;
   if(pBanks==NULL) return USC_BadDataPointer;

    pBanks->pMem = NULL;

    bitrate_idx = CheckRate_G729A(options->modes.bitrate);
    if(bitrate_idx < 0) return USC_UnsupportedBitRate;

    if (options->direction == 0) /* encode only */
    {
        apiG729FPEncoder_Alloc((G729Codec_Type)bitrate_idx, &nbytes);
    }
    else if (options->direction == 1) /* decode only */
    {
        apiG729FPDecoder_Alloc((G729Codec_Type)bitrate_idx, &nbytes);
    } else {
        return USC_NoOperation;
    }
    pBanks->nbytes = nbytes + sizeof(G729_Handle_Header); /* include header in handle */
    return USC_NoError;
}

static USC_Status Init_G729I(const USC_Option *options, const USC_MemBank *pBanks, USC_Handle *handle)
{
    G729_Handle_Header *g729_header;
    int bitrate_idx;

   if(options==NULL) return USC_BadDataPointer;
   if(pBanks==NULL) return USC_BadDataPointer;
   if(pBanks->pMem==NULL) return USC_NotInitialized;
   if(pBanks->nbytes<=0) return USC_NotInitialized;
   if(handle==NULL) return USC_InvalidHandler;

    *handle = (USC_Handle*)pBanks->pMem;
    g729_header = (G729_Handle_Header*)*handle;

    bitrate_idx = CheckRate_G729I(options->modes.bitrate);
    if(bitrate_idx < 0) return USC_UnsupportedBitRate;
    g729_header->vad = options->modes.vad;
    g729_header->bitrate = options->modes.bitrate;
    g729_header->direction = options->direction;

    if (options->direction == 0) /* encode only */
    {
        G729FPEncoder_Obj *EncObj = (G729FPEncoder_Obj *)((char*)*handle + sizeof(G729_Handle_Header));
        apiG729FPEncoder_Init((G729FPEncoder_Obj*)EncObj,
        (G729Codec_Type)G729I_CODEC,(G729Encode_Mode)options->modes.vad);
    }
    else if (options->direction == 1) /* decode only */
    {
        G729FPDecoder_Obj *DecObj = (G729FPDecoder_Obj *)((char*)*handle + sizeof(G729_Handle_Header));
        apiG729FPDecoder_Init((G729FPDecoder_Obj*)DecObj, (G729Codec_Type)G729I_CODEC);
    } else {
        return USC_NoOperation;
    }
    return USC_NoError;
}

static USC_Status Init_G729A(const USC_Option *options, const USC_MemBank *pBanks, USC_Handle *handle)
{
    G729_Handle_Header *g729_header;
    int bitrate_idx;

   if(options==NULL) return USC_BadDataPointer;
   if(pBanks==NULL) return USC_BadDataPointer;
   if(pBanks->pMem==NULL) return USC_NotInitialized;
   if(pBanks->nbytes<=0) return USC_NotInitialized;
   if(handle==NULL) return USC_InvalidHandler;

    *handle = (USC_Handle*)pBanks->pMem;
    g729_header = (G729_Handle_Header*)*handle;

    bitrate_idx = CheckRate_G729A(options->modes.bitrate);
    if(bitrate_idx < 0) return USC_UnsupportedBitRate;
    g729_header->vad = options->modes.vad;
    g729_header->bitrate = options->modes.bitrate;
    g729_header->direction = options->direction;

    if (options->direction == 0) /* encode only */
    {
        G729FPEncoder_Obj *EncObj = (G729FPEncoder_Obj *)((char*)*handle + sizeof(G729_Handle_Header));
        apiG729FPEncoder_Init((G729FPEncoder_Obj*)EncObj,
        (G729Codec_Type)bitrate_idx,(G729Encode_Mode)options->modes.vad);
    }
    else if (options->direction == 1) /* decode only */
    {
        G729FPDecoder_Obj *DecObj = (G729FPDecoder_Obj *)((char*)*handle + sizeof(G729_Handle_Header));
        apiG729FPDecoder_Init((G729FPDecoder_Obj*)DecObj, (G729Codec_Type)bitrate_idx);
    } else {
        return USC_NoOperation;
    }
    return USC_NoError;
}

static USC_Status Reinit_G729I(const USC_Modes *modes, USC_Handle handle )
{
    G729_Handle_Header *g729_header;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线国偷精品免费看| 91污在线观看| 91福利视频久久久久| 日韩欧美亚洲一区二区| 中文字幕一区二| 国产精品香蕉一区二区三区| 欧美日韩视频在线一区二区| 一区在线观看免费| 国产一区二三区好的| 欧美一区在线视频| 亚洲国产精品久久久久秋霞影院| 久久久久久免费毛片精品| 日本美女一区二区三区| 日韩精品综合一本久道在线视频| av不卡一区二区三区| 日韩—二三区免费观看av| 欧美精品一区二区三区高清aⅴ | 国产精品美日韩| 香蕉久久一区二区不卡无毒影院| 成人深夜在线观看| 老色鬼精品视频在线观看播放| 成人aa视频在线观看| 久久精品日产第一区二区三区高清版 | 777午夜精品视频在线播放| 亚洲视频网在线直播| jiyouzz国产精品久久| 国产精品久久久一本精品| 国产高清视频一区| 中文字幕免费不卡| 国产成人精品亚洲午夜麻豆| 久久精品一区四区| 国产99一区视频免费| 欧美国产丝袜视频| 成人福利视频网站| 国产精品三级久久久久三级| 成人18视频在线播放| 国产精品超碰97尤物18| 成人午夜免费av| 亚洲女子a中天字幕| 在线欧美一区二区| 亚洲成人资源网| 日韩亚洲欧美成人一区| 另类综合日韩欧美亚洲| 久久久精品一品道一区| 成人激情黄色小说| 亚洲乱码国产乱码精品精小说| 在线观看免费一区| 老司机免费视频一区二区三区| 亚洲精品在线观看视频| 成人免费观看男女羞羞视频| 亚洲男人的天堂在线aⅴ视频| 欧洲精品在线观看| 久久99精品国产.久久久久久| 国产亚洲欧美一级| 在线观看一区二区视频| 美脚の诱脚舐め脚责91| 亚洲国产精品二十页| 欧洲生活片亚洲生活在线观看| 日韩国产精品久久久| 欧美韩国日本不卡| 欧美日韩日日骚| 国产麻豆欧美日韩一区| 亚洲一区在线免费观看| 精品美女被调教视频大全网站| 99在线精品免费| 毛片不卡一区二区| 亚洲美女精品一区| 精品久久久久久久久久久久包黑料 | 欧美中文字幕久久| 韩国av一区二区三区| 亚洲欧美日韩国产综合| 日韩女优毛片在线| 色激情天天射综合网| 国产一区二区在线电影| 午夜精品久久久久久久久久久| 久久久激情视频| 3atv在线一区二区三区| jlzzjlzz国产精品久久| 九色综合国产一区二区三区| 亚洲综合激情另类小说区| 久久精品人人爽人人爽| 日韩一区二区精品在线观看| 91理论电影在线观看| 美女一区二区三区在线观看| 一区二区三区中文字幕在线观看| 久久综合九色综合97_久久久| 日韩欧美一二三四区| 91精品国产高清一区二区三区蜜臀| 国产a级毛片一区| 免费观看成人av| 亚洲国产精品一区二区尤物区| 欧美国产日韩a欧美在线观看| 欧美一区二区三区成人| 欧美性三三影院| 99re在线精品| 国产91精品在线观看| 精品一区二区三区视频 | 国产欧美日韩精品在线| 67194成人在线观看| 在线免费观看不卡av| 99亚偷拍自图区亚洲| 成人毛片老司机大片| 国产精品一区专区| 国产毛片精品视频| 国产精品资源在线| 另类综合日韩欧美亚洲| 日本欧洲一区二区| 五月激情综合婷婷| 亚洲精品欧美二区三区中文字幕| 国产精品成人一区二区艾草| 国产午夜久久久久| 亚洲国产岛国毛片在线| 久久九九久久九九| 久久久久97国产精华液好用吗| 久久先锋影音av鲁色资源网| 久久日一线二线三线suv| 精品国产1区2区3区| 久久综合九色综合97_久久久| 精品日韩一区二区三区免费视频| 久久色在线观看| 国产精品久久久久三级| 综合色天天鬼久久鬼色| 亚洲黄色小说网站| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲午夜三级在线| 美女视频一区二区三区| 国内一区二区视频| 成人福利视频网站| 91国偷自产一区二区开放时间| 色菇凉天天综合网| 欧美一区二区三区系列电影| 久久综合一区二区| 最新国产精品久久精品| 一区二区三区中文在线观看| 青青草一区二区三区| 国产激情偷乱视频一区二区三区| 99国产精品视频免费观看| 在线观看av一区二区| 日韩色在线观看| 中文字幕av资源一区| 亚洲国产精品久久不卡毛片| 久久超碰97人人做人人爱| 成人美女视频在线观看| 欧美老女人在线| 国产精品无圣光一区二区| 亚洲午夜在线视频| 国产精品一区二区三区乱码| 91久久精品网| 精品日产卡一卡二卡麻豆| 亚洲欧美日韩综合aⅴ视频| 日韩黄色在线观看| 国产成人综合精品三级| 欧美日韩视频在线一区二区| 国产欧美精品一区二区色综合朱莉| 亚洲女爱视频在线| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产在线视频不卡二| 欧美午夜精品免费| 国产精品你懂的在线欣赏| 国产精品久久久久影院| 日韩伦理免费电影| 久久不见久久见中文字幕免费| www.欧美日韩国产在线| 欧美电影影音先锋| 亚洲女同一区二区| 久久精品国产99国产| 在线精品亚洲一区二区不卡| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲少妇屁股交4| 成人午夜碰碰视频| 精品福利一二区| 日韩中文字幕亚洲一区二区va在线| 成人精品国产免费网站| 精品久久国产97色综合| 天天做天天摸天天爽国产一区| 成a人片国产精品| 久久久久国产精品免费免费搜索| 日日夜夜免费精品视频| 在线视频观看一区| 一区二区三区中文免费| 北岛玲一区二区三区四区| 久久理论电影网| 国产又粗又猛又爽又黄91精品| 7777精品伊人久久久大香线蕉完整版 | 在线国产电影不卡| 国产丝袜美腿一区二区三区| 日韩av中文字幕一区二区三区| 91成人国产精品| 亚洲精品欧美在线| 99精品欧美一区| 亚洲色大成网站www久久九九| 成人sese在线| 自拍偷拍亚洲欧美日韩| 国产精品99久久久久久似苏梦涵| 欧美成人在线直播| 国内外成人在线视频| 国产午夜一区二区三区| 国产91精品一区二区麻豆亚洲| 国产欧美视频一区二区三区| 国产精品一二三在|