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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? huffcompress.c

?? 串口通訊編程包括網絡流量監控的等程序VC++編程語言與大家共享
?? C
?? 第 1 頁 / 共 2 頁
字號:
	}

	// Encode the Input Data
	__asm
	{
		// Point to the Source Data
		MOV		ESI,pInput

		// Set the Loop Count
		MOV		EDX,dwCount
		MOV		dwLoop,EDX

		// Point to the Codes Array
		MOV		EDX,pCodes

		// Clear the Count of Used Bits
		MOV		EDI,0

		// Main Loop for Reading Bytes
		_LoopInput:

		// Clear the EAX Register for the Input Character
		MOV		EAX,0

		// Read the Input Byte and Increment the Input Pointer
		LODSB

		// Get the Compression Code (Bytes 0 - 255 in Array)
		MOV		EBX,[EDX + EAX * 4]

		// Get the Compression Code Bit Count (Bytes 256 - 511 in Array)
		MOV		ECX,[EDX + 1024 + EAX * 4]

		// See How Many Bits Can be Shifted to the Output DWORD
		ADD		EDI,ECX
		CMP		EDI,32
		JLE		_ShiftBits

		// See How Many Bits of the Last Code Can't Be Used
		SUB		EDI,32

		// Adjust ECX to Handle only the Bits that Can Be Used
		SUB		ECX,EDI

		// Set the Output Flag
		MOV		fOutput,TRUE

		// Start the Bit Shifting
		_ShiftBits:

		// Check for Outputting a full DWORD
		CMP		fOutput,FALSE
		JE		_Continue

		// Increment the Compression Count
		ADD		dwNewCount,4

		// Remove the Bits we Used
		MOV		EAX,32
		SUB		EAX,EDI
		MOV		ECX,EAX

		// Reset the Output Flag
		MOV		fOutput,FALSE

		// Decrement the Main Loop Counter
		_Continue:
		DEC		dwLoop
		JNZ		_LoopInput

		// Update Any Remaining Compression data in the Buffer
		CMP		EDI,0
		JE		_Exit

		// Left Shift the Remaining Bits
		MOV		EAX,32
		SUB		EAX,EDI
		MOV		ECX,EAX

		// Increment the Compression Count
		ADD		dwNewCount,4

		// Finished Compressing the Input Data
		_Exit:
	}

	// Return the Compression Count
	return dwNewCount;
}

// Compress the Count of Input Data to Output Data returning the new Count
DWORD HuffmanCompress(BYTE *pInput,DWORD dwCount,WORD iTreeSize,DWORD *pByteTree,DWORD *pCodes,BYTE *pOutput)
{
	// Allocation Variables
	BYTE	*pStartInput = pInput;
	BYTE	*pStartOutput = pOutput;

	// Variables Used for Code Shifting
	DWORD	dwUnusedByte = 0;
	BOOL	fOutput = FALSE;

	// Compressed Size with Initial Space for Codes
	DWORD	dwNewCount = 0;

	// Loop Variable
	DWORD	dwLoop;

	// Get the Tree Size and Table Storage Requirement
	__asm
	{
		// Get the Table Storage
		MOV		EAX,0
		MOV		AX,iTreeSize
		MOV		wTreeSize,AX
		SHL		EAX,2
		MOV		dwStorage,EAX
	}

	// Encode the Input Data
	__asm
	{
		// Point to the Destination Data
		MOV		EDI,pOutput

		// Store the UnCompressed Count
		MOV		EAX,dwCount
		MOV		[EDI],EAX

		// Move Past the UnCompressed Count
		ADD		EDI,4

		// Move in the Number of Codes to the Output
		MOV		ECX,0
		MOV		CX,wTreeSize
		MOV		[EDI],CX

		// Move Past the Number of Codes
		ADD		EDI,2

		// Initialize the Base Storage Requirement
		MOV		EDX,dwStorage
		MOV		dwNewCount,EDX

		// Add 6 for the DWORD and WORD that Stores the UnCompressed Count and Number of Tree Entries
		ADD		dwNewCount,6

		// Adjust the Start of the Output Compressed Data, Skipping Byte Tree
		SHR		EDX,1
		ADD		EDI,EDX

		// Store the Pointer to the Output
		MOV		pOutput,EDI

		// Set the Loop Count
		MOV		EDX,dwCount
		MOV		dwLoop,EDX

		// Point to the Codes Array
		MOV		EDX,pCodes

		// Clear the Count of Used Bits
		MOV		EDI,0

		// Initialize the Storage DWORD
		XOR		ESI,ESI

		// Main Loop for Reading Bytes
		_LoopInput:

		// Clear the EAX Register for the Input Character
		MOV		EAX,0

		// Save the ESI Register
		PUSH	ESI

		// Point to the Source Data
		MOV		ESI,pInput

		// Read an Input Byte
		MOV		AL,[ESI]

		// Increment the Pointer to the Source Data
		INC		ESI

		// Store the Pointer to the Source Data
		MOV		pInput,ESI

		// Restore the ESI Register
		POP		ESI

		// Get the Compression Code (Bytes 0 - 255 in Array)
		MOV		EBX,[EDX + EAX * 4]

		// Get the Compression Code Bit Count (Bytes 256 - 511 in Array)
		MOV		ECX,[EDX + 1024 + EAX * 4]

		// See How Many Bits Can be Shifted to the Output DWORD
		ADD		EDI,ECX
		CMP		EDI,32
		JLE		_ShiftBits

		// See How Many Bits of the Last Code Can't Be Used
		SUB		EDI,32

		// Adjust ECX to Handle only the Bits that Can Be Used
		SUB		ECX,EDI

		// Save the Code
		MOV		dwUnusedByte,EBX

		// Shift the Input Symbol to the Right
		PUSH	ECX
		MOV		ECX,EDI
		SHR		EBX,CL
		POP		ECX

		// Set the Output Flag
		MOV		fOutput,TRUE

		// Start the Bit Shifting
		_ShiftBits:

		// Shift the Output Symbol to Handle a New Symbol
		SHL		ESI,CL

		// OR the Output Symbol with New Symbol
		OR		ESI,EBX

		// Check for Outputting a full DWORD
		CMP		fOutput,FALSE
		JE		_Continue

		// Output an Encoded Symbol
		MOV		EAX,ESI
		PUSH	EDI
		MOV		EDI,pOutput
		MOV		[EDI],EAX
		POP		EDI
		ADD		pOutput,4

		// Increment the Compression Count
		ADD		dwNewCount,4

		// Remove the Bits we Used
		MOV		EAX,32
		SUB		EAX,EDI
		MOV		ECX,EAX

		// Restore the Unused Portion of the Code
		MOV		EAX,dwUnusedByte
		SHL		EAX,CL
		SHR		EAX,CL

		// Update the Code to Have the Left Over Bits
		MOV		ESI,EAX

		// Initialize the Left Over Bits
		MOV		dwUnusedByte,0

		// Reset the Output Flag
		MOV		fOutput,FALSE

		// Decrement the Main Loop Counter
		_Continue:
		DEC		dwLoop
		JNZ		_LoopInput

		// Update Any Remaining Compression data in the Buffer
		CMP		EDI,0
		JE		_Exit

		// Left Shift the Remaining Bits
		MOV		EAX,32
		SUB		EAX,EDI
		MOV		ECX,EAX
		SHL		ESI,CL

		// Output the Final Encoded Symbol
		MOV		EAX,ESI
		MOV		EDI,pOutput
		MOV		[EDI],EAX

		// Increment the Compression Count
		ADD		dwNewCount,4

		// Finished Compressing the Input Data
		_Exit:
	}

	// Set the Start of the Byte Tree
	pOutput = pStartOutput + 6;

	// Copy the DWORD Byte Tree to a WORD Byte Tree
	D2W(&wByteTree[0],pByteTree,dwStorage/4);

	// Copy the Byte Tree
	memblast(pOutput,&wByteTree[0],dwStorage/2);
	
	// Restore the Pointer to the Start of the Input
	pInput = pStartInput;

	// Restore the Pointer to the Start of the Output
	pOutput = pStartOutput;

	// Return the Compression Count
	return dwNewCount;
}

// Get the UnCompressed Count of Output Data
DWORD HuffmanGetSize(BYTE *pInput)
{
	DWORD	dwUnCount;

	__asm
	{
		// Point to the Source Data
		MOV		ESI,pInput

		// Get the UnCompressed Count
		MOV		EAX,[ESI]
		MOV		dwUnCount,EAX
	}

	// Return the UnCompressed Count
	return dwUnCount;
}

// UnCompress the Compressed Count of Input Data to Output Data returning the UnCompressed Count
DWORD HuffmanUnCompress(BYTE *pInput,BYTE *pOutput)
{
	// UnCompressed Count
	DWORD	dwUnCount;

	// Allocation Variables
	BYTE	*pStartInput = pInput;
	BYTE	*pStartOutput = pOutput;

	// UnCompressed Variables
	DWORD	dwLoop;

	// Initialize the Weights Array
	HuffmanInitArrays();

	// Copy the Decoding Dictionary
	__asm
	{
		// Point to the Source Data
		MOV		ESI,pInput

		// Get the UnCompressed Count
		MOV		EAX,[ESI]
		MOV		dwUnCount,EAX

		// Move Past the Uncompressed Count
		ADD		ESI,4

		// Get the Tree Size
		MOV		EAX,0
		MOV		AX,[ESI]
		MOV		wTreeSize,AX

		// Increment the Pointer to the Encoded Data
		ADD		ESI,2

		// Store the Start of the Compressed Data
		MOV		pInput,ESI

		// Compute the Root Index
		MOV		dwRootIndex,EAX
		SUB		dwRootIndex,3

		// Compute the Table Storage Requirement
		SHL		EAX,2
		MOV		dwStorage,EAX
	}

	// Copy the Decoding Byte Tree
	memblast(&wByteTree[0],pInput,dwStorage/2);

	// Convert the WORD Byte Tree to a DWORD Byte Tree
	W2D(&dwByteTree[0],&wByteTree[0],dwStorage/4);

	// Decode the Input Data
	__asm
	{
		// Increment the Pointer to the Data
		MOV		EAX,dwStorage
		SHR		EAX,1
		ADD		pInput,EAX

		// Point to the Byte Code Tree
		MOV		ESI,OFFSET dwByteTree[0]

		// Set the Loop Count for Amount of Bytes to Uncompress
		MOV		EDX,dwUnCount
		MOV		dwLoop,EDX

		// Calculate the Index of the Root
		MOV		EBX,dwRootIndex

		// Main Loop for Reading Bytes
		_LoopInput:

		// Point to the Source Data
		MOV		EDI,pInput

		// Read a DWORD of Encoded Data
		MOV		ECX,[EDI]

		// Increment the Source Data Pointer by a DWORD
		ADD		pInput,4

		// Initialize the Number of Bits to Process
		MOV		EAX,32

		// Left Shift the Encoded Data 1 Bit at a Time
		_LeftShift:

		// Initialize the Decode Storage
		MOV		EDX,0

		// Left Shift the Code into the Decode Storage
		SHL		ECX,1

		// Bit + 1 = Number of Children, ie The Direction in Tree to Move
		ADC		EDX,1

		// Index the Child of the Parent
		ADD		EBX,EDX

		// Decrement the Bits Processed
		DEC		EAX

		// Check for a Leaf Node
		MOV		EDI,[ESI + EBX * 4]
		CMP		EDI,256
		JLE		_LeafNode

		// Index the Child's Parent
		MOV		EDI,EBX
		SUB		EDI,EDX

		// Match the Child to a Parent
		_TestParent:

 		// Index the Previous Parent in the Tree
		SUB		EDI,3

		// Get the Child's Parent
		MOV		EDX,[ESI + EDI * 4]

		// Compare the Parent with the Child
		CMP		EDX,[ESI + EBX * 4]
		JNE		_TestParent

		// Update the Parent Index
		MOV		EBX,EDI

		// Check the Bits Processed upto this Point
		CMP		EAX,0

		// Check for More Bits to Process
		JNZ		_LeftShift

		// Read in another DWORD
		JMP		_LoopInput

		// Output a Decoded Symbol
		_LeafNode:

		// Point to the Destination Data
		MOV		EDI,pOutput

		// Output the Code
		MOV		EDX,[ESI + EBX * 4]
		MOV		[EDI],DL

		// Increment the Destination Data by 1 Byte
		INC		pOutput

		// Calculate the Index of the Root
		MOV		EBX,dwRootIndex

		// Decrement the Loop Counter
		DEC		dwLoop
		JZ		_Exit

		// Check for More Bits to Process
		CMP		EAX,0
		JNZ		_LeftShift

		// Read a New DWORD
		JMP		_LoopInput

		// Finished Decompressing
		_Exit:
	}

	// Restore the Pointer to the Start of the Input
	pInput = pStartInput;

	// Restore the Pointer to the Start of the Output
	pOutput = pStartOutput;

	// Return the Count of UnCompressed Data
	return dwUnCount;
}

// Copy a DWORD Array to a WORD Array
void D2W(void* dest,void* src,DWORD count)
{
	__asm
	{
		MOV		ESI,src		// Copy the Source Address to the Register
		MOV		EDI,dest	// Copy the Destination to the Register
		MOV		ECX,count	// Copy the Count to the Register

		_CopyD2W:
		MOV		EAX,[ESI]
		MOV		[EDI],AX
		ADD		ESI,4
		ADD		EDI,2
		DEC		ECX
		JNZ		_CopyD2W
	}
}

// Copy a WORD Array to a DWORD Array
void W2D(void* dest,void* src,DWORD count)
{
	__asm
	{
		MOV		ESI,src		// Copy the Source Address to the Register
		MOV		EDI,dest	// Copy the Destination to the Register
		MOV		ECX,count	// Copy the Count to the Register

		XOR		EAX,EAX
		_CopyW2D:
		MOV		AX,[ESI]
		MOV		[EDI],EAX
		ADD		ESI,2
		ADD		EDI,4
		DEC		ECX
		JNZ		_CopyW2D
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区色视频| 蜜桃av一区二区在线观看| 色综合色综合色综合色综合色综合 | 亚洲精品日产精品乱码不卡| 欧美a级理论片| 欧美做爰猛烈大尺度电影无法无天| 91精品国产综合久久香蕉的特点| 国产精品美女久久久久av爽李琼| 亚洲成人av一区二区三区| 国产福利精品导航| 欧美精品色一区二区三区| 中文字幕一区二区三| 国产呦精品一区二区三区网站| 欧美妇女性影城| 丝袜诱惑亚洲看片| 日韩欧美亚洲国产另类| 日本91福利区| 久久一夜天堂av一区二区三区| 美女视频免费一区| 26uuu欧美| 国产激情视频一区二区在线观看 | 亚洲欧美国产77777| 在线免费观看视频一区| 青青草国产成人av片免费| 国产精品视频一区二区三区不卡| 91九色02白丝porn| 国产高清精品久久久久| 亚洲最新在线观看| 国产精品午夜在线观看| 欧美伦理电影网| 91丨porny丨蝌蚪视频| 日本在线播放一区二区三区| 日韩一区在线播放| 日韩精品一区二区三区视频播放 | 国产欧美日韩另类视频免费观看| 国产凹凸在线观看一区二区| 韩国理伦片一区二区三区在线播放| 日韩福利电影在线| 九九精品一区二区| 国产成人亚洲综合a∨猫咪| 成人sese在线| 在线免费av一区| 日韩区在线观看| 精品国产一区二区三区久久影院 | 亚洲成av人片在线| 亚洲柠檬福利资源导航| 国产精品久99| 亚洲人成影院在线观看| 国产精品美女久久久久久久久久久 | 国产二区国产一区在线观看| 美女国产一区二区三区| 蜜桃视频在线观看一区二区| 亚欧色一区w666天堂| 日韩国产高清影视| 精品一区二区三区在线视频| 国内精品免费**视频| av中文字幕在线不卡| 欧美三级视频在线播放| 欧美日本高清视频在线观看| 日韩一区二区麻豆国产| 欧美经典一区二区| 亚洲最大成人综合| 激情图区综合网| 99国产精品久久久久| 欧美一卡2卡3卡4卡| 国产精品国产三级国产aⅴ原创 | 日韩av网站免费在线| 国产曰批免费观看久久久| 色综合久久中文字幕| 日韩网站在线看片你懂的| 国产夜色精品一区二区av| 欧美色网站导航| 午夜成人免费电影| 在线欧美日韩国产| 有坂深雪av一区二区精品| 粉嫩欧美一区二区三区高清影视| 日韩精品专区在线影院重磅| 美女网站色91| 精品国产乱码91久久久久久网站| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美精品123区| 激情六月婷婷久久| 欧美国产一区视频在线观看| 国产麻豆一精品一av一免费| 国产情人综合久久777777| 国产91精品一区二区麻豆网站| 国产三区在线成人av| 99精品桃花视频在线观看| 亚洲精品成a人| 欧美一卡2卡3卡4卡| 国产宾馆实践打屁股91| 一区二区高清免费观看影视大全| 色伊人久久综合中文字幕| 亚洲最大色网站| 精品粉嫩aⅴ一区二区三区四区| 国产一区二区在线观看视频| 国产精品久久久久久久浪潮网站| 日本久久一区二区| 理论片日本一区| 亚洲日本免费电影| 91麻豆精品国产91久久久久久| 国产精品一区二区三区网站| 亚洲色欲色欲www| 欧美va日韩va| 欧美伊人久久久久久久久影院 | 日韩理论在线观看| 欧美一区二区三区日韩| 国产91精品欧美| 国产亚洲一二三区| 色哦色哦哦色天天综合| 日本欧美久久久久免费播放网| 欧美精品一区二区三区高清aⅴ| 国产69精品一区二区亚洲孕妇 | 中文字幕一区二区三区不卡 | 亚洲妇熟xx妇色黄| 久久久久久久久久久99999| 欧美性一区二区| 国产激情一区二区三区桃花岛亚洲 | 精品少妇一区二区三区日产乱码 | 一区二区三区久久久| 欧美xxx久久| 欧美视频一区二| 99久久精品免费看国产| 精一区二区三区| 五月婷婷综合在线| 一区二区三区在线免费观看| 精品日韩一区二区| 欧美精品国产精品| 99久久99精品久久久久久| 国产宾馆实践打屁股91| 天涯成人国产亚洲精品一区av| 亚洲女同ⅹxx女同tv| 亚洲二区在线观看| 日韩精品一区二区三区视频播放 | 亚洲精品伦理在线| 国产精品不卡视频| 亚洲狠狠丁香婷婷综合久久久| 一区二区三区丝袜| 亚洲成在线观看| 欧美a级理论片| 国产在线一区二区综合免费视频| 午夜国产精品影院在线观看| 久久久亚洲高清| 亚洲精品在线网站| 欧美综合久久久| 99久久婷婷国产综合精品电影 | 亚洲精品成人少妇| 亚洲日本一区二区三区| 日韩美女啊v在线免费观看| 国产精品你懂的在线欣赏| 国产日本欧美一区二区| 日本一区二区免费在线| 国产欧美一区二区精品性色| 欧美激情一区在线| 1024亚洲合集| 日韩专区一卡二卡| 国产精品亚洲视频| 91亚洲精品久久久蜜桃网站| 在线视频综合导航| 欧美一区二区三区精品| 欧美成人精精品一区二区频| 国产精品素人视频| 亚洲高清一区二区三区| 精品一区二区三区免费毛片爱 | 国产日韩三级在线| 亚洲免费大片在线观看| 奇米色777欧美一区二区| 国产美女精品在线| 欧美视频一区二区三区在线观看| 日韩三级在线观看| 亚洲欧美激情在线| 老司机午夜精品| 91久久精品一区二区三| 26uuu国产一区二区三区| 亚洲精品国产品国语在线app| 免费欧美日韩国产三级电影| 91香蕉视频mp4| 亚洲精品一线二线三线无人区| 亚洲人123区| 成人av午夜电影| 精品成人一区二区三区| 天天做天天摸天天爽国产一区| 91小视频在线免费看| 91精品国产入口在线| 亚洲精品欧美激情| 不卡的av在线| 国产精品美女久久久久久2018| 免费观看在线色综合| 91精彩视频在线观看| 亚洲免费资源在线播放| 国产成人免费视频| 久久久久久久久久久久电影| 捆绑变态av一区二区三区| 欧美女孩性生活视频| 偷拍亚洲欧洲综合| 欧美日韩大陆一区二区| 亚洲国产精品久久久久婷婷884| 91亚洲国产成人精品一区二区三| **性色生活片久久毛片| 91麻豆国产香蕉久久精品|