📄 arith.h
字号:
/* this is the header file for arith.c, with shorter integer precision */typedef struct { FILE *file; unsigned char mask; int rack; int pacifier_counter;} BIT_FILE;/* * The SYMBOL structure is what is used to define a symbol in * arithmetic coding terms. A symbol is defined as a range between * 0 and 1. Since we are using integer math, instead of using 0 and 1 * as our end points, we have an integer scale. The low_count and * high_count define where the symbol falls in the range. */typedef struct { unsigned short int low_count; unsigned short int high_count; unsigned short int scale;} SYMBOL;BIT_FILE *OpenOutputBitFile( char *name );void OutputBit( BIT_FILE *bit_file, int bit );void CloseOutputBitFile( BIT_FILE *bit_file );void initialize_arithmetic_encoder( void );int encode_symbol( BIT_FILE *stream, SYMBOL *s );void flush_arithmetic_encoder( BIT_FILE *stream );BIT_FILE *OpenInputBitFile( char *name );void CloseInputBitFile( BIT_FILE *bit_file );int InputBit( BIT_FILE *bit_file );short int get_current_count( SYMBOL *s );int convert_symbol_to_int(short int count, SYMBOL *s, short int *totals, int num_codeword);int initialize_arithmetic_decoder( BIT_FILE *stream );int remove_symbol_from_stream( BIT_FILE *stream, SYMBOL *s );int arith_encode(BIT_FILE *OutBitp, unsigned short int *esti_prob, int num_codeword, int cur_index);int arith_decode(BIT_FILE *InBitp, SYMBOL *cs, unsigned short int *esti_prob, int num_codeword, short int *totals);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -