hwtLib.abstract.frame_utils package¶
Subpackages¶
Submodules¶
hwtLib.abstract.frame_utils.alignment_utils module¶
- class hwtLib.abstract.frame_utils.alignment_utils.FrameAlignmentUtils(word_bytes: int, out_offset=0)[source]¶
Bases:
object
- Variables
~.word_bytes – number of bytes in 1 output word
- _resolve_input_bytes_destinations(frames, input_cnt)[source]¶
- Parameters
frames – list of all possible frame formats generated from streams_to_all_possible_frame_formats
input_cnt – number of input streams
- create_frame(stream_i: int, byte_cnt: int, offset_out: int, offset_in: int) Tuple[Tuple[ByteSrcInfo]] [source]¶
- Parameters
byte_cnt – number of bytes in this frame
offset_out – how many empty bytes should be put before data in frame
offset_in – how many bytes skip from imput stream
- get_bytes_in_frame_info(offset_out, offset_in, chunk_size, chunk_cnt, already_has_body_words)[source]¶
- get_important_byte_cnts(offset_out: int, offset_in: int, chunk_size: int, chunk_cnt_min: Union[int, float], chunk_cnt_max: Union[int, float])[source]¶
Filter chunk cnt range, let only those values which affect the number of valid bytes in first/last word of frame and presence of words in body frame
- join_streams(stream_data: Tuple[Tuple[Tuple[ByteSrcInfo, ...], ...], ...], offset)[source]¶
Create output frame with specified offset from input stream
- Parameters
stream_data – list of data for each stream input (stream data is list of data words, data word is a tuple of ByteSrcInfo)
offset – offset of output stream
- hwtLib.abstract.frame_utils.alignment_utils.count_not_none(items: List[Optional[ByteSrcInfo]])[source]¶
- hwtLib.abstract.frame_utils.alignment_utils.freeze_frame(f: List[List[ByteSrcInfo]]) Tuple[Tuple[ByteSrcInfo, ...], ...] [source]¶
hwtLib.abstract.frame_utils.byte_src_info module¶
- class hwtLib.abstract.frame_utils.byte_src_info.ByteSrcInfo(stream_i: int, word_i: int, byte_i: int, is_from_last_input_word: bool)[source]¶
Bases:
object
Container for informations about byte in stream data
- Variables
~.stream_i – index of stream
~.word_i – index of word in frame
~.byte_i – index of byte in word
~.is_from_last_input_word – true if this byte comes from last word in input frame