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

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

?? rle.c

?? 串口通訊編程包括網(wǎng)絡流量監(jiān)控的等程序VC++編程語言與大家共享
?? C
字號:
// Module Name: RLE.c
//
// Description:
//    A implementation of Run Length Encoding and Decoding Routines
//
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "RLE.h"
#include "Client.h"

// Global Variables
DWORD	dwCodeLength = 19;

// Return the Run Length Encoded Size
DWORD RunLength(BYTE *pInput,DWORD dwCount)
{
	// Compressed Count
	DWORD	dwNewCount = 4;

	// Max Run Length
	DWORD	dwMaxRun;

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

	__asm
	{
		// Calculate the Maximum Run Length
		MOV		EDX,1
		MOV		ECX,dwCodeLength
		SUB		ECX,9
		SHL		EDX,CL
		SUB		EDX,1
		MOV		dwMaxRun,EDX

		// Load the Count of Bytes to Encode
		MOV		EDX,dwCount

		// Initialize the Output Bits
		XOR		EDI,EDI

		// Initialize the Storage DWORD
		XOR		ESI,ESI

		// Load the Byte to Compare
		_LoadByte:

		// Save the Storage DWORD
		PUSH	ESI

		// Load a Byte
		MOV		ESI,pInput
		MOV		AL,[ESI]

		// Initialize the Run Length Count to 1
		MOV		ECX,DWORD PTR 1

		// Compare the Bytes
		_CompareBytes:

		// Check for EOD
		CMP		EDX,0
		JZ		_Finished

		// Compare to the Max Length for an Encode
		CMP		ECX,dwMaxRun
		JA		_Finished

		// Compare the Bytes
		CMP		AL,[ESI + ECX]

		// Increment the Run Length
		LEA		ECX,[ECX + 1]

		// Decrement the Bytes Processed
		LEA		EDX,[EDX - 1]

		// Branch for the Comparison
		JE		_CompareBytes

		// Finished Encoding
		_Finished:

		// Decrement the Run Length for Encoding
		DEC		ECX

		// Increment the Pointer to the Source Data
		ADD		ESI,ECX
		MOV		pInput,ESI

		// Restore the Storage DWORD
		POP		ESI

		// Check for a 1:1 Character Copy
		CMP		ECX,1
		JNZ		_BuildCode

		// Move in the Character
		XOR		EBX,EBX
		MOV		BH,1
		MOV		BL,AL

		// Set the Code Length
		MOV		ECX,9

		// Jump to Checking the Bit Shifting
		JMP		_CheckShift

		// Build the Compression Code
		_BuildCode:
		MOV		EBX,ECX
		SHL		EBX,8
		MOV		BL,AL

		// Set the Code Length
		MOV		ECX,dwCodeLength

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

		// 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

		// Shift the Output Data
		_ShiftData:

		// 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

		// 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

		// Compare for More Data
		_Continue:
		CMP		EDX,0
		JZ		_Exit

		// Go Back for More Bytes
		JMP		_LoadByte

		// Finished Encoding
		_Exit:

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

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

		// Increment the Compression Count
		ADD		dwNewCount,4

		// Done Encoding
		_Done:
	}

	// Return the Compressed Count
	return dwNewCount;
}

// Run Length Encode the Input Data to the Output Data
DWORD RunLengthEncode(BYTE *pInput,DWORD dwCount,BYTE *pOutput)
{
	// Compressed Count
	DWORD	dwNewCount = 4;

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

	// Max Run Length
	DWORD	dwMaxRun;

	__asm
	{
		// Calculate the Maximum Run Length
		MOV		EDX,1
		MOV		ECX,dwCodeLength
		SUB		ECX,9
		SHL		EDX,CL
		SUB		EDX,1
		MOV		dwMaxRun,EDX

		// Point to the Input Byte
		MOV		EDI,pOutput

		// Load the Count of Bytes to Encode
		MOV		EDX,dwCount

		// Store the Original Length in the Compressed Data
		MOV		[EDI],EDX

		// Increment the Input Data Pointer
		ADD		EDI,4
		MOV		pOutput,EDI

		// Initialize the Output Bits
		XOR		EDI,EDI

		// Initialize the Storage DWORD
		XOR		ESI,ESI

		// Load the Byte to Compare
		_LoadByte:

		// Save the Storage DWORD
		PUSH	ESI

		// Load a Byte
		MOV		ESI,pInput
		MOV		AL,[ESI]

		// Initialize the Run Length Count to 1
		MOV		ECX,DWORD PTR 1

		// Compare the Bytes
		_CompareBytes:

		// Check for EOD
		CMP		EDX,0
		JZ		_Finished

		// Compare to the Max Length for an Encode
		CMP		ECX,dwMaxRun
		JA		_Finished

		// Compare the Bytes
		CMP		AL,[ESI + ECX]

		// Increment the Run Length
		LEA		ECX,[ECX + 1]

		// Decrement the Bytes Processed
		LEA		EDX,[EDX - 1]

		// Branch for the Comparison
		JE		_CompareBytes

		// Finished Encoding
		_Finished:

		// Decrement the Run Length for Encoding
		DEC		ECX

		// Increment the Pointer to the Source Data
		ADD		ESI,ECX
		MOV		pInput,ESI

		// Restore the Storage DWORD
		POP		ESI

		// Check for a 1:1 Character Copy
		CMP		ECX,1
		JNZ		_BuildCode

		// Move in the Character
		XOR		EBX,EBX
		MOV		BH,1
		MOV		BL,AL

		// Set the Code Length
		MOV		ECX,9

		// Jump to Checking the Bit Shifting
		JMP		_CheckShift

		// Build the Compression Code
		_BuildCode:
		MOV		EBX,ECX
		SHL		EBX,8
		MOV		BL,AL

		// Set the Code Length
		MOV		ECX,dwCodeLength

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

		// 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

		// Shift the Output Data
		_ShiftData:

		// 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
		ADD		EDI,4
		MOV		pOutput,EDI
		POP		EDI

		// 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

		// Compare for More Data
		_Continue:
		CMP		EDX,0
		JZ		_Exit

		// Go Back for More Bytes
		JMP		_LoadByte

		// Finished Encoding
		_Exit:

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

		// 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

		// Done Encoding
		_Done:
	}

	// Return the Compressed Count
	return dwNewCount;
}

// Run Length Decode the Input Data to the Output Data
DWORD RunLengthDecode(BYTE *pInput,BYTE *pOutput)
{
	// Compressed Count
	DWORD	dwCount;
	DWORD	dwCompCount;
	DWORD	dwCodeLength2;

	__asm
	{
		// Get the CodeLength - 1 for Checking a 1:1 Compression
		MOV		EAX,dwCodeLength
		DEC		EAX
		MOV		dwCodeLength2,EAX

		// Point to the Input Byte
		MOV		ESI,pInput

		// Point to the Output Byte
		MOV		EDI,pOutput

		// Load the Count of Bytes Encoded
		LODSD

		// Save the New Input Location
		MOV		pInput,ESI

		// Save the Count of the UnCompressed Data
		MOV		dwCompCount,EAX

		// Initialize the Count of Bytes Decoded
		MOV		dwCount,EAX

		// Initialize Number of Bits for Current Symbol to Process
		MOV		ESI,dwCodeLength

		// Initialize the Decode Storage
		XOR		EDX,EDX

		// Main Loop for Reading Input
		_LoopInput:

		// Save the Number of Bits for the Current Symbol
		PUSH	ESI

		// Point to the Input Data
		MOV		ESI,pInput

		// Read an Encoded DWORD
		LODSD

		// Save the Pointer to the Input Data
		MOV		pInput,ESI

		// Restore the Number of Bits for the Current Symbol
		POP		ESI

		// Initialize Number of Bits to Process
		MOV		EBX,32

		// Shift in an Encoded Symbol, 1 bit at a time
		_LeftShift:

		// Shift 1 Bit of the Input Code to the Output
		SHLD	EDX,EAX,1

		// Shift the Input Code 1 Bit to the Left
		SHL		EAX,1

		// Decrement the Number of Bits Processed
		DEC		ESI

		// Check for a Fully Encoded Symbol
		JZ		_Output

		// Compare the High Bit for RLE or Character Encode
		CMP		ESI,dwCodeLength2
		JNZ		_CheckBits

		// Compare the High Bit, 0 = RLE, 1 = 1:1 Character Encode
		CMP		EDX,0
		JZ		_CheckBits

		// Update the Bits Left to 8
		MOV		ESI,8

		// Check for More Bits to Process
		_CheckBits:

		// Decrement the Number of Bits Processed in the Input DWORD
		DEC		EBX

		// Continue Shifting More Bits
		JNZ		_LeftShift

		// Read Another DWORD of Data
		JMP		_LoopInput

		// Output the Run Length Amount of the Code
		_Output:

		// Get the Run Length
		MOV		ECX,EDX
		SHR		ECX,8

		// Get the Code
		AND		EDX,255

		// Save the Input DWORD
		PUSH	EAX

		// Copy the Code
		MOV		EAX,EDX

		// Save the Run Length
		PUSH	ECX

		// Output the Run Length Amount of the Code
		REP		STOSB

		// Restore the Run Length
		POP		ECX

		// Restore the Input DWORD
		POP		EAX

		// Check for More Data to Decode
		SUB		dwCompCount,ECX
		JZ		_Exit

		// Initialize the Decode Storage
		XOR		EDX,EDX

		// Initialize Number of Bits for Current Symbol to Process
		MOV		ESI,dwCodeLength

		// Check for More Bits to Process
		JMP		_CheckBits

		// Finished
		_Exit:
	}

	// Return the Count of Uncompressed Data
	return dwCount;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产一区久久| 伦理电影国产精品| 九色porny丨国产精品| 91尤物视频在线观看| 精品国产伦一区二区三区观看体验 | 夜夜夜精品看看| 精品一区二区三区不卡| 欧美日韩国产美女| 中文字幕五月欧美| 国产成人午夜片在线观看高清观看| 欧美日韩一区视频| 亚洲精品美国一| 91老师国产黑色丝袜在线| 久久精品一区蜜桃臀影院| 麻豆成人av在线| 欧美高清视频不卡网| 亚洲欧美在线观看| 成人天堂资源www在线| www一区二区| 国产一区二区成人久久免费影院| 91精品国产入口| 日日夜夜精品免费视频| 欧美三级电影精品| 亚洲va国产天堂va久久en| 欧美视频三区在线播放| 一区二区日韩av| 欧美性生活影院| 午夜私人影院久久久久| 欧美在线观看一二区| 亚洲精品成人精品456| 色婷婷久久久亚洲一区二区三区 | 一区二区三区欧美亚洲| a美女胸又www黄视频久久| 国产精品久久久久久久久免费相片| 极品销魂美女一区二区三区| 日韩欧美在线观看一区二区三区| 美美哒免费高清在线观看视频一区二区| 欧美日韩大陆一区二区| 五月天激情综合| 日韩一区二区精品在线观看| 久久成人羞羞网站| 国产视频一区二区在线观看| 国产成人免费xxxxxxxx| 亚洲欧洲日韩一区二区三区| 在线亚洲+欧美+日本专区| 亚洲成人精品在线观看| 日韩色视频在线观看| 国产剧情一区二区三区| 国产精品视频一二三区 | 91麻豆精品91久久久久同性| 日韩精品免费专区| www激情久久| 91丨九色丨蝌蚪丨老版| 日韩影视精彩在线| 久久久久国色av免费看影院| 91女人视频在线观看| 亚洲欧美日韩在线不卡| 欧美日韩亚洲国产综合| 国产乱淫av一区二区三区| 最新不卡av在线| 在线成人免费视频| 国产精品一区三区| 亚洲午夜久久久| 久久久久久久久久久99999| 色综合中文综合网| 久久综合999| 色偷偷成人一区二区三区91 | 99v久久综合狠狠综合久久| 亚洲va国产va欧美va观看| 久久亚洲精精品中文字幕早川悠里| 99在线精品观看| 一区二区三区日韩精品| 久久九九久精品国产免费直播| 91蜜桃在线免费视频| 久久99热狠狠色一区二区| 亚洲男人电影天堂| 亚洲精品在线电影| 在线免费视频一区二区| 国产成人精品影院| 青青草伊人久久| 亚洲欧美视频在线观看| 久久蜜臀精品av| 欧美日本韩国一区二区三区视频 | 69av一区二区三区| 99re66热这里只有精品3直播| 久久成人综合网| 亚洲777理论| 亚洲激情五月婷婷| 国产视频不卡一区| 久久综合中文字幕| 91精品婷婷国产综合久久| 色狠狠综合天天综合综合| 国产99精品国产| 国产毛片一区二区| 蜜臀av一区二区| 亚洲成av人片一区二区三区| 亚洲乱码国产乱码精品精可以看 | 欧美精品一区二区三区很污很色的| 色视频成人在线观看免| 大胆亚洲人体视频| 国产精品18久久久久久久久久久久| 婷婷国产在线综合| 婷婷开心激情综合| 亚洲电影第三页| 亚洲超碰精品一区二区| 亚洲成人一二三| 亚洲亚洲精品在线观看| 一区二区在线免费观看| 夜夜嗨av一区二区三区中文字幕| 中文字幕第一区综合| 欧美激情在线看| 亚洲国产电影在线观看| 国产精品人成在线观看免费| 欧美高清在线视频| 自拍偷拍国产亚洲| 夜夜精品视频一区二区 | 欧美日韩一区不卡| 欧美日韩国产免费一区二区 | 在线观看不卡一区| 精品视频在线免费| 日韩限制级电影在线观看| 欧美一级在线视频| 日韩欧美中文一区二区| 亚洲精品在线三区| 国产精品卡一卡二卡三| 一区二区视频在线看| 首页欧美精品中文字幕| 久久国产人妖系列| 福利电影一区二区| 97se亚洲国产综合自在线不卡| 在线观看日韩一区| 91精品国产综合久久久久久久久久 | 欧美aaaaaa午夜精品| 国产精品伊人色| 99re成人精品视频| 色婷婷亚洲精品| 欧美一区二区精美| 国产欧美日韩亚州综合| 亚洲蜜桃精久久久久久久| 午夜精品久久久久久久久| 精彩视频一区二区三区| 99视频超级精品| 欧美一卡二卡三卡| 国产精品久久久久影院老司| 午夜精品福利视频网站| 国产成人精品一区二| 欧美日韩免费在线视频| 欧美激情在线观看视频免费| 亚洲成av人在线观看| 成人一区二区三区视频| 欧美日韩精品免费观看视频| 精品久久久久久久久久久久包黑料 | 在线观看视频欧美| 久久亚洲影视婷婷| 亚洲国产wwwccc36天堂| 国产成人精品免费一区二区| 欧美日韩在线综合| 国产欧美日韩综合精品一区二区 | 欧美日韩国产另类一区| 久久九九国产精品| 日韩av电影一区| 一本到不卡精品视频在线观看| 精品国产一二三区| 亚洲国产精品久久不卡毛片 | 成人精品视频一区二区三区尤物| 欧美日韩黄视频| 国产欧美日韩在线| 日日夜夜免费精品| 日本丶国产丶欧美色综合| 久久这里只有精品视频网| 亚洲高清免费观看高清完整版在线观看| 国产在线麻豆精品观看| 在线电影欧美成精品| 亚洲在线一区二区三区| www.成人在线| 欧美国产日产图区| 黄色日韩三级电影| 欧美精品一二三| 亚洲成人综合网站| 欧美日韩三级一区| 亚洲卡通欧美制服中文| 成人精品国产一区二区4080| 2021国产精品久久精品| 激情久久五月天| ww久久中文字幕| 久久国产精品99久久人人澡| 51精品秘密在线观看| 天堂精品中文字幕在线| 欧美日韩一区三区| 午夜天堂影视香蕉久久| 欧美精品在欧美一区二区少妇| 一区二区三区毛片| 色8久久精品久久久久久蜜| 久久久www成人免费无遮挡大片| 日欧美一区二区| 日韩一区二区在线免费观看| 男人的j进女人的j一区| 日韩一级片在线播放| 激情综合一区二区三区| 久久影院午夜论|