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

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

?? hamming.c

?? this the source code of addio compression standard CELP. Also, it is optimizied for the execution sp
?? C
字號:
/**************************************************************************
*
* ROUTINE
*               encodeham
*
* FUNCTION
*               This subroutine calculates the parity bits necessary
*		to form the code word.
*
*
* SYNOPSIS
*               encodeham(codelength1,codelength2,hmatrix,
*			  paritybit,codeword)
*
*   formal
*
*                       data    I/O
*       name            type    type    function
*       -------------------------------------------------------------------
*	codelength1	int	i	number of data bits
*	codelength2	int	i	number of information bits
*	hmatrix		int	i	vector to encode a decode by
*	paritybit	int	o	overall parity bit
*	codeword	int	o	encoded stream (paritybits at end)
*
***************************************************************************
*
* DESCRIPTION
*
*		This subroutine is part of a set of subroutines which perform
*	a Generalized Hamming Code.  As you know, Hamming codes are perfect
*	codes and can only detect and correct one error.  We added an overall
* 	parity checkbit, which allows us to detect 2 errors.  When 2 errors
*	are detected, (in subroutine decodeham) no correction attempt is
*	made.  This would most likely result in more errors.  Instead, a flag
*	is sent to the calling program notifying it of multiple errors so
*	that smoothing may be attempted.  The Hamming codes presently supported
*	by the routines are (63,57), (31,26), (15,11), and shortened variations
*	thereof.  It could be made even more general by making minor 
*	modifications to the decimal to binary output vector code in the 
*	encodeham procedure.  This routine at present will calculate
*	a maximum of 6 bits.
*
*	Hamming routines consist of the following procedures:
*
*		matrixgen - generates the hmatrix and sydrometable.
*		encodeham - generates the code word and overall paritybit.
*		decodeham - recovers infobits, checks for errors, corrects 1
*			    error, and sends out flag for smoothing.
*
*
*               This subroutine performs the Hamming encode function.
*		It will calculate the necessary parity bits, depending on 
*		which code is requested, and will add the overall parity bit 
*		to the end of the code word generated.
*
*
***************************************************************************
*
* CALLED BY
*
*	celp
*
* CALLS
*
*
***************************************************************************
*
* REFERENCES
*
*	Lin and Costello : Error Control Coding
*	Berlekamp : Algebraic Coding Theory
*
**************************************************************************/
#define PARITYFLAG	1
encodeham(codelength1, codelength2, hmatrix, paritybit, codeword)
int codelength1, codelength2, hmatrix[], *paritybit, codeword[];

{
  int temp, i, *codeptr = &codeword[codelength1];

  /*	First generate the parity bits for the Hamming code word.  This is
	relatively straightforward.  hmatrix was generated in matrixgen.c,
	which is called as part of the Hamming initialization routines.	*/

  for (temp = i = 0; i < codelength2; i++)
  {
    if (codeword[i] != 0)
      temp ^= hmatrix[i];
  }

  /*	since the hmatrix is stored in a packed decimal format, the parity
	bits must be unpacked and appended to the end of the bitsteam.
	after this code you will have the complete code word.  	 	 */

  /* 	the following code converts a decimal number into a binary output 
     	vector.								 */

  for (i = codelength1 - codelength2; --i >= 0;)
    *--codeptr =(temp & 1<<i)>>i;

  /*	Now I check to see if the parityflag is set, indicating the user
	requests an overall parity bit be generated.  Normally this will
	be the case.							 */

#if PARITYFLAG == 1
  for (temp = i = 0; i < codelength1; i++)
  {
    temp ^= codeword[i];
  }
  *paritybit = temp;
#endif
}

/**************************************************************************
*
* ROUTINE
*               decodeham
*
* FUNCTION
*               This subroutine decodes the bitstream generated by
*		encodeham.  It will correct a single error, and detect 2
*		errors.
*
*
* SYNOPSIS
*               subroutine decodeham(codelength1, hmatrix, syndrometable,
*			paritybit, codeword, twoerror, synflag)
*
*   formal
*
*                       data    I/O
*       name            type    type    function
*       -------------------------------------------------------------------
*       codelength1	int	i	number of data bits
*	hmatrix		int	i	vector to encode a decode by
*	syndrometable	int	i	errormasks used to correct single
*					errors
*	paritybit	int	i	overall parity bit
*	codeword	int	i/o	encoded/decoded stream
*	twoerror	int	o	flag for 2 error detect
*	synflag		int	o	value 0 or 1, 1 if syndrome  !=  0
*
***************************************************************************
*
* DESCRIPTION
*
*		This subroutine is part of a set of subroutines which
*	perform a Generalized Hamming Code.  As you know, Hamming codes
*	are perfect codes and can only detect and correct one error.  We
* 	added an overall parity checkbit, which allows us to detect 2 errors.
*	When 2 errors are detected, (in subroutine decodeham) no correction
*	attempt is made.  This would most likely result in more errors.
*	Instead, a flag is sent to the calling program notifying it of
*	multiple errors so that smoothing may be attempted.  The Hamming
*	codes presently supported by the routines are (63,57), (31,26),
*	(15,11), and shortened variations thereof.  It could be made even 
*	more general by making minor modifications to the decimal to binary 
*	output vector code in the encodeham procedure.  This routine at  
*	presentwill calculate a maximum of 6 bits.
*
*	Hamming routines consist of the following procedures:
*
*		matrixgen - generates the hmatrix and sydrometable.
*		encodeham - generates the code word and overall paritybit.
*		decodeham - recovers infobits, checks for errors, corrects 1
*			    error, and sends out flag for smoothing.
*
*
*	This subroutine, decodeham, is responsible for checking for errors,
*	correcting the error if there is only one, and sending a smoothing
*	flag to the calling routine if there is more than one.
*
***************************************************************************
*
* CALLED BY
*
*	celp
*
* CALLS
*
*
***************************************************************************
*
* REFERENCES
*
*	Lin and Costello : Error Control Coding
*	Berlekamp : Algebraic Coding Theory
*
**************************************************************************/
#define TRUE	1
#define FALSE	0
decodeham(codelength1, hmatrix, syndrometable,
	  paritybit, codeword, twoerror, synflag)
int codelength1, hmatrix[], syndrometable[];
int paritybit, codeword[], *twoerror, *synflag;
{
  int parityflag, errorflag, i, j;

  *twoerror = FALSE;
  errorflag = 0;
  parityflag = 1;

  /* This part of the routine checks the overall parity of the code word and
     compares it with the overall paritybit sent.  If they are not the same
     that means there is at least one error.  If, later on in the routine,
     the syndrome check indicates that there is an error and the parity is
     correct in this part of the routine, that indicates there are two
     errors.  One of the weaknesses of this method is that there is no way
     of knowing if we have 3,5,7,... errors.  We always smooth if there are
     2,4,6,... errors.	 						 */

  if (parityflag == 1)
  {
    for (*synflag = i = 0; i < codelength1; i++)
      *synflag ^= codeword[i];
    if (paritybit != *synflag)
      errorflag++;
  }

  /* This part of the routine generates the syndrome.  The syndrome will
     equal zero if there are no errors.  synflag accumulates the syndrome
     and is used as the offset in the syndrome table, which tells the 
     routine which bit is in error.					 */

  for (*synflag = i = 0; i < codelength1; i++)
  {
    if (codeword[i] != 0)
      *synflag ^= hmatrix[i];
  }

  /* *** Check to see if the parityflag is set and if it is then check to see
     if the parity bit was in error. If the parityflag was set and there was
     an error in the syndrome, the errorflag should equal 1. If it doesn't,
     then there are more errors than can be corrected and the infobits are
     passed on unchanged.			 			 */

  if (*synflag != 0)
  {
    if (errorflag != 1 && parityflag == 1)
    {
      *twoerror = TRUE;
      return;
    }

    j = syndrometable[*synflag - 1];
    codeword[j - 1] ^= 1;
  }

  /* *** If the syndrome is equal to zero and the errorflag is set (not
     likely, but must be checked) then more than one error has occured, 
     but it cannot be corrected, so I pass on the infobits the same as  
     if there were no errors.				 		 */

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜久久久久| 一区二区三区不卡视频在线观看 | 久久久久久综合| 91精品国产免费| 欧美高清dvd| 91精品免费在线| 欧美电影免费观看高清完整版 | 久久精品999| 久久99精品国产.久久久久久| 免费人成精品欧美精品 | 国产亚洲精品久| 久久久久久97三级| 最新欧美精品一区二区三区| 亚洲啪啪综合av一区二区三区| 亚洲精品国产精华液| 五月天欧美精品| 久久99日本精品| 懂色av中文字幕一区二区三区| 国产成人av自拍| 欧美亚洲一区二区在线| 欧美一区二区高清| 日本一区二区三区四区在线视频| 国产精品精品国产色婷婷| 亚洲精品v日韩精品| 日韩黄色一级片| 国产成a人无v码亚洲福利| 在线观看av一区二区| 日韩一区二区三区av| 国产精品剧情在线亚洲| 亚洲影院在线观看| 久久精品二区亚洲w码| 99精品视频在线观看| 91精品啪在线观看国产60岁| 国产精品视频第一区| 亚洲在线成人精品| 国产精品一区二区果冻传媒| 欧美色视频一区| 久久久久国色av免费看影院| 亚洲va欧美va人人爽午夜| 国产精品1区2区| 欧美精品vⅰdeose4hd| 亚洲国产高清在线观看视频| 日韩成人午夜精品| 99久久免费视频.com| 欧美精品一区二区久久久| 一区二区在线观看视频在线观看| 久久不见久久见中文字幕免费| 99精品一区二区三区| 久久久久久麻豆| 丝袜亚洲另类丝袜在线| eeuss鲁片一区二区三区在线看| 欧美高清激情brazzers| 亚洲精品伦理在线| 国产精品一区二区不卡| 欧美一区二区三区在线视频| 亚洲美女偷拍久久| 国产成人欧美日韩在线电影| 欧美一级理论性理论a| 亚洲综合999| 91丨porny丨中文| 亚洲黄色在线视频| 高清免费成人av| 精品成人一区二区三区四区| 日韩精品免费视频人成| 欧美色爱综合网| 亚洲一区二区三区国产| 99国产欧美另类久久久精品| 国产精品无圣光一区二区| 国产精品99久久久久久似苏梦涵| 日韩久久久精品| 久久91精品国产91久久小草| 欧美一级理论性理论a| 偷拍一区二区三区四区| 欧美人xxxx| 日韩精品乱码av一区二区| 欧美浪妇xxxx高跟鞋交| 日韩精品一卡二卡三卡四卡无卡| 欧美区一区二区三区| 日韩精品免费专区| 日韩精品在线一区二区| 国产一区三区三区| 久久久久成人黄色影片| 成人一区二区三区在线观看| 国产精品二三区| 色综合中文字幕国产 | 午夜一区二区三区视频| 欧美亚洲日本一区| 亚洲午夜免费视频| 欧美二区乱c少妇| 精东粉嫩av免费一区二区三区| 2022国产精品视频| 成人午夜看片网址| 亚洲另类在线一区| 51精品视频一区二区三区| 免费成人在线网站| 亚洲国产精品成人综合| 色综合一区二区三区| 香蕉影视欧美成人| 欧美mv日韩mv国产网站app| 国产精品综合网| 一区二区三区成人在线视频| 欧美一区二区三区啪啪| 国产一区二区在线观看视频| 国产精品理伦片| 777a∨成人精品桃花网| 国产一区视频导航| 一区二区三区四区不卡在线| 日韩天堂在线观看| 波多野结衣中文一区| 午夜欧美电影在线观看| 久久久久97国产精华液好用吗 | 亚洲成人动漫一区| 久久久国产一区二区三区四区小说 | 国产精品美女一区二区| 在线亚洲+欧美+日本专区| 国模娜娜一区二区三区| 一区二区三区四区在线免费观看| 日韩欧美一二三| 91亚洲精品一区二区乱码| 美女在线一区二区| 久久国产精品99精品国产| 国产精品久久久久四虎| 日韩限制级电影在线观看| 色香蕉成人二区免费| 国产精品一区不卡| 免费成人av资源网| 一区二区免费在线| 国产精品福利影院| 日韩午夜激情av| 欧美日韩久久一区| 99精品国产热久久91蜜凸| 国产精品主播直播| 久久精品国产免费看久久精品| 一区二区三区在线免费| 国产精品国产三级国产aⅴ入口 | 国产精品一区二区不卡| 日本91福利区| 亚洲一区二区三区四区不卡| 中文字幕在线观看一区二区| 2023国产精华国产精品| 日韩欧美国产一二三区| 欧美日韩精品一区二区三区| 欧美中文字幕一区二区三区| 色欧美片视频在线观看| 91免费视频网址| 91丨九色丨蝌蚪丨老版| av在线不卡免费看| eeuss鲁一区二区三区| 成人免费视频网站在线观看| 国产精品1024久久| 国产成人免费9x9x人网站视频| 国产一区欧美日韩| 国产老女人精品毛片久久| 国产在线精品一区二区 | 中文字幕一区二区三区在线播放| 久久久国产一区二区三区四区小说 | 亚洲成人免费影院| 婷婷综合久久一区二区三区| 日韩高清中文字幕一区| 日本女优在线视频一区二区| 日韩电影一区二区三区| 久久成人麻豆午夜电影| 国产一区二区三区最好精华液| 久久国产综合精品| 国模娜娜一区二区三区| 床上的激情91.| 91久久国产最好的精华液| 欧美在线一二三四区| 777久久久精品| 精品国产sm最大网站| 国产精品第四页| 亚洲一区二区三区中文字幕| 日本欧美在线观看| 国产成人av电影| 日本精品视频一区二区三区| 在线不卡的av| 国产欧美一区二区精品忘忧草| 国产精品色一区二区三区| 亚洲综合色成人| 蜜桃av一区二区在线观看| 国产91精品一区二区| 一本到不卡免费一区二区| 欧美一区二区三区视频在线 | 99国产精品久久久久久久久久久| 色999日韩国产欧美一区二区| 欧美日韩日日夜夜| 国产网站一区二区| 亚洲一区二区三区四区五区黄| 精品无人区卡一卡二卡三乱码免费卡| 欧美丝袜丝nylons| 精品对白一区国产伦| 一区二区欧美国产| 国产一区二区久久| 欧美日韩精品高清| 中文字幕二三区不卡| 日韩高清在线一区| 91在线观看地址| 久久精品视频免费观看| 亚洲成人免费看| 99久久免费国产|