video patch encoding with state machine

This commit is contained in:
minjaesong
2025-04-18 22:32:09 +09:00
parent d9af28eed2
commit 47468e4395
2 changed files with 103 additions and 58 deletions

View File

@@ -192,7 +192,7 @@ for (let f = 1; ; f++) {
// get the difference map
let patchEncodedSize = graphics.encodeIpf1d(ipfAreaOld, ipfAreaNew, ipfDelta, WIDTH, HEIGHT)
if (f < 2 || patchEncodedSize > WIDTH * HEIGHT * 0.90) patchEncodedSize = 0
if (f < 2 || f == TOTAL_FRAMES || patchEncodedSize > WIDTH * HEIGHT * 0.70) patchEncodedSize = 0
// decide whether or not the patch encoding should be used
let gzlen = gzip.compFromTo(