Android Tutorial QR Code - how to construct a generator polynomial

The attached project will generate the Reed Solomon generator polynomials for 7, 10, 13, 15, 16, 17, 18, 20, 22, 24, 26, 28, and 30 error correction words that might be required for QR codes as per QR Code specification.

It presents the answers as:
1. A polynomial in coefficients of X and ALPHA
2. A polynomial in coefficients of X only (ALPHA coefficients converted to X)

Code for log/anti-log tables adapted from
http://en.wikiversity.org/wiki/Reed–Solomon_codes_for_coders

and code for generating the polynomial coefficients developed from the Thonky tutorial at
http://www.thonky.com/qr-code-tutorial/how-create-generator-polynomial/

EDIT 14 Nov 2014
Version 2 is far more efficient in terms of memory and execution time
 

Attachments

  • ReedSolomonGeneratorPolynomialV1.zip
    163.9 KB · Views: 788
  • ReedSolomonGeneratorPolynomialV2.zip
    8.6 KB · Views: 693
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
How to calculate the Version Information for a QR code (only applicable to versions 7 to 40) added to post #1. Make sure it is packed correctly when the bits are packed inside the QR Code (i.e in the correct order). Quoting from the Thonky tutorial at

http://www.thonky.com/qr-code-tutorial/format-version-information/

"...Bottom Left Version Information Block
The bottom left version information block is 3 pixels tall and 6 pixels wide. The following table explains how to arrange the bits of the version information string in the bottom-left version information area. The 0 represents the RIGHT-most (least significant) bit of the version information string, and the 17 represents the LEFT-most (most significant) bit of the version information string..."

"...Top Right Version Information Block
The top right version information block is 3 pixels wide and 6 pixels tall. The following table explains how to arrange the bits of the version information string in the top-right version information area. The 0 represents the RIGHT-most (least significant) bit of the version information string, and the 17 represents the LEFT-most (most significant) bit of the version information string..."
 

Attachments

  • QR_CodeVersionInformation.zip
    8.7 KB · Views: 604
  • QR_CodeFormatInformation.zip
    8.7 KB · Views: 555
Top