25 lines
858 B
Python
25 lines
858 B
Python
"""Полный доступный путь символы → CRC → стирания → видеокадр."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import hashlib
|
|
import json
|
|
|
|
import numpy as np
|
|
import pytest
|
|
|
|
pytest.importorskip("numba")
|
|
|
|
from tools.video004_pipeline_benchmark import MANIFEST, SIGNAL, decode
|
|
|
|
|
|
def test_four_frames_exact_after_four_packet_erasures() -> None:
|
|
manifest = json.loads(MANIFEST.read_text(encoding="utf-8"))
|
|
received = np.load(SIGNAL, allow_pickle=False)
|
|
assert hashlib.sha256(received.tobytes()).hexdigest() == manifest["signal_sha256"]
|
|
result = decode(received, "numba")
|
|
assert result["packet_sha256"] == manifest["expected_packet_sha256"]
|
|
assert result["frame_sha256"] == manifest["expected_frame_sha256"]
|
|
assert result["parity_recoveries"] == 4
|
|
assert result["unrecoverable_blocks"] == 0
|