Program Listing for File StreamVByte.h

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

/*--------------------------------------------------------------------------*/
/*--------------------------- File StreamVByte.h ---------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

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

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

#include "ADS/Contract.h"

#include <array>
#include <bit>
#include <cstddef>
#include <cstdint>
#include <span>
#include <utility>
#include <vector>

#if defined( __SSSE3__ ) || defined( __SSE4_1__ ) || defined( __BMI2__ )
 #include <immintrin.h>
#endif

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

namespace ADS {

[[nodiscard]] inline std::vector< std::uint8_t > streamVByteEncode(
                                         std::span< const std::uint32_t > x );

[[nodiscard]] inline std::vector< std::uint32_t > streamVByteDecode(
                        std::span< const std::uint8_t > code , std::size_t n );

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

}  // end( namespace ADS )

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

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

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

#endif  /* StreamVByte.h included */

/*--------------------------------------------------------------------------*/
/*------------------------- End File StreamVByte.h -------------------------*/
/*--------------------------------------------------------------------------*/