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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? chan_dec.c

?? 語(yǔ)音壓縮編碼和解碼的標(biāo)準(zhǔn),其中包含部分源代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/*-------------------------------------------------------------------------*/ 
/*                                                                         */
/*                   G.723.1 Channel Decoder Simulation V3.1               */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*                                                                         */
/*-------------------------------------------------------------------------*/
/* (C) Copyright 1995-1996, Bosch Telecom. All rights reserved.            */
/* Contact: Joerg-Martin Mueller, Bosch Telecom, Email: jmm@bk.bosch.de    */
/*-------------------------------------------------------------------------*/


/*___________________________________________________________________________
 |                                                                           |
 | 	Include-Files                                                        |
 |___________________________________________________________________________|
*/
#include "defines.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>

/* G.723.1 Includes */
#include "typedef.h"
#include "basop.h"
#include "cst_lbc.h"
#include "tab_lbc.h"
#include "lbccodec.h"
#include "coder.h"
#include "decod.h"
#include "exc_lbc.h"
#include "util_lbc.h"

#define   setbit( x, n )    (( x ) |=   ( 1 << ( n )))
#define   clrbit( x, n )    (( x ) &= (~( 1 << ( n ))))


/*___________________________________________________________________________
 |                                                                           |
 |  	local Functions                                                      |
 |___________________________________________________________________________|
*/
static void  GetChannelBitrates(char* ConfigName);
static void CrcDecoder(Word16 info_bit_r[], Word16 *bad_frame, Word16 G723_mode_r);
static void bit_deallocation(Word16 info_bit_r[],  char InfoBitStream_r[], 
                             Word16 G723_mode_r );
static void  EndTrellisReorderDec (Word16 info_bit[], Word16 info_bit_soft[], Word16 bit_class[], 
                                   Word16 punctur[5][3], Word16 mode);
static void ChannelDecoder(Word16 chan_bit_r[], char InfoBitStream_r[]);
static void viterbi( Word16 nbit_class[], Word16 punctur[5][3], 
    Word16 chan_bit_r[], Word16 info_bit_r[], Word16 info_bit_r_soft[]);
static void hamming_distance( Word16 chan_bit_np[], Word16 metric[], Word16 temp[] );
static void metric_update( Word16 chan_bit_np[], Word16 metric[], Word16 *surv_mem );
static void hamming_distance( Word16 chan_bit_np[], Word16 metric[], Word16 temp[] );
static void metric_update( Word16 chan_bit_np[], Word16 metric[], Word16 *surv_mem );
static void ChannelCodecInit(Word16 SpeechCodecMode,Word16 ChannelBitrate,
                             Word16 bit_class[],Word16 punctur[5][3]);
static Word16 GetRate (Word16 rbits, Word16 weight, Word16 bit_class, Word16 inv_bit_class, Word16 rnd);
static bitrate_test( Word16 nbit_class[], Word16 punctur[5][3], Word16 last );
static void bitrate_adapt_high (Word16 bit_class[],Word16 punctur[5][3],
                                Word16 cbits, Word16 r[], Word16 last);
static void bitrate_adapt_low (Word16 bit_class[],Word16 punctur[5][3],
                                Word16 cbits, Word16 r[], Word16 last);
static void SoftBFI (Word16 bit_class[], Word16 punctur[5][3], 
           Word16 info_bit_r_soft[], Word16 bad_frame_soft[], Word16 bad_frame,
Word16 G723_mode_r);
static void ConfigDecode (Word16 chan_bit_r[], Word16 *mode_r, Word16 *err_conf);
static void speech_decoder_adaptation(char CInfoBitStream[],char InfoBitStream[],
                                       Word16 IndexError[]);
static LINEDEF  Line_Unpk_Channel( char *Vinp, Word16 IndexError[] );
static void LSP_Reorder_decoder (LINEDEF *Line);
static void ModeChangeAccept (Word16 mode_r, Word16 err_conf, Word16 *ModeAccept);
static void DecodeChannelBitrate(Word16 CC_mode_r,Word16 G723_mode_r, Word16 *SysChannelBitrate_r);
static int Strincmp( const char *s, const char *t, size_t max );
static FILE *OpenBinfile( char *name, char *mode );
static void  Init_DecoderState (void);

/*___________________________________________________________________________
 |                                                                           |
 |  	Constants & Globals                                                  |
 |___________________________________________________________________________|
*/
static char   outtext[]                = " Decoding Frame: %4d\r";
enum  Wmode    WrkMode = Both ;
enum  Crate    WrkRate;
Flag     UseHp = True;
Flag     UsePf;
Flag     UseVx;
Word32   count_clip;
Word16   MAX_CHAN_BIT = 684;



/* Definition of CRC Check Code for error detection (see section 2.4) */
/* ------------------------------------------------------------------ */
#define   CrcLen  5
#define   CrcGen  18
static const Word16   CrcWindow53   = 34; /* number of bits of class 1 for crc */
static const Word16   CrcWindow63   = 44; /* number of bits of class 1 for crc */
static const Word16   CrcWindowSID  = 30; /* number of bits of class 1 for crc */

/* Definition of low rate configuration */
/* ------------------------------------ */
#define   NBits5_3       168  /* Info bits with configuration and UB's */
#define   NInfoBits5_3   162  /* Info bits without configuration and UB's */

/* Definition of high rate configuration */
/* ------------------------------------- */
#define   NBits6_3       200  /* Info bits with configuration and UB's */
#define   NInfoBits6_3   193  /* Info bits without configuration and UB's */

/* Definition of SID configuration */
/* ------------------------------- */
#define   NBitsSID        32  /* Info bits with configuration and UB's */
#define   NInfoBitsSID    30  /* Info bits without configuration and UB's */

/* Definition of BCH Code for configuration bits (see section 2.5.4) */
/* ----------------------------------------------------------------- */
#define   BCHLen  13
#define   NumBCHWords  8

/* Channel bitrates (are read from file) */
/* ------------------------------------- */
static Word16   ChannelBitrate_53[2];
static Word16   ChannelBitrate_63[2];
static Word16   ChannelBitrate_SID[2];

/*___________________________________________________________________________
 |                                                                           |
 |  	Subroutines                                                          |
 |___________________________________________________________________________|
*/


static void DecodeChannelBitrate(Word16 CC_mode_r,Word16 G723_mode_r, 
                                 Word16 *SysChannelBitrate_r)
{
   Word16   CC_Bitrate[2],i;

   if (G723_mode_r == 0){
      for (i=0;i<2;i++) CC_Bitrate[i] = ChannelBitrate_63[i];
   }
   if (G723_mode_r == 1){
      for (i=0;i<2;i++) CC_Bitrate[i] = ChannelBitrate_53[i];
   }
   if (G723_mode_r == 2){
      for (i=0;i<2;i++) CC_Bitrate[i] = ChannelBitrate_SID[i];
   }

   *SysChannelBitrate_r = CC_Bitrate[CC_mode_r];

   return;
}


static void  EndTrellisReorderDec (Word16 info_bit[], Word16 info_bit_soft[], 
                         Word16 bit_class[], Word16 punctur[5][3], Word16 mode)
{
   Word16 last,i,ptr_end,tmp,limit;

    if( (mode & 0x3) == 0) limit=CrcWindow63+CrcLen+20;
    if( (mode & 0x3) == 1) limit=CrcWindow53+CrcLen+20;
    if( (mode & 0x3) == 2) limit=CrcWindowSID+CrcLen+20;


    /* Check which class is the last protected one */
   last=0;
   for (i=1;i<5;i++){
      if (punctur[i][0] != 0) last=i;
   }

   /* Determine number of protected bits */
   ptr_end = 0;
   for (i=0;i<=last;i++) ptr_end = ptr_end + bit_class[i];
   ptr_end = ptr_end - 4;  /* remove tail bits */

   if (ptr_end >= limit) {
      ptr_end--;
      for (i=0;i<10;i++){
         tmp                    = info_bit[ptr_end-i];
         info_bit[ptr_end-i]    = info_bit[ptr_end-19+i];
         info_bit[ptr_end-19+i] = tmp;

         tmp                         = info_bit_soft[ptr_end-i];
         info_bit_soft[ptr_end-i]    = info_bit_soft[ptr_end-19+i];
         info_bit_soft[ptr_end-19+i] = tmp;
      }
   }
   return;
}



/*_________________________________________________________________________________
 |                                                                                 |
 | Determine the parameters of the channel encoder given the channel bitrate       |
 |               (section 2.5.1)                                                   |
 |_________________________________________________________________________________|
*/
static void ChannelCodecInit(Word16 SpeechCodecMode,Word16 ChannelBitrate,
                             Word16 bit_class[],Word16 punctur[5][3])

{
/* Definition of puncturing matrix for convolutional code (see Table C4) */
/* --------------------------------------------------------------------- */
   static const Word16 PuncturTable[25][3] = {{0x000,0x000,0x000},
                                            {0xd6f,0x690,0x000},
                                            {0xd7f,0x690,0x000},
                                            {0xd7f,0x691,0x000},
                                            {0xd7f,0x695,0x000},
                                            {0xdff,0x695,0x000},
                                            {0xfff,0x695,0x000},
                                            {0xfff,0x69d,0x000},
                                            {0xfff,0x6dd,0x000},
                                            {0xfff,0x6df,0x000},
                                            {0xfff,0x7df,0x000},
                                            {0xfff,0x7ff,0x000},
                                            {0xfff,0xfff,0x000},
                                            {0xfff,0xfff,0x001},
                                            {0xfff,0xfff,0x009},
                                            {0xfff,0xfff,0x109},
                                            {0xfff,0xfff,0x309},
                                            {0xfff,0xfff,0x329},
                                            {0xfff,0xfff,0x729},
                                            {0xfff,0xfff,0x72d},
                                            {0xfff,0xfff,0x72f},
                                            {0xfff,0xfff,0x7af},
                                            {0xfff,0xfff,0x7bf},
                                            {0xfff,0xfff,0x7ff},
                                            {0xfff,0xfff,0xfff}};

/* Definition of low rate configuration (see Table C5a)         */
/* Note that the weight is in 16 bit representation and negated */
/* ------------------------------------------------------------ */
   static const Word16   BitClass53[5]    = { 34+CrcLen, 40, 40, 40+4, 8 };
   static const Word16   Weight53[5]      = { -7864, -10158, -7864, -6882, 0}; 

   static const Word16   InvBitClass53[4] = {26887, 26214, 26214, 26214}; /* 2^20/BitClass53[i]) */
   static const Word16   inv_b0p4_53      = 24386;                        /* 2^20/(BitClass53[0]+4)*/

/* Definition of high rate configuration (see Table C5a)        */
/* Note that the weight is in 16 bit representation and negated */
/* ------------------------------------------------------------ */
   static const Word16   BitClass63[5]    = { 44+CrcLen, 44, 46, 47+4, 12 };
   static const Word16   Weight63[5]      = { -8520, -9502, -7864, -6882, 0};

   static const Word16   InvBitClass63[4] = {21400, 23831, 22795, 22310};
   static const Word16   inv_b0p4_63      = 19785;

/* Definition of SID configuration (see Table C5b)              */
/* Note that the weight is in 16 bit representation and negated */
/* ------------------------------------------------------------ */
   static const Word16   BitClassSID[5] = { 30+CrcLen+4, 0, 0, 0, 0 };
   static const Word16   WeightSID[5]   = { -32768, 0, 0, 0, 0};

   static const Word16   inv_b0p4_SID   = 26887;

   Word16   i,j,rbits,r[5],abits,last,cbits,limit,NInfoBits;
   Word16   weight[5],inv_b0p4,inv_bit_class[4];
   Word32   L_tmp;

   /* Determine the number of available channel bits per frame (multiply by 0.03) */
   /* ----------------------------------------------------------------------------*/
   L_tmp = L_mult(ChannelBitrate,31458);
   cbits = (Word16) L_shr(L_tmp,21);

   if ((SpeechCodecMode & 0x3) == 0){
      for (i=0;i<5;i++) bit_class[i] = BitClass63[i];
      for (i=0;i<5;i++) weight[i] = Weight63[i];
      inv_b0p4 = inv_b0p4_63;
      for (i=0;i<4;i++) inv_bit_class[i] = InvBitClass63[i];
      NInfoBits = NInfoBits6_3;
   }
   if ((SpeechCodecMode & 0x3) == 1){
      for (i=0;i<5;i++) bit_class[i] = BitClass53[i];
      for (i=0;i<5;i++) weight[i] = Weight53[i];
      inv_b0p4 = inv_b0p4_53;
      for (i=0;i<4;i++) inv_bit_class[i] = InvBitClass53[i];
      NInfoBits = NInfoBits5_3;
   }
   if ((SpeechCodecMode & 0x3) == 2){
      for (i=0;i<5;i++) bit_class[i] = BitClassSID[i];
      for (i=0;i<5;i++) weight[i] = WeightSID[i];
      inv_b0p4 = inv_b0p4_SID;
      NInfoBits = NInfoBitsSID;
   }

   /* Determine the number of available redundancy bits per frame */
   /* ----------------------------------------------------------- */
   rbits = cbits - (NInfoBits+CrcLen+BCHLen);

   /* Check whether enough bits are available */
   /* --------------------------------------- */
   if (rbits < 0) {
      printf ("\n\nNot enough channel bitrate specified\n");
      printf ("The minimum channel bitrate is %.2f kbit/s \n",
            ((float)(BCHLen+CrcLen+NInfoBits)*1000./30.));
      exit(1);
   }

   if (rbits == 0) {
      /* No convolutional code specified */
      /* ------------------------------- */
      if (SpeechCodecMode < 2) {
         bit_class[3] = bit_class[3]-4;
      }else{
         bit_class[0] = bit_class[0]-4;
      }
      for (i=0;i<4;i++) {
         bit_class[4] = bit_class[4] + bit_class[i];
         bit_class[i] = 0;
      }
      for (i=0;i<5;i++){
         r[i]=12;
         for (j=0;j<3;j++) punctur[i][j] = PuncturTable[r[i]-12][j];
      }
   }else{

      /* Check whether too much bits have been specified */
      /* ----------------------------------------------- */
      limit = 2*(bit_class[0]+bit_class[1]+bit_class[2]+
                 bit_class[3]+bit_class[4]) + 4;
      if (rbits >= limit) {
	 if (rbits > limit) {
	    printf ("\n\nSpecified channel bitrate in bitrate configuration file too high\n");
	    printf ("The channel bitrate is limited to %.2f kbit/s \n",
                  (float)(3*(bit_class[0]+bit_class[1]+bit_class[2]+
                 bit_class[3]+bit_class[4])+BCHLen)*1000./30.);
         }
         for (i=0;i<4;i++)   r[i]=36;
         r[4]=12;
         for (i=0;i<5;i++){
            for (j=0;j<3;j++) punctur[i][j] = PuncturTable[r[i]-12][j];
         }
         bit_class[3] = bit_class[3] + bit_class[4];
         bit_class[4] = 0;
      }else{
         /* Initialise rates and puncturing tables */
         /* -------------------------------------- */
         for (i=0;i<5;i++)   r[i]=12;
         for (i=0;i<5;i++){
            for (j=0;j<3;j++) punctur[i][j] = PuncturTable[r[i]-12][j];
         }

         /* Determine rate for the most sensitive bit class */
         /* ----------------------------------------------- */
         rbits = rbits - 4; /* tail bits have to be transmitted */
         if (rbits < 0) rbits=0;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区二区| 亚洲日本在线天堂| 色综合天天性综合| 99久久99久久精品免费看蜜桃| 亚洲韩国精品一区| 中文av一区二区| 日韩丝袜情趣美女图片| 一本色道久久综合亚洲91| 激情国产一区二区 | 国产精品久久久久久亚洲毛片 | 精品久久99ma| 色婷婷国产精品久久包臀| 极品少妇xxxx精品少妇| 亚洲国产精品一区二区久久| 欧美韩日一区二区三区| 日韩精品资源二区在线| 欧美日韩一本到| 91影视在线播放| 成人精品视频.| 国产美女在线观看一区| 蜜臀91精品一区二区三区 | 精品欧美一区二区久久| 欧美视频你懂的| 91在线国内视频| 成人av网站在线观看| 国产一区视频导航| 美美哒免费高清在线观看视频一区二区| 亚洲精品一卡二卡| 亚洲天天做日日做天天谢日日欢| 久久九九久久九九| 久久色中文字幕| 欧美不卡视频一区| 欧美大黄免费观看| 日韩欧美国产三级电影视频| 91精品国模一区二区三区| 精品视频一区二区三区免费| 在线免费av一区| 91成人看片片| 欧美亚洲一区二区在线| 在线看日本不卡| 欧美在线免费视屏| 欧美性大战久久| 欧美日韩国产123区| 欧美另类一区二区三区| 欧美精品丝袜久久久中文字幕| 欧美日韩你懂的| 91精品国产入口在线| 欧美一二三区在线| 久久亚洲精品小早川怜子| 久久久久国产一区二区三区四区 | 国产麻豆午夜三级精品| 精品写真视频在线观看| 国产在线精品一区二区夜色| 国产麻豆成人精品| 高清日韩电视剧大全免费| 国产suv精品一区二区三区| www.欧美色图| 欧美性大战xxxxx久久久| 欧美美女一区二区| 精品国产一区二区在线观看| 国产视频在线观看一区二区三区| 国产精品毛片无遮挡高清| 亚洲欧美另类久久久精品2019| 亚洲午夜激情网页| 麻豆精品久久精品色综合| 国产精品一区二区免费不卡| 成a人片国产精品| 欧美午夜一区二区| 日韩欧美高清dvd碟片| 欧美激情一区二区在线| 一区二区三区中文字幕| 日韩国产在线一| 国产一区二区毛片| 色婷婷综合久久久中文一区二区| 欧美日韩精品二区第二页| 精品88久久久久88久久久| 国产精品高清亚洲| 天堂成人国产精品一区| 国产精品综合久久| 在线免费一区三区| 久久综合久久综合久久综合| 中文字幕一区二区三区四区| 成人激情小说网站| 色偷偷一区二区三区| 日韩一区二区在线观看视频| 亚洲国产电影在线观看| 亚洲成人av在线电影| 国产精品亚洲视频| 欧美日韩mp4| 国产精品美女久久久久久久久 | 欧美激情综合五月色丁香小说| 亚洲丝袜另类动漫二区| 久久精品二区亚洲w码| av网站免费线看精品| 91精品国产麻豆国产自产在线 | 国产一区二区视频在线播放| 色婷婷综合五月| 久久免费的精品国产v∧| 亚洲一级二级在线| 成人精品一区二区三区四区| 91精品国产综合久久婷婷香蕉 | 国产专区综合网| 欧美性色综合网| 中文字幕第一区| 久久精品99国产精品| 欧美视频一区在线| 国产尤物一区二区| 欧美网站一区二区| 亚洲天堂久久久久久久| 国产精一区二区三区| 在线成人午夜影院| 亚洲欧美日韩中文播放| 国产精品一品二品| 日韩一区二区三区在线观看| 一区二区三区日本| 一本一本久久a久久精品综合麻豆| 久久午夜免费电影| 久久精品国产99久久6| 欧美精品在线一区二区三区| 一区二区三区视频在线观看 | 欧美精品自拍偷拍| 亚洲毛片av在线| av激情综合网| 国产精品久久久久桃色tv| 国产成人在线电影| 久久综合久久综合久久| 美女视频黄免费的久久| 欧美精品电影在线播放| 亚洲愉拍自拍另类高清精品| 99久久久久免费精品国产| 国产精品色婷婷久久58| 国产精品原创巨作av| 久久日一线二线三线suv| 九九精品视频在线看| 日韩精品一区二区三区在线观看 | 国产精品1024久久| 欧美精品一区二区三区高清aⅴ | 国产麻豆9l精品三级站| 26uuu国产电影一区二区| 久久99热国产| 精品久久久久一区| 精品一区二区三区久久久| 精品剧情在线观看| 国产在线视视频有精品| 久久久青草青青国产亚洲免观| 国产一区福利在线| 国产欧美日韩精品a在线观看| 国产另类ts人妖一区二区| 国产日产欧美一区| 成人av在线播放网站| 自拍av一区二区三区| 在线视频你懂得一区二区三区| 一区二区三区四区视频精品免费 | 国产精品久久久一本精品| 成人福利在线看| 亚洲精品一二三区| 欧美日韩国产精品成人| 免费欧美在线视频| 久久久高清一区二区三区| 成人一级片在线观看| 亚洲三级电影网站| 777亚洲妇女| 国产一区二区中文字幕| 国产精品久久久久久久蜜臀| 色网综合在线观看| 日本vs亚洲vs韩国一区三区二区 | 国产精品素人一区二区| 91蜜桃婷婷狠狠久久综合9色| 亚洲一区二区三区精品在线| 日韩视频一区在线观看| 丁香啪啪综合成人亚洲小说| 樱桃视频在线观看一区| 欧美一级片免费看| 国产aⅴ综合色| 亚洲一区在线免费观看| 精品国产91九色蝌蚪| 99久久99久久综合| 日韩成人一级大片| 国产精品久久免费看| 欧美美女一区二区三区| 国内外精品视频| 亚洲精品乱码久久久久| 精品国产sm最大网站免费看| 91视频.com| 精品一区二区三区视频在线观看| 最近日韩中文字幕| 欧美成人在线直播| 色视频一区二区| 国产精品一级二级三级| 亚洲在线一区二区三区| 国产亚洲综合av| 欧美精品第1页| 成人aa视频在线观看| 久久国产欧美日韩精品| 亚洲精品国产一区二区精华液 | 一区二区三区高清不卡| 久久奇米777| 欧美日本在线播放| 91一区在线观看| 韩国av一区二区三区在线观看|