File size: 763 Bytes
20857b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from enum import IntEnum, auto
from dataclasses import dataclass


class TokenType(IntEnum):
    """Every token in the stream carries a type label.

    The runtime uses this to dispatch tokens to the correct decoder,
    cache, or scheduler queue — enabling a unified token pipeline
    for video, audio, motion, metadata, and subtitles.
    """
    VISUAL = auto()
    AUDIO = auto()
    MOTION = auto()
    SCENE = auto()
    CAMERA = auto()
    OBJECT = auto()
    TEXTURE = auto()
    RESIDUAL = auto()
    METADATA = auto()
    SUBTITLE = auto()


@dataclass
class TypedTokenBatch:
    """A chunk of tokens with type and layer metadata."""
    chunk_index: int
    token_type: TokenType
    layer_index: int
    tokens: list[int]
    frame_count: int = 0