#pragma once
#ifdef _MSC_VER
#pragma warning (disable: 4127)
#endif
#define BASISD_LIB_VERSION …
#define BASISD_VERSION_STRING …
#ifdef _DEBUG
#define BASISD_BUILD_DEBUG
#else
#define BASISD_BUILD_RELEASE
#endif
#include "basisu.h"
#define BASISD_znew …
namespace basisu
{
extern bool g_debug_printf;
}
namespace basist
{
enum class block_format
{ … };
const int COLOR5_PAL0_PREV_HI = …, COLOR5_PAL0_DELTA_LO = …, COLOR5_PAL0_DELTA_HI = …;
const int COLOR5_PAL1_PREV_HI = …, COLOR5_PAL1_DELTA_LO = …, COLOR5_PAL1_DELTA_HI = …;
const int COLOR5_PAL2_PREV_HI = …, COLOR5_PAL2_DELTA_LO = …, COLOR5_PAL2_DELTA_HI = …;
const int COLOR5_PAL_MIN_DELTA_B_RUNLEN = …, COLOR5_PAL_DELTA_5_RUNLEN_VLC_BITS = …;
const uint32_t ENDPOINT_PRED_TOTAL_SYMBOLS = …;
const uint32_t ENDPOINT_PRED_REPEAT_LAST_SYMBOL = …;
const uint32_t ENDPOINT_PRED_MIN_REPEAT_COUNT = …;
const uint32_t ENDPOINT_PRED_COUNT_VLC_BITS = …;
const uint32_t NUM_ENDPOINT_PREDS = …;
const uint32_t CR_ENDPOINT_PRED_INDEX = …;
const uint32_t NO_ENDPOINT_PRED_INDEX = …;
const uint32_t MAX_SELECTOR_HISTORY_BUF_SIZE = …;
const uint32_t SELECTOR_HISTORY_BUF_RLE_COUNT_THRESH = …;
const uint32_t SELECTOR_HISTORY_BUF_RLE_COUNT_BITS = …;
const uint32_t SELECTOR_HISTORY_BUF_RLE_COUNT_TOTAL = …;
uint16_t crc16(const void *r, size_t size, uint16_t crc);
class huffman_decoding_table
{ … };
class bitwise_decoder
{ … };
inline uint32_t basisd_rand(uint32_t seed)
{ … }
inline uint32_t basisd_urand(uint32_t& seed, uint32_t limit)
{ … }
class approx_move_to_front
{ … };
struct decoder_etc_block;
inline uint8_t clamp255(int32_t i)
{ … }
enum eNoClamp
{ … };
struct color32
{ … };
struct endpoint
{ … };
struct selector
{ … };
bool basis_block_format_is_uncompressed(block_format tex_type);
half_float;
const double MIN_DENORM_HALF_FLOAT = …;
const double MIN_HALF_FLOAT = …;
const double MAX_HALF_FLOAT = …;
inline uint32_t get_bits(uint32_t val, int low, int high)
{ … }
inline bool is_half_inf_or_nan(half_float v)
{ … }
inline bool is_half_denorm(half_float v)
{ … }
inline int get_half_exp(half_float v)
{ … }
inline int get_half_mantissa(half_float v)
{ … }
inline float get_half_mantissaf(half_float v)
{ … }
inline int get_half_sign(half_float v)
{ … }
inline bool half_is_signed(half_float v)
{ … }
#if 0
int hexp = get_half_exp(Cf);
float hman = get_half_mantissaf(Cf);
int hsign = get_half_sign(Cf);
float k = powf(2.0f, hexp) * hman * hsign;
if (is_half_inf_or_nan(Cf))
k = std::numeric_limits<float>::quiet_NaN();
#endif
half_float float_to_half(float val);
inline float half_to_float(half_float hval)
{ … }
void bc6h_enc_init();
const uint32_t MAX_BLOG16_VAL = …;
const uint32_t NUM_BC6H_MODES = …;
const uint32_t BC6H_LAST_MODE_INDEX = …;
const uint32_t BC6H_FIRST_1SUBSET_MODE_INDEX = …;
const uint32_t TOTAL_BC6H_PARTITION_PATTERNS = …;
extern const uint8_t g_bc6h_mode_sig_bits[NUM_BC6H_MODES][4];
struct bc6h_bit_layout
{ … };
const uint32_t MAX_BC6H_LAYOUT_INDEX = …;
extern const bc6h_bit_layout g_bc6h_bit_layouts[NUM_BC6H_MODES][MAX_BC6H_LAYOUT_INDEX];
extern const uint8_t g_bc6h_2subset_patterns[TOTAL_BC6H_PARTITION_PATTERNS][4][4];
extern const uint8_t g_bc6h_weight3[8];
extern const uint8_t g_bc6h_weight4[16];
extern const int8_t g_bc6h_mode_lookup[32];
inline half_float bc6h_blog16_to_half(uint32_t comp)
{ … }
const uint32_t MAX_BC6H_HALF_FLOAT_AS_UINT = …;
inline uint32_t bc6h_half_to_blog16(half_float h)
{ … }
struct bc6h_block
{ … };
void bc6h_enc_block_mode10(bc6h_block* pPacked_block, const half_float pEndpoints[3][2], const uint8_t* pWeights);
void bc6h_enc_block_1subset_4bit_weights(bc6h_block* pPacked_block, const half_float pEndpoints[3][2], const uint8_t* pWeights);
void bc6h_enc_block_1subset_mode9_3bit_weights(bc6h_block* pPacked_block, const half_float pEndpoints[3][2], const uint8_t* pWeights);
void bc6h_enc_block_1subset_3bit_weights(bc6h_block* pPacked_block, const half_float pEndpoints[3][2], const uint8_t* pWeights);
void bc6h_enc_block_2subset_mode9_3bit_weights(bc6h_block* pPacked_block, uint32_t common_part_index, const half_float pEndpoints[2][3][2], const uint8_t* pWeights);
void bc6h_enc_block_2subset_3bit_weights(bc6h_block* pPacked_block, uint32_t common_part_index, const half_float pEndpoints[2][3][2], const uint8_t* pWeights);
bool bc6h_enc_block_solid_color(bc6h_block* pPacked_block, const half_float pColor[3]);
}