Complete VIDEO-001 through VIDEO-004 software video studies

This commit is contained in:
LittleSam129
2026-09-16 18:27:35 +03:00
parent af7c05f2da
commit 95f664076a
403 changed files with 392009 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
"""Усиление опорного кадра проверяется двумя потерями в одном блоке."""
from __future__ import annotations
import json
from tools.video004_transport import (
BASELINE_160, BASELINE_320, CODEC_RESULTS, _frames, simulate,
)
def test_double_keyframe_loss_needs_two_parity_symbols() -> None:
codec = json.loads(CODEC_RESULTS.read_text(encoding="utf-8"))
baseline = json.loads(BASELINE_320.read_text(encoding="utf-8"))
baseline_160 = json.loads(BASELINE_160.read_text(encoding="utf-8"))
combined, _ = _frames("NORMAL", 640, 360, 10, baseline["windows"][0],
codec, baseline_160)
frames = [frame for frame in combined if frame.stream_id == 0x56303334]
base = simulate(frames, 10, "2/3", 8, 1, ("keyframe_double", 2))
boosted = simulate(frames, 10, "2/3", 8, 1, ("keyframe_double", 2),
keyframe_boost=True)
assert base["displayed_frames"] == 55
assert base["unrecoverable_blocks"] == 1
assert boosted["displayed_frames"] == 60
assert boosted["parity_recoveries"] == 2