资源简介
JPEG-LS是图像无损压缩的算法,较低的复杂度。基本原理可以查找一些其他的论文。
代码片段和文件信息
// ******************************************************************
// * JPEG_LS_decode源程序清单 *
// ******************************************************************
// ************
// *包含库文件*
// ************
#include
#include
#include
#include
#include
#include
#include
// ************
// * 宏定义 *
// ************
//RESET: threshold value at which ABand N are halved
//NEAR: difference bound for near-lossless coding
//MIN_C: minimum allowed value of C[0..364]equal to -128
//MAX_C: maximum allowed value of C[0..364]equal to 127
#define RESET 64
#define NEAR 0
#define MIN_C -128
#define MAX_C 127
#define MAXVAL 255
// ************************************
// * 全局变量初始化 *
// ************************************
//MAXVAL: maximum possible image sample value ove all component of a scan
//RUNindex: index for run mode order
//qbpp: number of bits needed to represent a mapped error value
//bpp: number of bits needed to represent MAXVALwith a minimum of 2
//LIMIT: the value of glimit for a sample encoded in regular mode
//Q: context determined from Q1Q2Q3
//RANGE: range of prediction error representation
//A[0..366]:367 counters for the accumulated preditection error magnitude
//B[0..364]:365 counters for computing the bias
//C[0..364]:365 counters storing prediction coreection values
//J[0..31]: 32 variables indicating order of run-length codes
//N[0..366]:367 counters for frequency of occurrence of each context
//Nn[365..366]:2 counters for negative prediction error for run interruption
//EOLine: end of line indicatorused in run mode
//Errval: prediction error
//EMErrval: Errval mapped to non-negative integers in run interruption mode
//MErrval: Errval mapped to non-negative integers in regular mode
//--------------------------------------------------------------------------------
// LinX:当前行号
// RowX:当前列号
// *f:指向码流的指针
// *fp:文件指针
// buffer:数值缓冲器
// output:解码的数值
// size:当前码流的长度
// decode:当前码流的数值
// decode2:临时变量
// flag1:标志位
unsigned long buffer=0output=0decode=0decode2=0;
int size=0;
int LinX=1RowX=1;
int RANGE;
static int RUNindex=0;
int *f;
int flag1=0bpp;
int B[365]C[365];
int LIMIT;
int J[32]={00001111222233334455667789101112131415};
int A[367]N[367];
int Nn[2]={0};
int EOLine=0;
FILE *fp;
// **********************************
// * 计算T1T2T3值的子程序 *
// **********************************
float CLAMP_1(float i)
{
if(i>MAXVAL||i return(NEAR+1);
else
return(i);
}
float CLAMP_2(float ifloat T1)
{
if(i>MAXVAL||i return(T1);
else
return(i);
}
float CLAM
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 19016 2004-08-15 12:06 JPEG-LS.cpp
文件 21024 2004-08-03 10:29 JPEG-LS-decode.cpp
----------- --------- ---------- ----- ----
40040 2
- 上一篇:解决了关闭死锁的CSerialPort类项目
- 下一篇:SHT20测试程序
评论
共有 条评论