Commit graph

10 commits

Author SHA1 Message Date
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
YAMAMOTO Takashi
4d6675ac17 README.md: Update for inspect-opencv 2021-05-17 08:44:08 +09:00
YAMAMOTO Takashi
6fb24d26c8 README.md: document requirement on make command 2021-04-17 22:35:46 +09:00
YAMAMOTO Takashi
a3623ea4f4 README.md: Update extra dependencies for each programs 2021-04-08 09:49:14 +09:00
YAMAMOTO Takashi
a2b1358580 README.md: Update for quirc-demo-opencv 2021-04-08 09:49:11 +09:00
YAMAMOTO Takashi
f10e7dc39a README.md: mention requirements of each test/demo 2021-03-23 09:08:51 +09:00
Claudio Felber
8e8a638a5f Update README.md with how to use quirc_flip() 2020-09-22 12:23:17 +02:00
Alexandre Perrin
2e8c4ce7bc Add a README note about building with DQUIRC_MAX_REGIONS
Question about decoding large images has come up several times, let's
document it better.
2019-10-23 09:37:24 +02:00
Alexandre Perrin
b77da026c9 README.md formatting tweaks 2019-09-25 11:07:20 +02:00
Roger Wetzel
3046f4c710
Rename README to README.md
So this Readme gets rendered nicely.
2019-09-03 19:41:56 +02:00
Renamed from README (Browse further)