GNU Radio 2.x: fixed.h Source File

Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

# fixed.h

Go to the documentation of this file.

    00001 /* Configure the RS codec with fixed parameters for CCSDS standard
    00002  * (255,223) code over GF(256). Note: the conventional basis is still
    00003  * used; the dual-basis mappings are performed in [en|de]code_rs_ccsds.c
    00004  *
    00005  * Copyright 2002 Phil Karn, KA9Q
    00006  * May be used under the terms of the GNU General Public License (GPL)
    00007  */
    00008 #define DTYPE unsigned char
    00009
    00010 static inline int mod255(int x){
    00011   while (x >= 255) {
    00012     x -= 255;
    00013     x = (x >> 8) + (x & 255);
    00014   }
    00015   return x;
    00016 }
    00017 #define MODNN(x) mod255(x)
    00018
    00019 extern unsigned char CCSDS_alpha_to[];
    00020 extern unsigned char CCSDS_index_of[];
    00021 extern unsigned char CCSDS_poly[];
    00022
    00023 #define MM 8
    00024 #define NN 255
    00025 #define ALPHA_TO CCSDS_alpha_to
    00026 #define INDEX_OF CCSDS_index_of
    00027 #define GENPOLY CCSDS_poly
    00028 #define NROOTS 32
    00029 #define FCR 112
    00030 #define PRIM 11
    00031 #define IPRIM 116
    00032 #define A0 (NN)
    00033
    00034 #define ENCODE_RS encode_rs_8
    00035 #define DECODE_RS decode_rs_8
    00036
    00037 void ENCODE_RS(DTYPE *data,DTYPE *parity);
    00038 int DECODE_RS(DTYPE *data, int *eras_pos, int no_eras);