Commit 84a8dde
committed
Optimize QR codec and fallback decoding
Add opt-in decodeQR moreEffort retries for rotated, cropped, and upscaled image candidates while preserving diagnostic coordinates and user callback errors.
Speed up codec hot paths with direct bit I/O, cached templates/zigzag paths/RS divisors, faster grayscale stats, monochrome downsampling, and column penalty scans.
benchmark/index.ts vs main: small encodes up to 3.4x faster, large encodes 2.3x faster, generated decodes 1.5-1.7x faster.
Expand decode coverage with PNG vectors, more successful fixtures, and tests for fallback diagnostics, downsampling, and encoder validation.1 parent 5967ce9 commit 84a8dde
6 files changed
Lines changed: 1212 additions & 261 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
260 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
0 commit comments