mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 11:59:58 -05:00
Initial community commit
This commit is contained in:
32
Src/external_dependencies/openmpt-trunk/include/unrar/rs.hpp
vendored
Normal file
32
Src/external_dependencies/openmpt-trunk/include/unrar/rs.hpp
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef _RAR_RS_
|
||||
#define _RAR_RS_
|
||||
|
||||
#define MAXPAR 255 // Maximum parity data size.
|
||||
#define MAXPOL 512 // Maximum polynomial degree.
|
||||
|
||||
class RSCoder
|
||||
{
|
||||
private:
|
||||
void gfInit();
|
||||
int gfMult(int a,int b);
|
||||
void pnInit();
|
||||
void pnMult(int *p1,int *p2,int *r);
|
||||
|
||||
int gfExp[MAXPOL]; // Galois field exponents.
|
||||
int gfLog[MAXPAR+1]; // Galois field logarithms.
|
||||
|
||||
int GXPol[MAXPOL*2]; // Generator polynomial g(x).
|
||||
|
||||
int ErrorLocs[MAXPAR+1],ErrCount;
|
||||
int Dnm[MAXPAR+1];
|
||||
|
||||
int ParSize; // Parity bytes size and so the number of recovery volumes.
|
||||
int ELPol[MAXPOL]; // Error locator polynomial.
|
||||
bool FirstBlockDone;
|
||||
public:
|
||||
void Init(int ParSize);
|
||||
void Encode(byte *Data,int DataSize,byte *DestData);
|
||||
bool Decode(byte *Data,int DataSize,int *EraLoc,int EraSize);
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user