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

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

?? vadout.c

?? Intel開發的IPP庫的應用實例
?? 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) 2002-2006 Intel Corporation. All Rights Reserved.
//
//  Intel(R) Integrated Performance Primitives Audio Processing
//  Sample for Windows*
//
//  By downloading and installing this sample, 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 ippEULA.rtf located in the root directory of your Intel(R) IPP
//  product installation for more information.
//
//  Description:
//  This source file is part of example code and contains the output buffer/file
//  operations for the Voice Activity Detector. The output PCM data constains the actual
//  speech samples wherever voice activity is detected but zeroed out samples in detected
//  "silence-regions". However, there is an inherent latency in the output
//  due to the delayed utterance start/end decisions of the implemented VAD algorithm.
//  Hence the output data is held in a buffer until such a decision is indicated by the VAD
//  state machine.
//
*/

/* headers */
#include <stdio.h>
#include <ipps.h>
#include "VADout.h"

//#define CHOP_SILENCE 1 /* chop the silence frames instead of the default zeroing the data */

/********************************************************************************
// Name:             OUT_Init
// Description:      Initialize the output buffer
//
// Input Arguments:
//                   len     - the length of the output circular buffer
// Input/Output Arguments:
//                   pOutBuf - pointer to the structure containing the output circular
//                             buffer that has to be initialized.
// Returns:          None
// Notes:
********************************************************************************/
void OUT_Init(int len, CircBufStruct16s* pOutBuf)
{
    pOutBuf->headIdx = 0;
    pOutBuf->tailIdx = -1;
    pOutBuf->len = len;
}

/********************************************************************************
// Name:             OUT_AppendSamples
// Description:      Save the input buffer of data in the output circular buffer for writing
//                   to the output file when a VAD decision is made.
//
// Input Arguments:
//                   pBuf    - pointer to input buffer
//                   len     - the length in samples of the input buffer
// Input/Output Arguments:
//                   pOutBuf - pointer to the output circular buffer
//
// Returns:          None
// Notes:
********************************************************************************/
void OUT_AppendSamples(Ipp16s* pBuf,int len, CircBufStruct16s* pOutBuf)
{
    if (len > 0)
    {
        /* find the location in the output buffer where the input buffer needs to be saved */
        if ( pOutBuf->tailIdx >= (pOutBuf->len - 1))
        {
            pOutBuf->tailIdx = -1;
        }
        ippsCopy_16s(pBuf,&(pOutBuf->pBuf[pOutBuf->tailIdx+1]),len);
        pOutBuf->tailIdx += len; /* new tailIdx location in buffer */
    }

}

/********************************************************************************
// Name:             OUT_ConditionalFlushBuffer
// Description:      Write the data in the output buffer to the binary output  file based on the state
//                   of the VAD decision. See additional description in Arguments/curDecisionState section.
//
// Input Arguments:
//                   decisionSampNum- absolute sample number where either the start/end
//                                    of utterance has been detected. (-1) otherwise.
//                   curDecisionState- indicates the state of the VAD decision. It can have one
//                                     of the following values -
//                      1) ACTIVE        - utterance start has been detected.
//                                         Flush out the entire output buffer except the
//                                         last frame (lookahead frame). All samples before
//                                         the decisionSampNum are zeroed (for silence). All samples
//                                         after the decisionSampNum (including decisionSampNum) are written
//                                         as-is to the output file.
//
//                      2) INACTIVE      - utterance end has been detected.
//                                         Flush out the entire output buffer except the
//                                         last frame (lookahead frame). All samples before
//                                         the decisionSampNum are written as-is to the output file.
//                                         All samples after the decisionSampNum (including decisionSampNum)
//                                         are zeroed out (silence) before being written to output.
//
//                      3) NODECISION    - no decision has been made w.r.t start/end of utterance.
//                                         If the output buffer is full, one frame of data is
//                                         written to the output to make space for the next input
//                                         frame. The data written out depends on the previous
//                                         state (pPrevDecisionState) of the VAD decision. If it was
//                                         ACTIVE, the frame is written as-is to the output. If
//                                         it was INACTIVE, the frame is zeroed out before being written
//                                         to the output.
//
//                      4) END_OF_STREAM - input data has ended.
//                                         All the remaining data in the output buffer is written to
//                                         the output file based on the previous
//                                         state (pPrevDecisionState) of the VAD decision. If it was
//                                         ACTIVE, all data is written as-is to the output. If
//                                         it was INACTIVE, all data is zeroed out before being written
//                                         to the output.
//                   cLookAheadSamps     - the size in samples of the lookahead data
// Input/Output Arguments:
//                   pOutBuf - pointer the structure containing the output circular buffer
//                   pPrevDecisionState- pointer to the previous state of the VAD decision (ACTIVE/INACTIVE).
//                                       Its value is updated only if the current curDecisionState is either
//                                       ACTIVE/INACTIVE.
// Output Arguments:
//                   pOutputPCMFile - file pointer of the output file
//
// Returns:          None
// Notes:
********************************************************************************/
#ifdef CHOP_SILENCE

void OUT_ConditionalFlushBuffer(
  CircBufStruct16s*   pOutBuf,
  int                 decisionSampNum,
  VADDecisionState    curDecisionState,
  VADDecisionState*   pPrevDecisionState,
  int                 cLookAheadSamps,
  FILE*               pOutputPCMFile)
{
    int  sampIdx;                         /* the sample position in the output circular buffer */
    int  k1, k2, k3;                      /* position in output buffer for next write operation */
    int  numSamps1, numSamps2, numSamps3; /* number of samples that have to written out*/
    int  cSampsWritten;                   /* return of fwrite call */
    int  tmpDiff;                         /* temporary variable */

    /* find the sample position of the start/end sample of the utterance in the circular buffer */
    sampIdx = decisionSampNum % pOutBuf->len;

    switch (curDecisionState)
    {
        case ACTIVE:
            /* Flush out all but the last buffer with the appropriate decision logic */

            /* update the value of previous decision state */
            *pPrevDecisionState = curDecisionState;

            if (sampIdx < pOutBuf->headIdx)
            {
                /* Circular buffer wrapped around. Index positions (sampIdx < tailIdx < headIdx) */
                k3 = sampIdx;
                numSamps3 = (pOutBuf->tailIdx - cLookAheadSamps) - sampIdx + 1;
                cSampsWritten = fwrite(&(pOutBuf->pBuf[k3]), sizeof(Ipp16s), numSamps3, pOutputPCMFile);
            }
            else
            {
                /* Circular buffer pointer positions are (headIdx < sampIdx) */
                k2 = sampIdx;
                if (pOutBuf->tailIdx < pOutBuf->headIdx)
                {
                    /* Circular buffer wrapped around. Index positions are (tailIdx < headIdx < sampIdx) */
                    numSamps2 = pOutBuf->len - sampIdx;
                    cSampsWritten = fwrite(&(pOutBuf->pBuf[k2]), sizeof(Ipp16s), numSamps2, pOutputPCMFile);

                    k3 = 0;
                    numSamps3 = (pOutBuf->tailIdx - cLookAheadSamps) + 1;
                    cSampsWritten = fwrite(&(pOutBuf->pBuf[k3]), sizeof(Ipp16s), numSamps3, pOutputPCMFile);
                }
                else
                {
                    /* Circular buffer pointer positions are (headIdx < sampIdx < tailIdx) */
                    numSamps2 = (pOutBuf->tailIdx - cLookAheadSamps) - sampIdx + 1;
                    cSampsWritten = fwrite(&(pOutBuf->pBuf[k2]), sizeof(Ipp16s), numSamps2, pOutputPCMFile);
                }
            }
            /* reset the headIdx after data has been flushed out */
            pOutBuf->headIdx = (pOutBuf->tailIdx - cLookAheadSamps) + 1;

            break;

        case INACTIVE:
            /* Flush out all but the last buffer with the appropriate decision logic */

            /* update the value of previous decision state */
            *pPrevDecisionState = curDecisionState;

            if (sampIdx < pOutBuf->headIdx)
            {
                /* Circular buffer wrapped around. Index positions (sampIdx < tailIdx < headIdx) */
                k1 = pOutBuf->headIdx;
                numSamps1 = (pOutBuf->len - pOutBuf->headIdx);
                cSampsWritten = fwrite(&(pOutBuf->pBuf[k1]), sizeof(Ipp16s), numSamps1, pOutputPCMFile);

                k2 = 0;
                numSamps2 = sampIdx;
                cSampsWritten = fwrite(&(pOutBuf->pBuf[k2]), sizeof(Ipp16s), numSamps2, pOutputPCMFile);
            }
            else
            {
                /* Circular buffer pointer positions are (headIdx < sampIdx) */
                k1 = pOutBuf->headIdx;
                numSamps1 = (sampIdx - pOutBuf->headIdx);
                cSampsWritten = fwrite(&(pOutBuf->pBuf[k1]), sizeof(Ipp16s), numSamps1, pOutputPCMFile);
            }
            /* reset the headIdx after data has been flushed out */
            pOutBuf->headIdx = (pOutBuf->tailIdx - cLookAheadSamps) + 1;

            break;

        case NODECISION:
            /* If the output buffer is full flush out one frame to make space for the next input frame */

            tmpDiff = pOutBuf->tailIdx - pOutBuf->headIdx;
            if ( (-1 == tmpDiff)  || ((pOutBuf->len - 1) == tmpDiff) )
            {
                /* buffer full, so flush one buffer to make room for the next buffer*/
                k1 = pOutBuf->headIdx;
                numSamps1 = cLookAheadSamps;
                if (ACTIVE == *pPrevDecisionState)
                {
                    cSampsWritten = fwrite(&(pOutBuf->pBuf[k1]), sizeof(Ipp16s), numSamps1, pOutputPCMFile);
                }
                /* adjust the head pointer */
                pOutBuf->headIdx += cLookAheadSamps;
                if (pOutBuf->headIdx >= pOutBuf->len)
                {
                    pOutBuf->headIdx = 0;
                }
            }
            break;

        case END_OF_STREAM:
            /* flush out all remaining data in output buffer since the input stream has ended */
            if (pOutBuf->tailIdx < pOutBuf->headIdx)
            {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日av在线不卡| 国产精品剧情在线亚洲| 欧美激情一区二区三区不卡| 蜜桃视频在线一区| 91精品在线观看入口| 亚洲.国产.中文慕字在线| 欧美在线高清视频| 亚洲精品视频一区| 在线视频国内自拍亚洲视频| 亚洲裸体xxx| 欧美在线综合视频| 亚洲一区二区在线视频| 日本韩国精品一区二区在线观看| 亚洲啪啪综合av一区二区三区| 91色.com| 日韩二区在线观看| 日韩欧美电影在线| 国产成人免费网站| 国产精品天美传媒| 99视频精品免费视频| 国产精品福利电影一区二区三区四区| 国产精品18久久久久久久久 | 免费看日韩a级影片| 欧美一区2区视频在线观看| 亚洲成人综合网站| 欧美日韩免费观看一区二区三区| 天堂一区二区在线| 久久精品视频在线看| av影院午夜一区| 亚洲综合精品久久| 777奇米四色成人影色区| 国产综合久久久久久鬼色| 国产免费观看久久| 91麻豆福利精品推荐| 日韩精品免费视频人成| 国产喷白浆一区二区三区| 色婷婷av一区二区三区大白胸| 午夜精品一区在线观看| 精品伦理精品一区| 一本色道亚洲精品aⅴ| 日本特黄久久久高潮| 欧美日韩国产一级片| 裸体一区二区三区| 亚洲视频狠狠干| 精品国产免费久久| 日本高清不卡视频| 久久99蜜桃精品| 亚洲婷婷在线视频| 精品国产一区a| 91久久免费观看| 国产麻豆91精品| 五月天亚洲婷婷| 成人欧美一区二区三区小说 | 精品美女在线观看| 91小视频免费看| 国产又粗又猛又爽又黄91精品| 自拍视频在线观看一区二区| 欧美mv日韩mv亚洲| 在线视频综合导航| 国精产品一区一区三区mba桃花 | 欧美精品v国产精品v日韩精品| 国产老肥熟一区二区三区| 亚洲成国产人片在线观看| 久久精品网站免费观看| 91精品国产综合久久福利软件| 成人激情av网| 国产乱码精品一区二区三区av| 午夜成人在线视频| 日韩美女视频一区| 久久精品人人做人人爽人人| 欧美一区二区免费观在线| 色哦色哦哦色天天综合| 成人国产精品免费| 国产乱码精品一区二区三区忘忧草 | 国产欧美日本一区二区三区| 色视频成人在线观看免| 精一区二区三区| 日韩精品成人一区二区三区 | 日韩免费视频一区| 欧美日韩免费视频| 成人av网址在线| 国产成人免费视频网站高清观看视频| 偷窥少妇高潮呻吟av久久免费| 亚洲精品国产无天堂网2021| 欧美国产精品一区| 久久精品无码一区二区三区| 久久先锋影音av鲁色资源| 日韩三级视频在线观看| 欧美视频日韩视频在线观看| 91黄色在线观看| 中文字幕的久久| 日韩三级视频在线观看| 91精品国产欧美日韩| 欧美日韩极品在线观看一区| 91久久精品一区二区三| 色综合久久久久久久久久久| 99re亚洲国产精品| 99国产精品久久久久久久久久久 | 亚洲第一福利视频在线| 一区二区在线看| 国产精品久久久久久久浪潮网站| 欧美激情一区二区三区在线| 1000部国产精品成人观看| 国产精品福利一区二区三区| 亚洲欧美中日韩| 亚洲免费在线看| 亚洲网友自拍偷拍| 肉肉av福利一精品导航| 视频一区在线播放| 另类小说综合欧美亚洲| 老鸭窝一区二区久久精品| 激情av综合网| 成人动漫视频在线| 日本伦理一区二区| 欧美高清视频在线高清观看mv色露露十八 | 五月天亚洲精品| 久久99这里只有精品| 粗大黑人巨茎大战欧美成人| 91免费视频网址| 欧美日韩国产首页在线观看| 91激情在线视频| 欧美片在线播放| 精品国产乱码91久久久久久网站| 国产视频一区二区在线| 一区二区三区四区亚洲| 亚洲午夜电影在线| 日韩精品亚洲专区| 国产成人精品在线看| 欧美日韩一二三| 国产日本一区二区| 午夜精品免费在线| 国产美女精品在线| 成人午夜视频网站| 色综合av在线| 日韩欧美国产午夜精品| 国产精品黄色在线观看| 视频一区视频二区中文| 风流少妇一区二区| 在线播放亚洲一区| 国产精品第四页| 久久99日本精品| 欧美自拍丝袜亚洲| 国产日韩高清在线| 日韩专区在线视频| 国产91露脸合集magnet| 91黄色免费看| 国产欧美日韩视频在线观看| 日韩国产欧美三级| 91色九色蝌蚪| 国产午夜精品久久久久久免费视| 视频一区二区不卡| 色哟哟国产精品| 欧美极品xxx| 青草国产精品久久久久久| 欧美三级电影网| 亚洲国产日日夜夜| 在线观看国产日韩| 亚洲免费av高清| 欧洲一区在线电影| 一区二区三区四区蜜桃| 在线视频你懂得一区二区三区| 亚洲人吸女人奶水| 91丨九色丨蝌蚪富婆spa| 国产精品三级在线观看| av亚洲精华国产精华精| 亚洲天堂av一区| 色婷婷av一区二区三区gif| 亚洲综合色丁香婷婷六月图片| 色悠久久久久综合欧美99| 亚洲蜜臀av乱码久久精品蜜桃| 色视频成人在线观看免| 亚洲二区视频在线| 欧美电影一区二区三区| 日本成人超碰在线观看| 精品国产一区二区亚洲人成毛片| 狠狠色丁香久久婷婷综合丁香| 欧美不卡一区二区| 国产精品一线二线三线| 国产精品久久久久久久久免费丝袜 | 欧美福利一区二区| 欧美a一区二区| 久久精子c满五个校花| 成人午夜在线播放| 亚洲男人的天堂av| 欧美日韩精品二区第二页| 美女视频免费一区| 亚洲国产成人一区二区三区| 99视频在线精品| 天天操天天干天天综合网| 日韩一区二区视频| 国产成+人+日韩+欧美+亚洲| 亚洲精品中文字幕在线观看| 欧美丰满美乳xxx高潮www| 国产精品综合二区| 亚洲摸摸操操av| 日韩欧美成人激情| 成人亚洲精品久久久久软件| 亚洲宅男天堂在线观看无病毒| 日韩一区二区三区av| 成人aaaa免费全部观看|