Class GaliosFieldTableOps

java.lang.Object
boofcv.alg.fiducial.qrcode.GaliosFieldTableOps
Direct Known Subclasses:
GaliosFieldTableOps_U16, GaliosFieldTableOps_U8

public class GaliosFieldTableOps extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected int[]
     
    protected int[]
     
    protected int
     
    protected int
     
    protected int
     
    protected int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GaliosFieldTableOps(int numBits, int primitive)
    Specifies the GF polynomial
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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 primitive
    int
    multiply(int x, int y)
    Computes the following (x*y) mod primitive.
    int
    power(int x, int power)
    Computes the following x**power mod primitive
    int
    power_n(int x, int power)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 bits
      primitive - 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