source: icGREP/icgrep-devel/QA/lz4d_ext_dep/lz4d.py @ 5908

Last change on this file since 5908 was 5864, checked in by xwa163, 20 months ago

Add LZ4D extract deposit related kernel, target and test cases

File size: 648 bytes
Line 
1import decoder.FrameDecoder as FrameDecoder
2import decoder.BlockDecoder as BlockDecoder
3import decoder.SequenceDecoder as SequenceDecoder
4
5class LZ4Decoder:
6    def decode(self, input_file, output_file, options):
7        with open(input_file, "rb") as f:
8            file_content = f.read()
9
10        frame_info = FrameDecoder.decode(file_content)
11        block_info = BlockDecoder.decode(file_content, frame_info['block_start'], frame_info['has_block_checksum'], frame_info['has_content_checksum'])
12        result = SequenceDecoder.decode(file_content, block_info, options)
13        with open(output_file, 'wb') as f:
14            f.write(result)
15
16
17
Note: See TracBrowser for help on using the repository browser.