From c51b1189e3d5353e842991f5859ddcea0f73e426 Mon Sep 17 00:00:00 2001 From: theuni Date: Mon, 24 Jan 2011 16:05:21 -0500 Subject: Merged cptspiff's code-reshuffle branch. Squashed commit due to build breakage during code-reshuffle history. Conflicts: xbmc/Util.cpp xbmc/cdrip/CDDARipper.cpp xbmc/filesystem/Directory.cpp xbmc/filesystem/File.cpp --- lib/UnrarXLib/rs.cpp | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 lib/UnrarXLib/rs.cpp (limited to 'lib/UnrarXLib/rs.cpp') diff --git a/lib/UnrarXLib/rs.cpp b/lib/UnrarXLib/rs.cpp new file mode 100644 index 0000000000..9eed7a28f4 --- /dev/null +++ b/lib/UnrarXLib/rs.cpp @@ -0,0 +1,143 @@ +#include "rar.hpp" + +#define Clean(D,S) {for (int I=0;I<(S);I++) (D)[I]=0;} + +RSCoder::RSCoder(int ParSize) +{ + RSCoder::ParSize=ParSize; + FirstBlockDone=false; + gfInit(); + pnInit(); +} + + +void RSCoder::gfInit() +{ + for (int I=0,J=1;I0;J--) + ShiftReg[J]=ShiftReg[J-1]^gfMult(GXPol[J],D); + ShiftReg[0]=gfMult(GXPol[0],D); + } + for (int I=0;I0;I--) + PolB[I]^=gfMult(M,PolB[I-1]); + + ErrCount=0; + for (int Root=MAXPAR-DataSize;Root0) + for (int I=0;I=0 && DataPos