X-Git-Url: http://git.rot13.org/?p=zxing.git;a=blobdiff_plain;f=cpp%2Fcore%2Fsrc%2Fcommon%2Freedsolomon%2FReedSolomonDecoder.cpp;h=c387e972955a180d6711bc3110e5eeb7af8bae93;hp=40be310c1612884b06b8dcda52a80b9f962effa4;hb=d5d1e96fd3936324b31fe645acc4ce65956ec2e1;hpb=ca9d7b07d124cc454c38b984677c511476fd8d9b diff --git a/cpp/core/src/common/reedsolomon/ReedSolomonDecoder.cpp b/cpp/core/src/common/reedsolomon/ReedSolomonDecoder.cpp index 40be310c..c387e972 100644 --- a/cpp/core/src/common/reedsolomon/ReedSolomonDecoder.cpp +++ b/cpp/core/src/common/reedsolomon/ReedSolomonDecoder.cpp @@ -40,13 +40,20 @@ namespace reedsolomon { cout << "decode(): received = " << &received << ", array = " << received.array_ << " (" << received.array_->count_ << ")\n"; #endif + Ref poly(new GF256Poly(field, received)); + +#ifdef DEBUG cout << "decoding with poly " << *poly << "\n"; +#endif + ArrayRef syndromeCoefficients(new Array(twoS)); + #ifdef DEBUG cout << "syndromeCoefficients array = " << syndromeCoefficients.array_ << "\n"; #endif + bool noError = true; for (int i = 0; i < twoS; i++) { int eval = poly->evaluateAt(field.exp(i)); @@ -56,10 +63,12 @@ namespace reedsolomon { } } if (noError) { + #ifdef DEBUG cout << "before returning: syndromeCoefficients rc = " << syndromeCoefficients.array_->count_ << "\n"; #endif + return; } @@ -149,10 +158,12 @@ namespace reedsolomon { Ref sigma(t->multiply(inverse)); Ref omega(r->multiply(inverse)); +#ifdef DEBUG cout << "t = " << *t << "\n"; cout << "r = " << *r << "\n"; cout << "sigma = " << *sigma << "\n"; cout << "omega = " << *omega << "\n"; +#endif vector > result(2); result[0] = sigma;