Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rs.hpp « Original « Rar29 « Compress « 7zip - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2f099f0060e75e8d7a24485f9e832d686143a6db (plain)
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
#ifndef _RAR_RS_
#define _RAR_RS_

#define MAXPAR 255
#define MAXPOL 512

class RSCoder
{
  private:
    void gfInit();
    int gfMult(int a,int b);
    void pnInit();
    void pnMult(int *p1,int *p2,int *r);

    int gfExp[MAXPOL];
    int gfLog[MAXPAR+1];

    int GXPol[MAXPOL*2];

    int ErrorLocs[MAXPAR+1],ErrCount;
    int Dn[MAXPAR+1];

    int ParSize;
    int PolB[MAXPOL];
    bool FirstBlockDone;
  public:
    RSCoder(int ParSize);
    void Encode(byte *Data,int DataSize,byte *DestData);
    bool Decode(byte *Data,int DataSize,int *EraLoc,int EraSize);
};

#endif