Program Listing for File Rans.h

↰ Return to documentation for file (ADS/compression/Rans.h)

/*--------------------------------------------------------------------------*/
/*------------------------------ File Rans.h -------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef __ADS_Rans
 #define __ADS_Rans
                      /* self-identification: #endif constant */

/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/Contract.h"

#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <span>
#include <vector>

/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/

namespace ADS {

[[nodiscard]] inline std::vector< std::uint8_t > ransCompress(
                                          std::span< const std::uint8_t > in );

[[nodiscard]] inline std::vector< std::uint8_t > ransDecompress(
                                          std::span< const std::uint8_t > in );

[[nodiscard]] inline std::array< std::uint32_t , 256 > scaleFrequencies(
                       const std::array< std::uint64_t , 256 > & f , int b );

/*--------------------------------------------------------------------------*/

}  // end( namespace ADS )

/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/compression/impl/Rans.tpp"

/*--------------------------------------------------------------------------*/

#endif  /* Rans.h included */

/*--------------------------------------------------------------------------*/
/*---------------------------- End File Rans.h -----------------------------*/
/*--------------------------------------------------------------------------*/