資源簡介
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測試程序
評論
共有 條評論