📄 coder.h
字号:
/******************************************************************************
File: coder.h
Authors: John Carpinelli (johnfc@ecr.mu.oz.au)
Wayne Salamonsen (wbs@mundil.cs.mu.oz.au)
Purpose: Data compression using a word-based model and revised
arithmetic coding method.
Based on: A. Moffat, R. Neal, I.H. Witten, "Arithmetic Coding Revisted",
Proc. IEEE Data Compression Conference, Snowbird, Utah,
March 1995.
Copyright 1995 John Carpinelli and Wayne Salamonsen, All Rights Reserved.
These programs are supplied free of charge for research purposes only,
and may not sold or incorporated into any commercial product. There is
ABSOLUTELY NO WARRANTY of any sort, nor any undertaking that they are
fit for ANY PURPOSE WHATSOEVER. Use them at your own risk. If you do
happen to find a bug, or have modifications to suggest, please report
the same to Alistair Moffat, alistair@cs.mu.oz.au. The copyright
notice above and this statement of conditions must remain an integral
part of each and every copy made of these files.
******************************************************************************/
#ifndef CODER_H
#define CODER_H
#define CODE_BITS 32
#define BYTE_SIZE 8
#define MAX_BITS_OUTSTANDING 256
#define HALF ((unsigned) 1 << (CODE_BITS-1))
#define QUARTER (1 << (CODE_BITS-2))
/* provide external linkage to variables */
extern int f_bits; /* link to f_bits in stats.c */
extern unsigned int bytes_input; /* make available to other modules */
extern unsigned int bytes_output;
/* function prototypes */
void arithmetic_encode(unsigned int l, unsigned int h, unsigned int t);
unsigned int arithmetic_decode_target(unsigned int t);
void arithmetic_decode(unsigned int l, unsigned int h, unsigned int t);
void binary_arithmetic_encode(int c0, int c1, int bit);
int binary_arithmetic_decode(int c0, int c1);
void start_encode(void);
void finish_encode(void);
void start_decode(void);
void finish_decode(void);
void startoutputtingbits(void);
void doneoutputtingbits(void);
void startinputtingbits(void);
void doneinputtingbits(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -