MCPcopy Create free account
hub / github.com/devilsen/CZXing / FindErrorLocations

Function FindErrorLocations

czxing/src/main/cpp/zxing/src/ReedSolomonDecoder.cpp:71–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static std::vector<int>
72FindErrorLocations(const GenericGF& field, const GenericGFPoly& errorLocator)
73{
74 // This is a direct application of Chien's search
75 int numErrors = errorLocator.degree();
76 std::vector<int> res;
77 res.reserve(numErrors);
78
79 for (int i = 1; i < field.size() && Size(res) < numErrors; i++)
80 if (errorLocator.evaluateAt(i) == 0)
81 res.push_back(field.inverse(i));
82
83 if (Size(res) != numErrors)
84 return {}; // Error locator degree does not match number of roots
85
86 return res;
87}
88
89static std::vector<int>
90FindErrorMagnitudes(const GenericGF& field, const GenericGFPoly& errorEvaluator, const std::vector<int>& errorLocations)

Callers 1

ReedSolomonDecodeFunction · 0.70

Calls 7

SizeFunction · 0.70
degreeMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
evaluateAtMethod · 0.45
push_backMethod · 0.45
inverseMethod · 0.45

Tested by

no test coverage detected