⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spihtent.h

📁 spiht的压缩解压缩c编写的
💻 H
字号:
#ifndef SPIHTENT_H
#define SPIHTENT_H

#include "spiht.h"
#include "spihtdecode.h"

/*   arithmetic.c   */
typedef long QccENTCodeValue;
typedef int (*QccENTArithmeticGetContext)(const int *symbol_stream,
                                         int current_symbol_index);

#define QCCENT_MAXNUMSYMBOLS   1024
#define QCCENT_MAXNUMCONTEXTS  1024
#define QCCENT_FREQUENCY_BITS  14
#define QCCENT_MAXFREQUENCY    ((1 << QCCENT_FREQUENCY_BITS) - 1)
#define QCCENT_CODEVALUEBITS   16
#define QCCENT_TOPVALUE (((QccENTCodeValue)(1 << QCCENT_CODEVALUEBITS)) - 1)
#define QCCENT_FIRSTQUARTERVALUE (QCCENT_TOPVALUE/4 + 1)
#define QCCENT_HALFVALUE (QCCENT_FIRSTQUARTERVALUE * 2)
#define QCCENT_THIRDQUARTERVALUE (QCCENT_FIRSTQUARTERVALUE * 3)
#define QCCENT_ANYNUMBITS -1
#define QCCENT_NONADAPTIVE 0
#define QCCENT_ADAPTIVE 1
typedef struct
{
  int num_contexts;
  int *num_symbols;
  int **translate_symbol_to_index;
  int **translate_index_to_symbol;
  int **cumulative_frequencies;
  int **frequencies;
  QccENTCodeValue low, high;
  long bits_to_follow;
  int garbage_bits;
  int target_num_bits;
  int adaptive_model;
  QccENTArithmeticGetContext context_function;
  int current_context;
  QccENTCodeValue current_code_value;
} QccENTArithmeticModel;
void QccENTArithmeticFreeModel(QccENTArithmeticModel *model);
int QccENTArithmeticSetModelContext(QccENTArithmeticModel *model,
                                    int current_context);
int QccENTArithmeticEncode(const int *symbol_stream,
                           int symbol_stream_length,
                           QccENTArithmeticModel *model,
                           QccBitBuffer *output_buffer);
QccENTArithmeticModel *QccENTArithmeticDecodeStart(QccBitBuffer *input_buffer,
                                                   const int *num_symbols, 
                                                   int num_contexts,
                                                   QccENTArithmeticGetContext
                                                   context_function,
                                                   int target_num_bits);
int QccENTArithmeticDecode(QccBitBuffer *input_buffer,
                           QccENTArithmeticModel *model,
                           int *symbol_stream,
                           int symbol_stream_length);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -