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

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

?? encg722.c

?? G.711,G.723.1,G.726,G.729,GSM CODEC C/C++ code
?? C
字號:
/*/////////////////////////////////////////////////////////////////////////////
//
//                  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) 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.722.1 speech codec: encoder own functions.
//
*/

#include "owng722.h"

static __ALIGN32 CONST Ipp16u cnstDiffRegionPowerCodes_G722[REG_NUM][DIFF_REG_POW_LEVELS] = {
{
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
{
   8,38,18,10, 7, 6, 3, 2, 0, 1, 7, 6, 5, 4,11,78,158,318,1278,1279,2552,2553,2554,2555
},
{
   36, 8, 3, 5, 0, 1, 7, 6, 4, 3, 2, 5, 3, 4, 5,19,74,150,302,1213,1214,1215,2424,2425
},
{
   2582,644,160,41, 5,11, 7, 5, 4, 1, 0, 6, 4, 7, 3, 6, 4,21,81,323,1290,5167,10332,10333
},
{
   2940,366,181,180,47,46,27,10, 8, 5, 1, 0, 3, 7, 4, 9,12,26,44,182,734,2941,2942,2943
},
{
   3982,7967,994,249,63,26,19,18,14, 8, 6, 1, 0, 2, 5, 7,12,30,27,125,496,1990,15932,15933
},
{
   3254,1626,407,206,202,100,30,14, 3, 5, 3, 0, 2, 4, 2,13,24,31,102,207,812,6511,13020,13021
},
{
   1110,2216,1111,139,35, 9, 3,20,11, 4, 2, 1, 3, 3, 1, 0,21, 5,16,68,276,2217,2218,2219
},
{
   1013,1014,127,62,29, 6, 4,16, 0, 1, 3, 2, 3, 1, 5, 9,17, 5,28,30,252,1015,2024,2025
},
{
   381,380,372,191,94,44,16,10, 7, 3, 1, 0, 2, 6, 9,17,45,92,187,746,1494,2991,5980,5981
},
{
   3036,758,188,45,43,10, 4, 3, 6, 4, 2, 0, 3, 7,11,20,42,44,46,95,378,3037,3038,3039
},
{
   751,92,45,20,26, 4,12, 7, 4, 0, 4, 1, 3, 5, 5, 3,27,21,44,47,186,374,1500,1501
},
{
   45572U,5697,2849,1425,357,45,23, 6,10, 7, 2, 2, 3, 0, 4, 6, 7,88,179,713,11392,45573U,45574U,45575U
},
{
   2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021
}};


void EncodeFrame(Ipp16s bitFrameSize, Ipp16s* pMlt, Ipp16s scale, Ipp16s *pDst){
   Ipp16s nBitsAvailable, nBitsEnvelope;
   Ipp16s ctgCtrl;
   Ipp16s i, n;
   Ipp16s absRegPowerIndices[REG_NUM];
   Ipp16s powerCategories[REG_NUM];
   Ipp16s categoryBalances[CAT_CONTROL_MAX-1];
   Ipp16s drpNumBits[REG_NUM+1];
   Ipp16u drpCodeBits[REG_NUM+1];
   Ipp32s regMltBitCounts[REG_NUM];
   Ipp32u regMltBits[4*REG_NUM];
   Ipp16s offset;

   nBitsAvailable = bitFrameSize;
   for (i=0; i<REG_NUM; i++)
      regMltBitCounts[i] = 0;
   nBitsEnvelope = GetFrameRegionsPowers(pMlt, scale,
      drpNumBits, drpCodeBits, absRegPowerIndices);
   nBitsAvailable -= nBitsEnvelope + CAT_CONTROL_BITS;
   CategorizeFrame(nBitsAvailable, absRegPowerIndices,
      powerCategories, categoryBalances);
   offset = 2 * scale + REG_POW_TABLE_NUM_NEGATIVES;
   for (i=0; i<REG_NUM; i++) {
      absRegPowerIndices[i] += offset;
      n = absRegPowerIndices[i] - 39;
      n >>= 1;
      if (n > 0){
         ippsRShiftC_16s_I(n, &pMlt[i * REG_SIZE], REG_SIZE);
         absRegPowerIndices[i] -= 2*n;
      }
   }
   MltQquantization(nBitsAvailable, pMlt, absRegPowerIndices,
      powerCategories, categoryBalances, &ctgCtrl,
      regMltBitCounts, regMltBits);
   ExpandBitsToWords(regMltBits, regMltBitCounts, drpNumBits,
      drpCodeBits, pDst, ctgCtrl, bitFrameSize);
}


void ExpandBitsToWords(Ipp32u *pRegMltBits, Ipp32s *pRegMltBitCounts,
         Ipp16s *pDrpNumBits, Ipp16u *pDrpCodeBits, Ipp16s *pDst,
         Ipp16s ctgCtrl, Ipp16s bitFrameSize){
   Ipp16s j, regNum, regBitCount;
   Ipp16s word, slice, outIndex = 0;
   Ipp16s nLeftBits, nFreeBits = 16;
   Ipp32u *pSrcWord, curWord;

   word = 0;
   pDrpNumBits[REG_NUM] = CAT_CONTROL_BITS;
   pDrpCodeBits[REG_NUM] = (Ipp16u)ctgCtrl;
   for (regNum=0; regNum<=REG_NUM; regNum++) {
      nLeftBits = pDrpNumBits[regNum];
      curWord = (Ipp32u)pDrpCodeBits[regNum];
      j = nLeftBits - nFreeBits;
      if (j >= 0) {
         word += curWord >> j;
         pDst[outIndex++] = word;
         nFreeBits = 16 - j;
         word = (Ipp16s)(curWord << nFreeBits);
      } else {
         word += (curWord << (-j));
         nFreeBits -= nLeftBits;
      }
   }
   for (regNum=0; regNum<REG_NUM; regNum++){
      if((outIndex<<4) < bitFrameSize){
         pSrcWord = &pRegMltBits[regNum<<2];
         regBitCount = pRegMltBitCounts[regNum];
         if(32 > regBitCount)
            nLeftBits = regBitCount;
         else
            nLeftBits = 32;
         curWord = *pSrcWord++;
         while ((regBitCount>0) && ((outIndex<<4)<bitFrameSize)){
            if (nLeftBits >= nFreeBits){
               slice = curWord >> (32 - nFreeBits);
               word += slice;
               curWord <<= nFreeBits;
               nLeftBits -= nFreeBits;
               pDst[outIndex++] = word;
               word = 0;
               nFreeBits = 16;
            } else {
               slice = curWord >> (32 - nLeftBits);
               word += slice << (nFreeBits - nLeftBits);
               nFreeBits -= nLeftBits;
               nLeftBits = 0;
            }
            if (nLeftBits == 0){
               curWord = *pSrcWord++;
               regBitCount -= 32;
               if(32 > regBitCount)
                  nLeftBits = regBitCount;
               else
                  nLeftBits = 32;
            }
         }
      }
   }
   while ((outIndex<<4) < bitFrameSize) {
      curWord = 0x0000ffff;
      slice = (Ipp16u)(curWord >> (16 - nFreeBits));
      word += slice;
      pDst[outIndex++] = word;
      word = 0;
      nFreeBits = 16;
   }
}


Ipp16s GetFrameRegionsPowers(Ipp16s *pSrcMlt, Ipp16s scale,
         Ipp16s *pDrpNumBits, Ipp16u *pDrpCodeBits, Ipp16s *pRegPowerIndices){
   Ipp16s* pSrc;
   int regPower;
   Ipp16s powerScale;
   Ipp16s i, j;
   Ipp16s diffRegionPowerIdx[REG_NUM];
   Ipp16s nBits;
   pSrc = pSrcMlt;
   for (i=0; i<REG_NUM; i++, pSrc+=REG_SIZE){
      ippsDotProd_16s32s_Sfs(pSrc, pSrc, REG_SIZE, &regPower, 0);
      powerScale = 0;
      while (regPower > 32767) {
         regPower >>= 1;
         powerScale++;
      }
      while ((regPower <= 32767) && (powerScale >= -15)){
         regPower <<= 1;
         powerScale--;
      }
      regPower >>= 1;
      if (regPower >= 28963) powerScale++; /* 28963 is square root of 2 times REG_SIZE(20). */
      pRegPowerIndices[i] = powerScale - (scale<<1) + 35 - REG_POW_TABLE_NUM_NEGATIVES;
   }
   for (i = REG_NUM-2; i >= 0; i--){
      if (pRegPowerIndices[i] < pRegPowerIndices[i+1] - DRP_DIFF_MAX)
         pRegPowerIndices[i] = pRegPowerIndices[i+1] - DRP_DIFF_MAX;
   }
   /* Adjust the mlts */
   if (pRegPowerIndices[0] < 1-ESF_ADJUSTMENT_TO_RMS_INDEX)
      pRegPowerIndices[0] = 1-ESF_ADJUSTMENT_TO_RMS_INDEX;
   if (pRegPowerIndices[0] > 31-ESF_ADJUSTMENT_TO_RMS_INDEX)
      pRegPowerIndices[0] = 31-ESF_ADJUSTMENT_TO_RMS_INDEX;
   diffRegionPowerIdx[0] = pRegPowerIndices[0];
   nBits = 5;
   pDrpNumBits[0] = 5;
   pDrpCodeBits[0] = (Ipp16u)(pRegPowerIndices[0] + ESF_ADJUSTMENT_TO_RMS_INDEX);
   for (i=1; i<REG_NUM; i++){
      if (pRegPowerIndices[i] < -8 - ESF_ADJUSTMENT_TO_RMS_INDEX)
         pRegPowerIndices[i] = -8 - ESF_ADJUSTMENT_TO_RMS_INDEX;
      if (pRegPowerIndices[i] > 31 - ESF_ADJUSTMENT_TO_RMS_INDEX)
         pRegPowerIndices[i] = 31 - ESF_ADJUSTMENT_TO_RMS_INDEX;
   }
   for (i=1; i<REG_NUM; i++){
      j = pRegPowerIndices[i] - pRegPowerIndices[i-1] - DRP_DIFF_MIN;
      if (j < 0) j = 0;
      diffRegionPowerIdx[i] = j;
      pRegPowerIndices[i] = pRegPowerIndices[i-1] + diffRegionPowerIdx[i] + DRP_DIFF_MIN;
      nBits += cnstDiffRegionPowerBits_G722[i][j];
      pDrpNumBits[i] = cnstDiffRegionPowerBits_G722[i][j];
      pDrpCodeBits[i] = cnstDiffRegionPowerCodes_G722[i][j];
   }
   return (nBits);
}


void MltQquantization(Ipp16s nBitsAvailable, Ipp16s* pMlt,Ipp16s* pRegPowerIndices,
         Ipp16s* pPowerCtgs, Ipp16s* pCatBalances, Ipp16s* pCtgCtrl,
         int* pRegMltBitCounts, Ipp32u* pRegMltBits){
   Ipp16s *pRegMlt;
   Ipp16s regNum, catNum;
   Ipp16s totalMltBits = 0;

   for (*pCtgCtrl = 0; *pCtgCtrl < (CAT_CONTROL_NUM/2)-1; (*pCtgCtrl)++){
      regNum = pCatBalances[*pCtgCtrl];
      pPowerCtgs[regNum]++;
   }
   for (regNum=0; regNum<REG_NUM; regNum++){
      catNum = pPowerCtgs[regNum];
      pRegMlt = &pMlt[regNum*REG_SIZE];
      if (catNum < NUM_CATEGORIES-1)
         ippsHuffmanEncode_G722_16s32u(catNum, pRegPowerIndices[regNum], pRegMlt,
            &pRegMltBits[regNum<<2], &pRegMltBitCounts[regNum]);
      else
         pRegMltBitCounts[regNum] = 0;
      totalMltBits += pRegMltBitCounts[regNum];
   }

   while ((totalMltBits<nBitsAvailable) && (*pCtgCtrl>0)){ /* few bits */
      (*pCtgCtrl)--;
      regNum = pCatBalances[*pCtgCtrl];
      pPowerCtgs[regNum]--;
      totalMltBits -= pRegMltBitCounts[regNum];
      catNum = pPowerCtgs[regNum];
      pRegMlt = &pMlt[regNum*REG_SIZE];
      if (catNum < NUM_CATEGORIES-1)
         ippsHuffmanEncode_G722_16s32u(catNum, pRegPowerIndices[regNum], pRegMlt,
            &pRegMltBits[regNum<<2], &pRegMltBitCounts[regNum]);
      else
         pRegMltBitCounts[regNum] = 0;
      totalMltBits += pRegMltBitCounts[regNum];
   }

   while ((totalMltBits>nBitsAvailable) && (*pCtgCtrl<CAT_CONTROL_NUM-1)){ /* many bits */
      regNum = pCatBalances[*pCtgCtrl];
      pPowerCtgs[regNum]++;
      totalMltBits -= pRegMltBitCounts[regNum];
      catNum = pPowerCtgs[regNum];
      pRegMlt = &pMlt[regNum*REG_SIZE];
      if (catNum < NUM_CATEGORIES-1)
         ippsHuffmanEncode_G722_16s32u(catNum, pRegPowerIndices[regNum], pRegMlt,
            &pRegMltBits[regNum<<2], &pRegMltBitCounts[regNum]);
      else
         pRegMltBitCounts[regNum] = 0;
      totalMltBits += pRegMltBitCounts[regNum];
      (*pCtgCtrl)++;
   }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产日韩一二三区| 粉嫩绯色av一区二区在线观看 | 久久综合999| 国模娜娜一区二区三区| 日韩丝袜情趣美女图片| 亚洲午夜精品网| 69堂国产成人免费视频| 日本成人在线不卡视频| 欧美成人高清电影在线| 精品亚洲国产成人av制服丝袜| 日韩免费观看2025年上映的电影| 蜜桃免费网站一区二区三区| 久久婷婷综合激情| 色婷婷一区二区三区四区| 婷婷综合五月天| 精品国产3级a| 色八戒一区二区三区| 激情小说亚洲一区| 国产日韩亚洲欧美综合| 欧美日韩一区二区欧美激情 | 欧美一级高清片| 国产一区二区伦理| 亚洲v日本v欧美v久久精品| 亚洲一区影音先锋| 欧美成人免费网站| 91美女蜜桃在线| 免费观看久久久4p| 最新不卡av在线| 日韩视频在线观看一区二区| 99久久国产综合精品色伊| 韩国三级中文字幕hd久久精品| 亚洲免费av观看| 国产精品每日更新在线播放网址| 日韩免费高清视频| 欧美久久婷婷综合色| 成人激情开心网| 国精品**一区二区三区在线蜜桃| 午夜成人在线视频| 亚洲综合久久久| 亚洲欧美另类综合偷拍| 中文字幕不卡三区| 中文字幕av资源一区| 日韩一区二区在线观看视频播放| 欧美色图12p| 欧美色男人天堂| 欧美肥妇bbw| 日韩三级精品电影久久久 | 日韩女优毛片在线| 欧美一级免费大片| 日韩一卡二卡三卡| 日韩免费看网站| 久久久精品tv| 最新不卡av在线| 一区二区三区四区高清精品免费观看 | 欧美日韩日本视频| 91精品福利在线一区二区三区| 4438x成人网最大色成网站| 欧美裸体一区二区三区| 精品国精品自拍自在线| 国产精品久久久久久久久搜平片| 国产日产欧美一区二区视频| 亚洲欧洲日本在线| 午夜精品一区二区三区免费视频| 人人爽香蕉精品| 国产精品系列在线播放| 波多野结衣在线aⅴ中文字幕不卡| 91亚洲精品一区二区乱码| 欧美专区亚洲专区| 久久久久成人黄色影片| 一区二区三区欧美| 美洲天堂一区二卡三卡四卡视频| 国产麻豆精品theporn| 欧美日韩免费不卡视频一区二区三区| 欧美一区二区视频在线观看2020 | 成人美女视频在线观看18| 色呦呦国产精品| 国产校园另类小说区| 午夜精品福利在线| 99久精品国产| 91精品综合久久久久久| 亚洲码国产岛国毛片在线| 国产精品18久久久久久vr| 欧美日韩一区二区三区四区五区| 中文字幕不卡的av| 成人夜色视频网站在线观看| 欧美精品一区二区不卡| 成人黄色免费短视频| 久久女同精品一区二区| 美美哒免费高清在线观看视频一区二区| 日本韩国欧美国产| 欧美高清在线视频| 不卡视频在线观看| 中文字幕一区二区三区在线播放 | 91麻豆成人久久精品二区三区| 久久亚洲精品小早川怜子| 久久精品国产一区二区三 | 91丝袜美腿高跟国产极品老师 | 蜜桃视频在线观看一区二区| 日韩一区二区三区视频在线 | 欧美tk—视频vk| 狠狠v欧美v日韩v亚洲ⅴ| 日韩欧美成人一区| 国产aⅴ精品一区二区三区色成熟| 精品国产3级a| 不卡区在线中文字幕| 亚洲男人天堂av网| 在线观看视频91| 国产乱国产乱300精品| 国产精品沙发午睡系列990531| av高清不卡在线| 一区二区三区在线播放| 欧美xxxxxxxx| 国产**成人网毛片九色| 亚洲国产视频在线| www国产成人| 欧美日韩一卡二卡| 国产一区二区三区蝌蚪| 中文字幕一区二区在线观看| 欧美一卡二卡在线观看| 粉嫩av一区二区三区| 蜜臀av一区二区| 亚洲综合久久久| 亚洲国产精品国自产拍av| 911国产精品| av电影在线观看完整版一区二区| 奇米影视一区二区三区| 亚洲一区在线电影| 中文字幕一区免费在线观看| 日韩一卡二卡三卡| 欧美日韩免费观看一区二区三区| 国产成人在线视频网站| 美女精品自拍一二三四| 亚洲高清免费观看高清完整版在线观看| 精品国产乱码久久久久久免费| 91黄色免费看| 91国在线观看| 欧美日韩一区国产| 色偷偷88欧美精品久久久| 成人黄动漫网站免费app| 成人黄色电影在线| av影院午夜一区| 91网页版在线| 欧美丝袜丝交足nylons| 91日韩一区二区三区| jiyouzz国产精品久久| 国产成人免费视频精品含羞草妖精| 日本aⅴ亚洲精品中文乱码| 不卡的av网站| 色婷婷久久久综合中文字幕| 91麻豆成人久久精品二区三区| 欧美视频在线一区| 日韩欧美国产不卡| 国产亚洲污的网站| 国产精品久久综合| 日韩影视精彩在线| 免费三级欧美电影| 国产成人免费高清| 91福利视频久久久久| 日韩欧美国产系列| 久久精品网站免费观看| 亚洲免费在线观看| 日本成人在线电影网| 国产成人免费视频网站| 欧美性一级生活| 久久影院视频免费| 亚洲国产精品久久艾草纯爱 | 懂色av一区二区夜夜嗨| 在线观看91视频| 久久久99免费| 日韩综合小视频| 本田岬高潮一区二区三区| 日韩一区二区在线观看| 国产精品免费视频一区| 日本午夜精品视频在线观看 | 午夜久久久久久电影| 99久久久精品免费观看国产蜜| 欧美三区免费完整视频在线观看| 久久久久9999亚洲精品| 日韩国产在线观看一区| av网站一区二区三区| 国产亲近乱来精品视频| 麻豆国产精品777777在线| 欧美日本一区二区| 亚洲国产精品人人做人人爽| 91美女片黄在线观看91美女| 亚洲国产精品99久久久久久久久| 狠狠狠色丁香婷婷综合激情 | 9191成人精品久久| 日日噜噜夜夜狠狠视频欧美人 | 亚洲免费观看视频| 成年人国产精品| 国产精品成人在线观看| 成人黄色在线网站| 日本一二三不卡| 成人午夜视频网站| 欧美日韩另类一区| 精品欧美久久久| 国产精品99久久不卡二区| 日韩毛片视频在线看| 久久青草国产手机看片福利盒子|