Package boofcv.alg.fiducial.qrcode
Class GaliosFieldTableOps
java.lang.Object
boofcv.alg.fiducial.qrcode.GaliosFieldTableOps
- Direct Known Subclasses:
GaliosFieldTableOps_U16
,GaliosFieldTableOps_U8
Precomputed look up table for performing operations on GF polynomials of the specified degree.
Code and code comments based on the tutorial at [1].
[1] Reed-Solomon Codes for Coders Viewed on September 28, 2017
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
divide
(int x, int y) Computes the following the value of output such that:int
inverse
(int x) Computes the following 2**(max-x) mod primitiveint
multiply
(int x, int y) Computes the following (x*y) mod primitive.int
power
(int x, int power) Computes the following x**power mod primitiveint
power_n
(int x, int power)
-
Field Details
-
max_value
protected int max_value -
num_values
protected int num_values -
numBits
protected int numBits -
primitive
protected int primitive -
exp
protected int[] exp -
log
protected int[] log
-
-
Constructor Details
-
GaliosFieldTableOps
public GaliosFieldTableOps(int numBits, int primitive) Specifies the GF polynomial- Parameters:
numBits
- Number of bits needed to describe the polynomial. GF(2**8) = 8 bitsprimitive
- The primitive polynomial
-
-
Method Details
-
multiply
public int multiply(int x, int y) Computes the following (x*y) mod primitive. This is done by -
divide
public int divide(int x, int y) Computes the following the value of output such that:
divide(multiply(x,y),y)==x for any x and any nonzero y.
-
power
public int power(int x, int power) Computes the following x**power mod primitive -
power_n
public int power_n(int x, int power) -
inverse
public int inverse(int x) Computes the following 2**(max-x) mod primitive
-