ZBar bar code reader . http://zbar.sourceforge.net/ ZBar is licensed under the GNU LGPL 2.1 to enable development of both open source and commercial projects.

Dependents:   GR-PEACH_Camera_in_barcode levkov_ov7670

LICENSE

The ZBar Bar Code Reader is Copyright (C) 2007-2009 Jeff Brown <spadix@users.sourceforge.net> The QR Code reader is Copyright (C) 1999-2009 Timothy B. Terriberry <tterribe@xiph.org>

You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

ISAAC is based on the public domain implementation by Robert J. Jenkins Jr., and is itself public domain.

Portions of the bit stream reader are copyright (C) The Xiph.Org Foundation 1994-2008, and are licensed under a BSD-style license.

The Reed-Solomon decoder is derived from an implementation (C) 1991-1995 Henry Minsky (hqm@ua.com, hqm@ai.mit.edu), and is licensed under the LGPL with permission.

Committer:
RyoheiHagimoto
Date:
Tue Apr 19 02:19:39 2016 +0000
Revision:
1:500d42699c34
Parent:
0:56c5742b9e2b
Add copying.txt and license.txt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RyoheiHagimoto 0:56c5742b9e2b 1 /*Copyright (C) 1991-1995 Henry Minsky (hqm@ua.com, hqm@ai.mit.edu)
RyoheiHagimoto 0:56c5742b9e2b 2 Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org)
RyoheiHagimoto 0:56c5742b9e2b 3 You can redistribute this library and/or modify it under the terms of the
RyoheiHagimoto 0:56c5742b9e2b 4 GNU Lesser General Public License as published by the Free Software
RyoheiHagimoto 0:56c5742b9e2b 5 Foundation; either version 2.1 of the License, or (at your option) any later
RyoheiHagimoto 0:56c5742b9e2b 6 version.*/
RyoheiHagimoto 0:56c5742b9e2b 7 #if !defined(_qrcode_rs_H)
RyoheiHagimoto 0:56c5742b9e2b 8 # define _qrcode_rs_H (1)
RyoheiHagimoto 0:56c5742b9e2b 9
RyoheiHagimoto 0:56c5742b9e2b 10 /*This is one of 16 irreducible primitive polynomials of degree 8:
RyoheiHagimoto 0:56c5742b9e2b 11 x**8+x**4+x**3+x**2+1.
RyoheiHagimoto 0:56c5742b9e2b 12 Under such a polynomial, x (i.e., 0x02) is a generator of GF(2**8).
RyoheiHagimoto 0:56c5742b9e2b 13 The high order 1 bit is implicit.
RyoheiHagimoto 0:56c5742b9e2b 14 From~\cite{MD88}, Ch. 5, p. 275 by Patel.
RyoheiHagimoto 0:56c5742b9e2b 15 @BOOK{MD88,
RyoheiHagimoto 0:56c5742b9e2b 16 author="C. Dennis Mee and Eric D. Daniel",
RyoheiHagimoto 0:56c5742b9e2b 17 title="Video, Audio, and Instrumentation Recording",
RyoheiHagimoto 0:56c5742b9e2b 18 series="Magnetic Recording",
RyoheiHagimoto 0:56c5742b9e2b 19 volume=3,
RyoheiHagimoto 0:56c5742b9e2b 20 publisher="McGraw-Hill Education",
RyoheiHagimoto 0:56c5742b9e2b 21 address="Columbus, OH",
RyoheiHagimoto 0:56c5742b9e2b 22 month=Jun,
RyoheiHagimoto 0:56c5742b9e2b 23 year=1988
RyoheiHagimoto 0:56c5742b9e2b 24 }*/
RyoheiHagimoto 0:56c5742b9e2b 25 #define QR_PPOLY (0x1D)
RyoheiHagimoto 0:56c5742b9e2b 26
RyoheiHagimoto 0:56c5742b9e2b 27 /*The index to start the generator polynomial from (0...254).*/
RyoheiHagimoto 0:56c5742b9e2b 28 #define QR_M0 (0)
RyoheiHagimoto 0:56c5742b9e2b 29
RyoheiHagimoto 0:56c5742b9e2b 30 typedef struct rs_gf256 rs_gf256;
RyoheiHagimoto 0:56c5742b9e2b 31
RyoheiHagimoto 0:56c5742b9e2b 32 struct rs_gf256{
RyoheiHagimoto 0:56c5742b9e2b 33 /*A logarithm table in GF(2**8).*/
RyoheiHagimoto 0:56c5742b9e2b 34 unsigned char log[256];
RyoheiHagimoto 0:56c5742b9e2b 35 /*An exponential table in GF(2**8): exp[i] contains x^i reduced modulo the
RyoheiHagimoto 0:56c5742b9e2b 36 irreducible primitive polynomial used to define the field.
RyoheiHagimoto 0:56c5742b9e2b 37 The extra 256 entries are used to do arithmetic mod 255, since some extra
RyoheiHagimoto 0:56c5742b9e2b 38 table lookups are generally faster than doing the modulus.*/
RyoheiHagimoto 0:56c5742b9e2b 39 unsigned char exp[511];
RyoheiHagimoto 0:56c5742b9e2b 40 };
RyoheiHagimoto 0:56c5742b9e2b 41
RyoheiHagimoto 0:56c5742b9e2b 42 /*Initialize discrete logarithm tables for GF(2**8) using a given primitive
RyoheiHagimoto 0:56c5742b9e2b 43 irreducible polynomial.*/
RyoheiHagimoto 0:56c5742b9e2b 44 void rs_gf256_init(rs_gf256 *_gf,unsigned _ppoly);
RyoheiHagimoto 0:56c5742b9e2b 45
RyoheiHagimoto 0:56c5742b9e2b 46 /*Corrects a codeword with _ndata<256 bytes, of which the last _npar are parity
RyoheiHagimoto 0:56c5742b9e2b 47 bytes.
RyoheiHagimoto 0:56c5742b9e2b 48 Known locations of errors can be passed in the _erasures array.
RyoheiHagimoto 0:56c5742b9e2b 49 Twice as many (up to _npar) errors with a known location can be corrected
RyoheiHagimoto 0:56c5742b9e2b 50 compared to errors with an unknown location.
RyoheiHagimoto 0:56c5742b9e2b 51 Returns the number of errors corrected if successful, or a negative number if
RyoheiHagimoto 0:56c5742b9e2b 52 the message could not be corrected because too many errors were detected.*/
RyoheiHagimoto 0:56c5742b9e2b 53 int rs_correct(const rs_gf256 *_gf,int _m0,unsigned char *_data,int _ndata,
RyoheiHagimoto 0:56c5742b9e2b 54 int _npar,const unsigned char *_erasures,int _nerasures);
RyoheiHagimoto 0:56c5742b9e2b 55
RyoheiHagimoto 0:56c5742b9e2b 56 /*Create an _npar-coefficient generator polynomial for a Reed-Solomon code with
RyoheiHagimoto 0:56c5742b9e2b 57 _npar<256 parity bytes.*/
RyoheiHagimoto 0:56c5742b9e2b 58 void rs_compute_genpoly(const rs_gf256 *_gf,int _m0,
RyoheiHagimoto 0:56c5742b9e2b 59 unsigned char *_genpoly,int _npar);
RyoheiHagimoto 0:56c5742b9e2b 60
RyoheiHagimoto 0:56c5742b9e2b 61 /*Adds _npar<=_ndata parity bytes to an _ndata-_npar byte message.
RyoheiHagimoto 0:56c5742b9e2b 62 _data must contain room for _ndata<256 bytes.*/
RyoheiHagimoto 0:56c5742b9e2b 63 void rs_encode(const rs_gf256 *_gf,unsigned char *_data,int _ndata,
RyoheiHagimoto 0:56c5742b9e2b 64 const unsigned char *_genpoly,int _npar);
RyoheiHagimoto 0:56c5742b9e2b 65
RyoheiHagimoto 0:56c5742b9e2b 66 #endif
RyoheiHagimoto 0:56c5742b9e2b 67