You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dotcode: Score each mask and its lit-edge variant in a single pass
The lit-edge variant of a masked symbol differs only at the six
corner-adjacent edge dots, so evalsymbol derives its score from the
same traversal: each side scan's tally is extended by the dots on that
side, the blank-group scans keep a second accumulator that breaks at
the columns and rows containing a dot, and the void count is adjusted
by rescoring just the positions whose neighbourhood contains a dot.
Copy file name to clipboardExpand all lines: CHANGES
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
XXXX-XX-XX
1
+
2026-07-05
2
2
3
-
* The performance of the DotCode encoder was improved by sharing a single codeword placement walk between the mask candidates and by deriving each candidate's error correction codewords from those of the unmasked message.
3
+
* The performance of the DotCode encoder was improved by sharing a single codeword placement walk between the mask candidates, by deriving each candidate's error correction codewords from those of the unmasked message, and by scoring each candidate together with its lit-edge variant in a single evaluation pass.
4
4
* Profiling hooks were added for the QR Code mask application and evaluation phases and for the renmatrix region tracing sub-phases.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -806,6 +806,7 @@ from the clone passed to gs1-cc.
806
806
- Skip a transform whose result is a known no-op rather than computing it (the identity mask yields an all-zero layer, so evaluate the unmasked symbol directly; see `hanxin`).
807
807
- Classify positions in a hot scan by indexing a static string with a small per-position code, spilling to variables only on the rare matching branch (stem-corner detection in the region trace; see `renmatrix`).
808
808
- Hoist a traversal whose result is candidate-invariant out of the per-candidate loop (the codeword placement walk visits vacant positions in a mask-independent order, so resolve the position sequence once and share it between masks; see `dotcode`).
809
+
- Score a symbol together with a variant that differs at a few known positions by keeping a second set of tallies in the same traversal, adjusted only where the variant differs (the lit-edge variant in mask evaluation; see `dotcode`).
809
810
810
811
**Conditional Assignment Pattern**
811
812
@@ -1137,7 +1138,12 @@ create a hooks entries named like `qrcode.before`.
1137
1138
1138
1139
### Profiling Results
1139
1140
1140
-
Performance enhancements are welcome, but significant gains are hard won. Large 2D symbols have different bottlenecks: QR Code, Han Xin and DotCode are mask evaluation bound (DotCode's cost roughly doubles when the score threshold fails and the lit-edge variants are re-scored); Data Matrix is RSEC bound (mitigated by FIFO caches). Aztec splits roughly evenly between input encoding and RSEC. PDF417 and MicroPDF417 are fast enough that no single phase dominates. See encoder source for attempted optimizations.
1141
+
Performance enhancements are welcome, but significant gains are hard won.
1142
+
Large 2D symbols have different bottlenecks: QR Code, Han Xin and DotCode are
1143
+
mask evaluation bound; Data Matrix is RSEC bound (mitigated by FIFO caches).
1144
+
Aztec splits roughly evenly between input encoding and RSEC. PDF417 and
1145
+
MicroPDF417 are fast enough that no single phase dominates. See encoder
0 commit comments