engine: fix preset F frame index at byte 1032 to f & 7u

NGX stores the frame index modulo 8 (0-7 repeating), not the raw frame
count. The raw count matched only the first eight frames and made every
later frame differ.
This commit is contained in:
woutermans committed 2026-10-14 19:42:39 +02:00
1 parent af450a92b9
commit 51afe5ea39
1 file changed
+3 -1
+3 -1
View File
@@ -521,7 +521,9 @@ struct R2Engine {
putMat(p, 644, rc); putMat(p, 708, clip); putMat(p, 772, clip); putMat(p, 836, inv); putMat(p, 644, rc); putMat(p, 708, clip); putMat(p, 772, clip); putMat(p, 836, inv);
putMat(p, 900, mul(toNdc, inv)); putMat(p, 964, mul(rc, toPixels)); putMat(p, 900, mul(toNdc, inv)); putMat(p, 964, mul(rc, toPixels));
putF(p, 804, settings.jitter[0] * (2.0f / fr)); putF(p, 808, -settings.jitter[1] * (2.0f / fh)); putF(p, 804, settings.jitter[0] * (2.0f / fr)); putF(p, 808, -settings.jitter[1] * (2.0f / fh));
put32(p, 1032, f); // byte 1032: NGX's frame index modulo 8 (0 - 7, then 0 again; 12-frame jitter capture, 2026-10-14). The raw
// count matched the first eight frames only and made every later frame differ
put32(p, 1032, f & 7u);
for (size_t i = 0; i < postBlocks.size(); ++i) { for (size_t i = 0; i < postBlocks.size(); ++i) {
auto& o = postBlocks[i]; auto& o = postBlocks[i];
putF(o, 140, settings.jitter[0]); putF(o, 144, settings.jitter[1]); putF(o, 140, settings.jitter[0]); putF(o, 144, settings.jitter[1]);