RPNX::Compress
Self-contained C++20 compression and ZIP library
 
Loading...
Searching...
No Matches
bzip2.hpp File Reference

Native bzip2 block transforms, entropy coding, and stream adapters. More...

#include <algorithm>
#include <array>
#include <bit>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <limits>
#include <optional>
#include <span>
#include <type_traits>
#include <utility>
#include <vector>
#include <rpnx/compression/implementation/io.hpp>

Go to the source code of this file.

Classes

struct  rpnx::compression::bzip2_codec::huffman_node
 One node in a canonical bzip2 Huffman decoding tree. More...
 
struct  rpnx::compression::bzip2_codec::huffman_table
 Canonical bzip2 Huffman decoding tree. More...
 
struct  rpnx::compression::bzip2_codec::burrows_wheeler_result
 Burrows-Wheeler last column and its original rotation index. More...
 
class  rpnx::compression::bzip2_codec::iterator_bit_writer< output_iterator >
 MSB-first bit writer backed by an STL output iterator. More...
 
class  rpnx::compression::bzip2_codec::iterator_bit_reader< byte_reader_type >
 MSB-first bit reader backed by a single-pass byte reader. More...
 

Namespaces

namespace  rpnx::compression
 Facilities for creating and decoding supported compressed streams.
 
namespace  rpnx::compression::bzip2_codec
 Internal implementation of bzip2 compression and decompression.
 

Functions

std::uint32_t rpnx::compression::bzip2_codec::crc32 (std::span< std::byte const > input) noexcept
 Computes the non-reflected CRC-32 variant used by bzip2 blocks.
 
huffman_table rpnx::compression::bzip2_codec::build_huffman_table (std::span< std::uint8_t const > lengths)
 Builds a canonical Huffman tree from bzip2 code lengths.
 
template<typename reader_type>
std::uint16_t rpnx::compression::bzip2_codec::decode_huffman_symbol (reader_type &reader, huffman_table const &table)
 Decodes one symbol with a canonical bzip2 Huffman tree.
 
std::vector< std::byte > rpnx::compression::bzip2_codec::encode_first_run_length (std::span< std::byte const > input)
 Applies bzip2's first run-length transform to one source block.
 
burrows_wheeler_result rpnx::compression::bzip2_codec::burrows_wheeler_transform (std::span< std::byte const > input)
 Sorts cyclic rotations and produces the Burrows-Wheeler last column.
 
template<typename writer_type>
void rpnx::compression::bzip2_codec::compress_block (writer_type &writer, std::span< std::byte const > input, std::uint32_t &combined_crc)
 Encode one bzip2 block with deterministic canonical Huffman tables.
 
template<typename reader_type>
std::vector< std::byte > rpnx::compression::bzip2_codec::decompress_block (reader_type &reader, std::size_t block_size_limit, std::size_t maximum_output_size, std::uint32_t &combined_crc)
 Decode one bzip2 block after its block magic.
 
template<std::input_iterator input_iterator, std::sentinel_for< input_iterator > sentinel, typename output_iterator>
output_iterator rpnx::compression::bzip2_codec::compress (input_iterator first, sentinel last, output_iterator output, compression_options const &options)
 Compresses an iterator range as a native bzip2 stream.
 
template<std::input_iterator input_iterator, std::sentinel_for< input_iterator > sentinel, typename output_iterator>
output_iterator rpnx::compression::bzip2_codec::decompress (input_iterator first, sentinel last, output_iterator output, decompression_options const &options)
 Decompresses one or more native bzip2 streams.
 

Detailed Description

Native bzip2 block transforms, entropy coding, and stream adapters.

Definition in file bzip2.hpp.