📄 huffman.h
字号:
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *//* H U F F M A N C O D E I M P L E M E N T A T I O N *//* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *//* > > > > > ANSI C version 2.05 - 05/30/95 < < < < < *//* Amir Said - amir@densis.fee.unicamp.br *//* Faculty of Electrical Engineering *//* University of Campinas (UNICAMP) - Campinas, SP 13081, Brazil *//* William A. Pearlman - pearlman@ecse.rpi.edu *//* Dept. of Electrical, Computer, and Systems Engineering *//* Rensselaer Polytechnic Institute - Troy, NY 12180, USA *//* - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - */#include <stdlib.h>#include <stdio.h>/* - - Data types - - - - - - - - - - - - - - - - - - - - - - - - - - */typedef struct { FILE * out_file; int bit_buffer, bit_index, nsb, shift, nrep; int * code, * length, * tree[2]; long byte_counter;} Encoder;typedef struct { FILE * in_file; int bit_buffer, bit_index, nsb, shift, nrep, nodes; int * trans_0, * trans_1; long byte_counter;} Decoder;/* - - Interface to < Encoder > - - - - - - - - - - - - - - - - - - - */void Start_Encoder(Encoder * E, char * file_name);void Write_Code(Encoder * E, int numb_symbols, long frequency[]);void Write_Bit(Encoder * E, int bit);void Write_Bits(Encoder * E, int bits, int word);void Write_Symbol(Encoder * E, int symb);long Bytes_Used(Encoder * E);long Stop_Encoder(Encoder * E);/* - - Interface to < Decoder > - - - - - - - - - - - - - - - - - - - */void Start_Decoder(Decoder * D, char * file_name);int Read_Code(Decoder * E);int Read_Bit(Decoder * E);int Read_Bits(Decoder * E, int bits);int Read_Symbol(Decoder * E);long Bytes_Read(Decoder * E);void Stop_Decoder(Decoder * E);/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *//* end of file < huffman.h > */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -