• R/O
  • SSH
  • HTTPS

reedsolomon: Commit


Commit MetaInfo

Revision32 (tree)
Time2009-08-01 12:25:50
Authorm-miyzaki

Log Message

(empty log message)

Change Summary

Incremental Difference

--- src/jp/sourceforge/reedsolomon/RsDecode.java (revision 31)
+++ src/jp/sourceforge/reedsolomon/RsDecode.java (revision 32)
@@ -46,18 +46,18 @@
4646 d ^= galois.mul(sg1[i], syn[n - i]);
4747 }
4848 if(d != 0) {
49- int logd = galois.toLog(d);
49+ final int logd = galois.toLog(d);
5050 for(int i = 0; i <= n; i++) {
5151 wk[i] = sg1[i] ^ galois.mulExp(sg0[i], logd);
5252 }
53- int js = n - m;
53+ final int js = n - m;
5454 if(js > jisu1) {
55- m = n - jisu1;
56- jisu1 = js;
5755 for(int i = 0; i <= jisu0; i++) {
5856 sg0[i] = galois.divExp(sg1[i], logd);
5957 }
60- jisu0 = jisu1;
58+ m = n - jisu1;
59+ jisu1 = js;
60+ jisu0 = js;
6161 }
6262 int[] tmp = sg1;
6363 sg1 = wk;
@@ -138,14 +138,12 @@
138138 */
139139 private void doForney(int[] data, int length, int[] pos, int[] sigma, int[] omega) {
140140 final int jisu = sigma.length - 1;
141- for(int i = 0; i < jisu; i++) {
142- int ps = pos[i];
141+ for(int ps: pos) {
143142 final int zlog = 255 - galois.toLog(ps);
144-
145143 int wz = zlog;
146144 int ov = omega[0];
147- for(int j = 1; j < jisu; j++) {
148- ov ^= galois.mulExp(omega[j], wz);
145+ for(int i = 1; i < jisu; i++) {
146+ ov ^= galois.mulExp(omega[i], wz);
149147 wz = (wz + zlog) % 255;
150148 }
151149
@@ -152,8 +150,8 @@
152150 final int zlog2 = (zlog * 2) % 255;
153151 wz = zlog2;
154152 int dv = sigma[1];
155- for(int j = 3; j <= jisu; j += 2) {
156- dv ^= galois.mulExp(sigma[j], wz);
153+ for(int i = 3; i <= jisu; i += 2) {
154+ dv ^= galois.mulExp(sigma[i], wz);
157155 wz = (wz + zlog2) % 255;
158156 }
159157
Show on old repository browser