bitio.h

来自「该程序把数字图像处理与小波变换结合起来」· C头文件 代码 · 共 63 行

H
63
字号
#ifndef __BITIO_H_
#define __BITIO_H_

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* The codes are from the book "The Data Compression Book" by Mark Nelson 
 * and Jean-Loup Gailly, M&T Books 1996.
 *
 * I did some changes to the end of file issue, but not really successful.
 *
 * Mow-Song, Ng 2/9/2002
 * msng@mmu.edu.my
 * http://www.pesona.mmu.edu.my/~msng
 *
 * I do not claim copyright to the code, but if you use them or modify them,
 * please drop me a mail.
 * 
 */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/	
/* 
 * $LOG
 * ----
 * Last modified 28/10/2001
 *
 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/	


/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "memchk.h"

typedef struct bit_file {
   FILE *file;
   unsigned char mask;
   int rack;   
} BIT_FILE;

BIT_FILE *OpenInputBitFile( char *name );
BIT_FILE *OpenOutputBitFile( char *name );
void OutputBit( BIT_FILE *bit_file, int bit );
void OutputBits( BIT_FILE *bit_file,
                unsigned long code, int count );
int InputBit( BIT_FILE *bit_file, int *EOFflag );
unsigned long InputBits( BIT_FILE *bit_file, int bit_count, int *EOFflag);
void CloseInputBitFile( BIT_FILE *bit_file );
void CloseOutputBitFile( BIT_FILE *bit_file );
void FilePrintBinary( FILE *file, unsigned int code, int bits );
void BitioError(char *fmt, ...);

#endif



⌨️ 快捷键说明

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