File: normEncoderRS8.h

package info (click to toggle)
norm 1.5.9%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 9,664 kB
  • sloc: cpp: 123,494; xml: 7,536; tcl: 5,460; makefile: 3,441; python: 1,898; java: 1,750; ansic: 642; sh: 21; csh: 8
file content (69 lines) | stat: -rw-r--r-- 2,203 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef _NORM_ENCODER_RS8
#define _NORM_ENCODER_RS8

#include "normEncoder.h"
#include "protoDefs.h"  // for UINT16

class NormEncoderRS8 : public NormEncoder
{
    public:
	    NormEncoderRS8();
	    ~NormEncoderRS8();
        
        virtual bool Init(unsigned int numData, unsigned int numParity, UINT16 vectorSize);
        virtual void Destroy();
        virtual void Encode(unsigned int segmentId, const char* dataVector, char** parityVectorList);    
        
        unsigned int GetNumData() 
            {return ndata;}
	    unsigned int GetNumParity() 
            {return npar;}
	    unsigned int GetVectorSize() 
            {return vector_size;}
	
    private:
        unsigned int    ndata;        // max data pkts per block (k)
	    unsigned int    npar;	      // No. of parity packets (n-k)
	    unsigned int    vector_size;  // Size of biggest vector to encode
        UINT8*          enc_matrix;
        
};  // end class NormEncoder


class NormDecoderRS8 : public NormDecoder
{
    public:
	    NormDecoderRS8();
        virtual ~NormDecoderRS8();
        virtual bool Init(unsigned int numData, unsigned int numParity, UINT16 vectorSize);
        virtual void Destroy();
        virtual int Decode(char** vectorList, unsigned int numData,  unsigned int erasureCount, unsigned int* erasureLocs);
        
        unsigned int GetNumParity() 
            {return npar;}
	    unsigned int GetVectorSize() 
            {return vector_size;}
        
    private:
        bool InvertDecodingMatrix();   // used in Decode() method
            
        unsigned int    ndata;        // max data pkts per block (k)
	    unsigned int    npar;	      // No. of parity packets (n-k)
	    UINT16          vector_size;  // Size of biggest vector to encode
        UINT8*          enc_matrix;
        UINT8*          dec_matrix;
        unsigned int*   parity_loc;
        
        // These "inv_" members are used in InvertDecodingMatrix()
        unsigned int*   inv_ndxc;
        unsigned int*   inv_ndxr;
        unsigned int*   inv_pivt;   
        UINT8*          inv_id_row;
        UINT8*          inv_temp_row;
             
};  // end class NormDecoder




#endif // _NORM_ENCODER_RS8