ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
Rans.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*------------------------------ File Rans.h -------------------------------*/
3
/*--------------------------------------------------------------------------*/
63
/*--------------------------------------------------------------------------*/
64
/*----------------------------- DEFINITIONS --------------------------------*/
65
/*--------------------------------------------------------------------------*/
66
67
#ifndef __ADS_Rans
68
#define __ADS_Rans
69
/* self-identification: #endif constant */
70
71
/*--------------------------------------------------------------------------*/
72
/*------------------------------ INCLUDES ----------------------------------*/
73
/*--------------------------------------------------------------------------*/
74
75
#include "
ADS/Contract.h
"
76
77
#include <algorithm>
78
#include <array>
79
#include <cstddef>
80
#include <cstdint>
81
#include <span>
82
#include <vector>
83
84
/*--------------------------------------------------------------------------*/
85
/*--------------------------- NAMESPACE ------------------------------------*/
86
/*--------------------------------------------------------------------------*/
87
88
namespace
ADS
89
{
90
119
[[nodiscard]]
inline
std::vector< std::uint8_t >
120
ransCompress
( std::span< const std::uint8_t > in );
121
143
[[nodiscard]]
inline
std::vector< std::uint8_t >
144
ransDecompress
( std::span< const std::uint8_t > in );
145
169
[[nodiscard]]
inline
std::array< std::uint32_t , 256 >
170
scaleFrequencies
(
const
std::array< std::uint64_t , 256 > & f ,
int
b );
171
172
/*--------------------------------------------------------------------------*/
173
174
}
// end( namespace ADS )
175
176
/*--------------------------------------------------------------------------*/
177
/*-------------------------- IMPLEMENTATION --------------------------------*/
178
/*--------------------------------------------------------------------------*/
179
180
#include "ADS/compression/impl/Rans.tpp"
181
182
/*--------------------------------------------------------------------------*/
183
184
#endif
/* Rans.h included */
185
186
/*--------------------------------------------------------------------------*/
187
/*---------------------------- End File Rans.h -----------------------------*/
188
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::ransCompress
std::vector< std::uint8_t > ransCompress(std::span< const std::uint8_t > in)
the rANS code of order 0 of the bytes of in, with the frequencies and the size
ADS::scaleFrequencies
std::array< std::uint32_t, 256 > scaleFrequencies(const std::array< std::uint64_t, 256 > &f, int b)
the frequencies scaled to sum to , each positive one kept positive
ADS::ransDecompress
std::vector< std::uint8_t > ransDecompress(std::span< const std::uint8_t > in)
the bytes that ransCompress() coded in in
ADS
Definition
ADT.h:96
ADS
compression
Rans.h
Generated by
1.17.0