Ring decoder: coarse-to-fine sync search (2x faster), lab phone at 960px, bench cpu throttling
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user