Class ReidSolomonCodes

java.lang.Object
boofcv.alg.fiducial.qrcode.ReidSolomonCodes

public class ReidSolomonCodes
extends Object
TODO Summarize

Code and code comments based on the tutorial at [1].

[1] Reed-Solomon Codes for Coders Viewed on September 28, 2017

  • Constructor Details

    • ReidSolomonCodes

      public ReidSolomonCodes​(int numBits, int primitive)
  • Method Details

    • setDegree

      public void setDegree​(int degree)
    • computeECC

      public void computeECC​(DogArray_I8 input, DogArray_I8 output)
      Given the input message compute the error correction code for it
      Parameters:
      input - Input message. Modified internally then returned to its initial state
      output - error correction code
    • correct

      public boolean correct​(DogArray_I8 input, DogArray_I8 ecc)
      Decodes the message and performs any necessary error correction
      Parameters:
      input - (Input) Corrupted Message (Output) corrected message
      ecc - (Input) error correction code for the message
      Returns:
      true if it was successful or false if it failed
    • findErrorLocations_BruteForce

      public boolean findErrorLocations_BruteForce​(DogArray_I8 errorLocator, int messageLength, DogArray_I32 locations)
      Creates a list of bytes that have errors in them
      Parameters:
      errorLocator - (Input) Error locator polynomial. Coefficients from small to large.
      messageLength - (Input) Length of the message + ecc.
      locations - (Output) locations of bytes in message with errors.
    • generator

      public void generator​(int degree)
      Creates the generator function with the specified polynomial degree. The generator function is composed of factors of (x-a_n) where a_n is a power of 2.
      g4(x) = (x - α0) (x - α1) (x - α2) (x - α3) = 01 x4 + 0f x3 + 36 x2 + 78 x + 40
    • getTotalErrors

      public int getTotalErrors()
      Number of bit errors