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

📄 ecc.h

📁 无线通讯中使用的一种揪错算法,rs 1.0 揪错能力可配置 能纠正 (冗余长度)/2-1 个错误
💻 H
字号:
/* Reed Solomon Coding for glyphs *  * (c) Henry Minsky (hqm@ua.com), Universal Access Inc.  (1991-1996) *      * *//****************************************************************    Below is NPAR, the only compile-time parameter you should have to  modify.    It is the number of parity bytes which will be appended to  your data to create a codeword.  Note that the maximum codeword size is 255, so the  sum of your message length plus parity should be less than  or equal to this maximum limit.  In practice, you will get slooow error correction and decoding  if you use more than a reasonably small number of parity bytes.  (say, 10 or 20)  ****************************************************************/#define NPAR 4/****************************************************************/#define TRUE 1#define FALSE 0typedef unsigned long BIT32;typedef unsigned short BIT16;/* **************************************************************** *//* Maximum degree of various polynomials. */#define MAXDEG (NPAR*2)/*************************************//* Encoder parity bytes */extern char pBytes[MAXDEG];/* Decoder syndrome bytes */extern char synBytes[MAXDEG];/* print debugging info */extern int DEBUG;/* Reed Solomon encode/decode routines */void initialize_ecc (void);int check_syndrome (void);void decode_data (unsigned char data[], int nbytes);void encode_data (unsigned char msg[], int nbytes, unsigned char dst[]);/* galois arithmetic tables */extern char gexp[];extern char glog[];void init_galois_tables (void);char ginv(char elt); char gmult(char a, char b);/* Error location routines */int correct_errors_erasures (unsigned char codeword[], int csize,int nerasures, char erasures[]);///* polynomial arithmetic */void add_polys(char dst[], char src[]) ;void scale_poly(char k, char poly[]);void mult_polys(char dst[], char p1[], char p2[]);void copy_poly(char dst[], char src[]);void zero_poly(char poly[]);

⌨️ 快捷键说明

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