⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.c

📁 BCH编码与译码程序
💻 C
字号:

main()
{
 int i,j;
 int k;
 unsigned short table[64]={21,20,22,19,4,23,8,2,64,43,
						5,44,6,63,42,24,45,7,
						1,3,9,10,11,12,13,14,
						15,16,17,18,25,26,27,28,
						29,30,31,32,33,34,35,36,
						37,38,39,40,41,46,47,48,
						49,50,51,52,53,54,55,56,
						57,58,59,60,61,62};
unsigned short voice_data_up_line_g729d[30][12];						
unsigned short BCH_decode_data[64],decodein[64];
unsigned short serial_bit_channel[64];
unsigned short count=0;
unsigned short temp1=0,temp;
                               //1 2  3 4 5 6 7 8 9 10
unsigned short table_number[10]={8,10,8,9,9,2,6,4,9,6};
for (j=0;j<64;j++)
  {
  	if((j%2)==0) serial_bit_channel[j]=0;
  	else serial_bit_channel[j]=1;
  }
//把64个比特语音打成12个word中。
/*		for(j=1;j<=64;j++)
				for(i=0;i<64;i++)
					if(table[i]==j)
					{
						k=i;
						decodein[j-1]=serial_bit_channel[k];
					} */
	  for(j=0;j<64;j++)
	    BCH_decode_data[table[j]-1]=serial_bit_channel[j];
	    //i=0;
	   count=0;
	  for (j=0;j<10;j++)
	  {
	  	//count++;
	  	//unsinged short temp1=0;
	  	temp1=0;
	  	//temp=table_number[j];
	  	for(i=0;i<table_number[j];i++)
	  {	
	  	if(BCH_decode_data[count++]&0x01==1)
	    temp1=temp1|1;
	    temp1=temp1<<1;
	  }
	  temp1=temp1>>1;
	  voice_data_up_line_g729d[1][j+1]=temp1;
	  }
	  i=0;
}

⌨️ 快捷键说明

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