quirc/lib
Ivan Grokhotkov cc67312433
Add an option to use single-precision floating point in calculations
On some platforms, such as microcontrollers with a single-precision
FPU, operations on double type can be significantly slower compared
to the float type. For example, on ESP32-S3 microcontroller, decoding
a QR code of a certain size may take 1700ms when 'double' is used and
just 250ms when 'float' is used.

This commit adds two options to allow for such optimizations:

- QUIRC_FLOAT_TYPE: if defined, it is the type name to use in floating
  point calculations. Can be set, for example, using:
    CFLAGS += -DQUIRC_FLOAT_TYPE=float

- QUIRC_USE_TGMATH: if defined, Quirc will internally use <tgmath.h>
  header, instead of <math.h>. This C99-or-later header allows the
  program to call type-generic functions, such as 'sqrt', and the
  calls will be dispatched to the correct implementation (sqrtf, sqrt,
  sqrtl) depending on the actual argument type. Without setting this
  option, the benefit of -DQUIRC_FLOAT_TYPE=float would be limited as
  the double-precision versions of math functions would still be used.

The change is backwards compatible with existing applications. If
these macros are not defined, the behavior is the same as before.
2023-03-21 02:04:39 +01:00
..
decode.c Fix stack corruption on oversized QR codes. 2021-10-08 19:40:36 +13:00
identify.c Add an option to use single-precision floating point in calculations 2023-03-21 02:04:39 +01:00
quirc.c quirc_resize: Make this a bit more careful about integer overflows 2021-05-11 11:05:58 +09:00
quirc.h Support horizontally flipped QR-codes according to ISO 18004:2015 2020-09-21 16:54:55 +02:00
quirc_internal.h Add an option to use single-precision floating point in calculations 2023-03-21 02:04:39 +01:00
version_db.c Deinterleave blocks correct. 2016-12-28 15:37:18 +13:00