亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rawnjl2.cc

?? 在Linux開發(fā)環(huán)境下實現(xiàn)JPEG_LS壓縮標注
?? CC
?? 第 1 頁 / 共 4 頁
字號:
#include <math.h>#include "bnstream.h"#include "bnopt.h"#include "mesgtext.h"#ifdef USEOWNLOG2#if USEOWNLOG2static inline double log2(double x) { return log(x)/log(2); }#endif#endif// Test of new lossless JPEG proposal ISO/IEC WD 14495static inline Uint32 Maximum(Uint32 a,Uint32 b) { return (a > b) ? a : b; }static inline Uint16 Maximum(Uint16 a,Uint16 b) { return (a > b) ? a : b; }static inline Uint32 Minimum(Uint32 a,Uint32 b) { return (a > b) ? b : a; }static inline Uint16 Minimum(Uint16 a,Uint16 b) { return (a > b) ? b : a; }static inline Uint32 Abs(Int32 x) { return (Uint32)((x < 0) ? -x : x); }static inline Uint16 Abs(Int16 x) { return (Uint16)((x < 0) ? -x : x); }static inline double Log(double x)	{ return (log2(x)); }static inline Uint32 Floor(double x)	{ return Uint32(floor(x)); }static inline Uint32 Ceiling(double x)	{ return Uint32(ceil(x)); }static inline Uint32 FloorDivision(Uint32 n,Uint32 d)	{ return Uint32(floor(double(n)/double(d))); }static inline Uint32 CeilingDivision(Uint32 n,Uint32 d)	{ return Uint32(ceil(double(n)/double(d))); }// Constant tables for run length codes ...static const Uint16 J[32] = {		// Order of run length codes	0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,7,8,9,10,11,12,13,14,15};static const Uint16 J_rm[32] = {	// Length of run length codes (ie. 1<<J[n])	1u<<0,1u<<0,1u<<0,1u<<0,	1u<<1,1u<<1,1u<<1,1u<<1,	1u<<2,1u<<2,1u<<2,1u<<2,	1u<<3,1u<<3,1u<<3,1u<<3,	1u<<4,1u<<4,	1u<<5,1u<<5,	1u<<6,1u<<6,	1u<<7,1u<<7,	1u<<8,	1u<<9,	1u<<10,	1u<<11,	1u<<12,	1u<<13,	1u<<14,	1u<<15};static Uint32readRow(BinaryInputStream &in, Uint16 *buffer, Uint32 n,Uint16 bpp){	Uint32 count=0;	if (bpp <= 8) {		while (n-- && in) {			unsigned char value;			in >> value;			*buffer++=Uint16(value);			if (in || in.eof()) ++count;		}	}	else {		while (n-- && in) {			in >> *buffer++;			if (in || in.eof()) ++count;		}	}	return (in || in.eof()) ? count : 0;}static BinaryOutputStream &writeRow(BinaryOutputStream &out, Uint16 *buffer, Uint32 n,Uint16 bpp){	if (bpp <= 8) {		while (n-- && out) out << (unsigned char)(*buffer++);	}	else {		while (n-- && out) out << *buffer++;	}	return out;}static Uint32 		readBitByteOffset=0;static Int16 		readBitCount=0;static unsigned char 	readBitByte=0;static unsigned char 	readForwardByte;static bool		readHaveForwardByte=false;static BinaryInputStream &readBit(BinaryInputStream &in,Uint32 &bit){	// first bits are read from msb of byte	Assert(readBitCount >= 0);	if (readBitCount < 1) {		++readBitByteOffset;		if (readHaveForwardByte) {			readHaveForwardByte=false;			readBitByte=readForwardByte;			readBitCount=7;			// skip the stuffed zero bit (otherwise would have been marker)(hence never 0xff)		}		else {			in.read(&readBitByte,1);			if (readBitByte == 0xff) {	// could be marker segment or data 0xff with following stuffed zero bit				Assert(readHaveForwardByte == false);				//while (in.read(&readForwardByte,1) && readForwardByte == 0xff);	// skip padding bytes (strings of 0xff)				in.read(&readForwardByte,1);				if (in) {					if ((readForwardByte & 0x80) == 0) {	// stuffed zero bit after valid 0xff						readHaveForwardByte=true;						// the valid 0xff is already in readBitByte						readBitCount=8;					}					else {	// marker segment						// marker identifier is 0xff00+readForwardBytecerr << "readBitByte=" << hex << unsigned(readBitByte) << dec << endl;cerr << "readForwardByte=" << hex << unsigned(readForwardByte) << dec << endl;						Assert(0);	// for now					}				}				else {					readBitCount=0;	// just in case ... will trigger assertion next time					return in;	// failed miserably (ie. can't be valid JPEG syntax if have 0xff as last byte in file)				}			}			else				readBitCount=8;		}	}	bit=(readBitByte>>(--readBitCount)) & 1;//cerr << (bit ? "1" : "0");	return in;}static voiddumpReadBitPosition(void){	cerr << "dumpReadBitPosition: " << (readBitByteOffset-1+(readBitCount ? 0 : 1)) << "." << (readBitCount ? (8-readBitCount) : 0) << endl;}static Uint32 		writeBitByteOffset=0;static Uint16 		writeBitCount=0;static unsigned char 	writeBitByte=0;static BinaryOutputStream &writeBit(BinaryOutputStream &out,Uint32 bit){	// first bits are written into msb of byte	Assert(writeBitCount<8);	writeBitByte=writeBitByte<<1;	if (bit) writeBitByte|=1;//cerr << (bit ? "1" : "0");	if (++writeBitCount >= 8) {		++writeBitByteOffset;		out.write(&writeBitByte,1);		// need to stuff with a following zero bit to distinguish from JPEG marker		writeBitCount=(writeBitByte == 0xff) ? 1 : 0;		writeBitByte=0;	}	return out;}static BinaryOutputStream &writeBitFlush(BinaryOutputStream &out){	Assert(writeBitCount<8);	writeBitByte=writeBitByte<<(8-writeBitCount);	out.write(&writeBitByte,1);	writeBitByte=0;	writeBitCount=0;	return out;}static voiddumpWriteBitPosition(void){	cerr << "dumpWriteBitPosition: " << writeBitByteOffset << "." << writeBitCount << endl;}static BinaryOutputStream &write16BE(BinaryOutputStream &out,Uint16 word){	unsigned char byte;	byte=word>>8;	out.write(&byte,1);	byte=word&0xff;	out.write(&byte,1);	return out;}static BinaryOutputStream &write8(BinaryOutputStream &out,unsigned char byte){	out.write(&byte,1);	return out;}static BinaryInputStream &read16BE(BinaryInputStream &in,Uint16 &value){	unsigned char byte;	in.read(&byte,1);	value=Uint16(byte)<<8;	in.read(&byte,1);	value|=byte;	return in;}static BinaryInputStream &read8(BinaryInputStream &in,unsigned char &byte){	in.read(&byte,1);	return in;}// JPEG Syntax - Marker Segment stuff ....const Uint16 JPEG_MARKER_DNL = 0xffdc;const Uint16 JPEG_MARKER_EOI = 0xffd9;const Uint16 JPEG_MARKER_SOI = 0xffd8;const Uint16 JPEG_MARKER_SOS = 0xffda;// New for JPEG-LS (14495-1:1997)const Uint16 JPEG_MARKER_SOF55 = 0xfff7;const Uint16 JPEG_MARKER_LSE   = 0xfff8;const unsigned char JPEG_LSE_ID_L1   = 0x01;const unsigned char JPEG_LSE_ID_L2   = 0x02;const unsigned char JPEG_LSE_ID_L3   = 0x03;const unsigned char JPEG_LSE_ID_L4   = 0x04;static BinaryOutputStream &writeSOI(BinaryOutputStream &out){	write16BE(out,JPEG_MARKER_SOI);	return out;}static BinaryOutputStream &writeSOF55(BinaryOutputStream &out,Uint16 P,Uint16 ROWS,Uint16 COLUMNS){	write16BE(out,JPEG_MARKER_SOF55);	write16BE(out,11);			// length (inclusive of self)	Assert(P < 256);	write8(out,(unsigned char)P);		// sample precision	write16BE(out,ROWS);			// Y - number of lines	write16BE(out,COLUMNS);			// X - number of samples per line	write8(out,1);				// one component per frame only	write8(out,1);				// component identifier is 1	write8(out,0x11);			// no horizontal or vertical sampling factor	write8(out,0);				// no quantization table used in JPEG-LS	return out;}static BinaryOutputStream &writeSOS(BinaryOutputStream &out,Uint16 NEAR){	write16BE(out,JPEG_MARKER_SOS);	write16BE(out,8);			// length (inclusive of self)	write8(out,1);				// one component per scan only	write8(out,1);				// select component 1	write8(out,0);				// no mapping table	Assert(NEAR < 256);	write8(out,(unsigned char)NEAR);	// in place of start of spectral selection	write8(out,0);				// ILV - interleave mode is 0 (none)	write8(out,0);				// not used in JPEG-LS	return out;}static BinaryOutputStream &writeLSE1(BinaryOutputStream &out,Uint16 MAXVAL,Uint16 T1,Uint16 T2,Uint16 T3,Uint16 RESET){	write16BE(out,JPEG_MARKER_LSE);	write16BE(out,13);	write8(out,JPEG_LSE_ID_L1);	write16BE(out,MAXVAL);	write16BE(out,T1);	write16BE(out,T2);	write16BE(out,T3);	write16BE(out,RESET);	return out;}static BinaryOutputStream &writeEOI(BinaryOutputStream &out){	write16BE(out,JPEG_MARKER_EOI);	return out;}static boolreadJPEGMarker(BinaryInputStream &in,Uint16 &marker){	return read16BE(in,marker) && (marker&0xff80) != 0;}static boolreadSOI(BinaryInputStream &in,Uint16 marker){	return marker == JPEG_MARKER_SOI;}static boolreadSOF55(BinaryInputStream &in,Uint16 marker,Uint16 &P,Uint32 &ROWS,Uint32 &COLUMNS){//cerr << "readSOF55:" << endl;	Uint16 length;	unsigned char precision;	Uint16 rows;	Uint16 columns;	unsigned char ncomponents;	unsigned char componentid;	unsigned char hvsampling;	unsigned char quanttable;	return marker == JPEG_MARKER_SOF55			// && (cerr << "readSOF55: JPEG_MARKER_SOF55" << endl)	    && read16BE(in,length) && length == 11		// && (cerr << "readSOF55: length = " << dec << length << endl)	    && read8(in,precision) && (P=precision,true)	// && (cerr << "readSOF55: P = " << dec << P << endl)	    && read16BE(in,rows) && (ROWS=rows,true)		// && (cerr << "readSOF55: ROWS = " << dec << ROWS << endl)	    && read16BE(in,columns) && (COLUMNS=columns,true)	// && (cerr << "readSOF55: COLUMNS = " << dec << COLUMNS << endl)	    && read8(in,ncomponents) && ncomponents == 1	// && (cerr << "readSOF55: ncomponents = " << dec << Uint16(ncomponents) << endl)	    && read8(in,componentid)				// && (cerr << "readSOF55: componentid = " << dec << Uint16(componentid) << endl)	    && read8(in,hvsampling)				// && (cerr << "readSOF55: hvsampling = " << dec << Uint16(hvsampling) << endl)	    && read8(in,quanttable)				// && (cerr << "readSOF55: quanttable = " << dec << Uint16(quanttable) << endl)	;}static boolreadSOS(BinaryInputStream &in,Uint16 marker,Uint16 &NEAR){	Uint16 length;	unsigned char ncomponents;	unsigned char componentid;	unsigned char mappingtable;	unsigned char near;	unsigned char ilv;	unsigned char dummy;	return marker == JPEG_MARKER_SOS	    && read16BE(in,length) && length == 8	    && read8(in,ncomponents) && ncomponents == 1	    && read8(in,componentid)	    && read8(in,mappingtable)	    && read8(in,near) && (NEAR=near,true)	    && read8(in,ilv)	    && read8(in,dummy);}static boolreadLSE1(BinaryInputStream &in,Uint16 marker,Uint32 &MAXVAL,Uint16 &T1,Uint16 &T2,Uint16 &T3,Uint16 &RESET){	Uint16 length;	unsigned char id;	Uint16 maxval;	return marker == JPEG_MARKER_LSE	    && read16BE(in,length) && length > 2	    && read8(in,id) && id == JPEG_LSE_ID_L1	    && length == 13	    && read16BE(in,maxval) && (MAXVAL=maxval,true)	    && read16BE(in,T1)	    && read16BE(in,T2)	    && read16BE(in,T3)	    && read16BE(in,RESET);}// JPEG-LS support routines ...static Uint16determineGolombParameter(Uint32 n,Uint32 a){	Uint16 k;//cerr << "\t\tdetermineGolombParameter: n = " << n << endl;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级免费观看| 日本一区二区视频在线| 久久久久国产精品麻豆ai换脸| 18欧美亚洲精品| 美脚の诱脚舐め脚责91| 欧美性大战久久| 国产精品每日更新在线播放网址| 日本亚洲三级在线| 色先锋久久av资源部| 久久天天做天天爱综合色| 亚洲成人精品影院| 色婷婷久久久亚洲一区二区三区 | 在线免费精品视频| 中文一区在线播放| 精品一区二区三区免费观看| 欧美日韩成人高清| 亚洲一区在线看| 一本色道久久综合狠狠躁的推荐 | 91精品国产入口| 亚洲亚洲人成综合网络| 91国产视频在线观看| 中文字幕日韩一区二区| 成人国产亚洲欧美成人综合网| 精品福利在线导航| 日韩成人免费看| 欧美美女一区二区三区| 日韩一区精品视频| 欧美日韩国产a| 亚洲第一福利一区| 欧美电影一区二区三区| 午夜精品福利一区二区蜜股av| 在线观看国产91| 洋洋成人永久网站入口| 91搞黄在线观看| 亚洲午夜久久久久久久久电影院| 欧美中文字幕一区二区三区亚洲| 一区二区三区自拍| 欧美精品久久久久久久多人混战| 午夜av电影一区| 精品乱码亚洲一区二区不卡| 精品亚洲成a人| 久久精品无码一区二区三区| 粉嫩欧美一区二区三区高清影视| 国产精品久久久久久亚洲伦| 91久久一区二区| 亚洲成人福利片| 精品国产精品一区二区夜夜嗨| 国产精品一区专区| 亚洲人成亚洲人成在线观看图片| 欧美性猛交xxxxxx富婆| 麻豆精品国产91久久久久久 | 在线观看国产精品网站| 午夜视频一区二区三区| 精品国产一区二区国模嫣然| 福利视频网站一区二区三区| 亚洲精品视频一区| 欧美一区二区三区不卡| 国产高清视频一区| 洋洋成人永久网站入口| 久久伊99综合婷婷久久伊| 97久久超碰精品国产| 麻豆91在线播放免费| 国产精品久久二区二区| 宅男在线国产精品| 成人av网站大全| 日韩黄色免费电影| 国产精品污www在线观看| 欧美精品久久一区| www.视频一区| 久久成人久久爱| 一区二区三区免费| 精品国产乱码久久久久久1区2区 | 国产蜜臀av在线一区二区三区| 色综合激情久久| 国产福利一区二区三区| 午夜精品在线看| 国产精品久久久久三级| 精品久久久久久无| 欧美色图天堂网| 成人午夜激情在线| 男女男精品视频网| 一区二区在线看| 国产精品午夜在线| 久久一夜天堂av一区二区三区| 欧美日韩在线综合| 99久久99久久综合| 国产高清一区日本| 精品在线免费观看| 日韩黄色片在线观看| 一区二区免费在线播放| 国产精品久久久久久久久快鸭| 精品欧美一区二区在线观看| 欧美三级在线播放| 日本精品裸体写真集在线观看 | 国产女人18毛片水真多成人如厕 | 久久精品国产一区二区三| 性感美女久久精品| 亚洲综合激情网| 亚洲精品成人精品456| 亚洲婷婷综合久久一本伊一区| 国产亚洲欧美在线| 久久久久久久久久久久久女国产乱| 欧美日韩国产美| 欧美三级欧美一级| 欧美精品成人一区二区三区四区| 欧美在线一区二区三区| 色综合激情五月| 色综合久久99| 色一区在线观看| 欧洲av在线精品| 欧洲人成人精品| 欧美日韩在线三级| 91麻豆精品国产91久久久资源速度 | 美女一区二区三区在线观看| 午夜精品久久久久久久久| 亚洲线精品一区二区三区| 午夜精品久久久久久久久久| 亚洲国产精品综合小说图片区| 亚洲一区二区三区在线| 亚洲成人av中文| 免费观看久久久4p| 国产一区二区免费看| 国产精品系列在线观看| 成人网页在线观看| 不卡欧美aaaaa| 日本韩国精品一区二区在线观看| 色综合久久久久综合体| 欧美日韩午夜精品| 日韩精品一区二区三区四区视频| 久久蜜桃一区二区| 一区在线中文字幕| 无码av中文一区二区三区桃花岛| 蜜臀av一区二区| 国产91精品精华液一区二区三区 | 国产一区二区三区综合| 成人午夜私人影院| 欧美日韩在线一区二区| 精品国产免费一区二区三区四区| 国产人成亚洲第一网站在线播放 | 国产欧美一区二区三区在线老狼| 亚洲欧洲一区二区三区| 亚洲成a人片在线观看中文| 久久av老司机精品网站导航| 国产suv精品一区二区883| 在线视频国内自拍亚洲视频| 欧美一级生活片| 国产欧美一区二区精品性色| 亚洲成va人在线观看| 国产91在线观看丝袜| 欧美视频在线一区二区三区| 26uuu亚洲| 亚洲国产精品一区二区久久恐怖片| 麻豆国产精品官网| 色综合欧美在线| 精品国产伦一区二区三区免费 | 欧美日韩免费电影| 久久女同精品一区二区| 一区二区三区在线播放| 国产一区二区三区av电影| 欧美性色欧美a在线播放| 久久精品免视看| 亚洲狠狠爱一区二区三区| 国产成人8x视频一区二区| 欧美人xxxx| 亚洲精品日日夜夜| 国v精品久久久网| 日韩欧美国产一二三区| 亚洲在线免费播放| 成人久久18免费网站麻豆 | 一区二区三区四区蜜桃| 国产精品资源在线| 51午夜精品国产| 综合在线观看色| 国产一区二区三区黄视频 | 精品日韩一区二区三区免费视频| 亚洲欧美日韩一区二区三区在线观看| 韩国v欧美v亚洲v日本v| 91精品国产入口| 亚洲成人久久影院| 在线中文字幕一区二区| 综合久久综合久久| 成人一二三区视频| 国产日韩一级二级三级| 久久99精品久久久久| 欧美日韩国产另类不卡| 亚洲永久精品国产| 91蝌蚪porny成人天涯| 亚洲国产电影在线观看| 国产麻豆视频一区二区| www日韩大片| 激情av综合网| 日韩欧美成人一区二区| 日本欧美肥老太交大片| 欧美日韩aaaaaa| 日本强好片久久久久久aaa| 欧美剧情片在线观看| 亚洲va欧美va人人爽午夜| 欧美日本不卡视频| 蜜臀久久99精品久久久久宅男 | 欧美精品电影在线播放|