Ring decoder: coarse-to-fine sync search (2x faster), lab phone at 960px, bench cpu throttling

This commit is contained in:
2026-08-16 18:27:34 +01:00
parent 55b5a53642
commit c6934080f1
4 changed files with 30 additions and 13 deletions
+2 -1
View File
@@ -26,7 +26,8 @@ async function start() {
async function loop() {
if (!running) return;
if (video.readyState >= 2) {
const k = Math.min(1, 1280 / video.videoWidth);
// 960 px is plenty for the locator and keeps capture cheap on low-end phones
const k = Math.min(1, 960 / video.videoWidth);
canvas.width = Math.round(video.videoWidth * k);
canvas.height = Math.round(video.videoHeight * k);
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);