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

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

?? rle.c

?? VC++網(wǎng)絡(luò)通信編程實(shí)例案例精選》源代碼 第三部分
?? C
字號(hào):
// Run Length 編碼解碼函數(shù)集
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "RLE.h"
#include "Server.h"

DWORD	dwCodeLength = 19;

DWORD RunLength(BYTE *pInput,DWORD dwCount)
{
	DWORD	dwNewCount = 4;
	DWORD	dwMaxRun;
	DWORD	dwUnusedByte = 0;
	BOOL	fOutput = FALSE;

	__asm
	{
		MOV		EDX,1
		MOV		ECX,dwCodeLength
		SUB		ECX,9
		SHL		EDX,CL
		SUB		EDX,1
		MOV		dwMaxRun,EDX

		MOV		EDX,dwCount

		XOR		EDI,EDI

		XOR		ESI,ESI

		_LoadByte:

		PUSH	ESI

		MOV		ESI,pInput
		MOV		AL,[ESI]

		MOV		ECX,DWORD PTR 1

		_CompareBytes:

		CMP		EDX,0
		JZ		_Finished

		CMP		ECX,dwMaxRun
		JA		_Finished

		CMP		AL,[ESI + ECX]

		LEA		ECX,[ECX + 1]

		LEA		EDX,[EDX - 1]

		JE		_CompareBytes

		_Finished:

		DEC		ECX

		ADD		ESI,ECX
		MOV		pInput,ESI

		POP		ESI

		CMP		ECX,1
		JNZ		_BuildCode

		XOR		EBX,EBX
		MOV		BH,1
		MOV		BL,AL

		MOV		ECX,9

		JMP		_CheckShift

		_BuildCode:
		MOV		EBX,ECX
		SHL		EBX,8
		MOV		BL,AL

		MOV		ECX,dwCodeLength

		_CheckShift:
		ADD		EDI,ECX
		CMP		EDI,32
		JLE		_ShiftData

		SUB		EDI,32

		SUB		ECX,EDI

		MOV		dwUnusedByte,EBX

		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;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区在线观看乱码 | 高潮精品一区videoshd| 欧美在线三级电影| 亚洲欧洲国产日本综合| 国产精品亚洲成人| 亚洲高清视频的网址| 日本二三区不卡| 一区二区三区四区视频精品免费| 国产高清不卡一区二区| 国产精品网曝门| 懂色av噜噜一区二区三区av| 日韩精品一级二级| 欧美一区二区三区小说| 久久狠狠亚洲综合| 久久婷婷国产综合精品青草| 国产福利一区二区三区视频在线 | 欧美日韩国产系列| 日韩高清在线不卡| 精品久久久久久久久久久久久久久久久 | 欧美一区二区在线播放| 色偷偷成人一区二区三区91| 亚洲一区二区视频| 精品久久人人做人人爽| 欧美午夜不卡视频| 国产中文一区二区三区| 中文字幕一区av| 国产婷婷一区二区| 在线视频一区二区三区| 91污片在线观看| 天天av天天翘天天综合网| 日韩你懂的在线观看| 成人亚洲精品久久久久软件| 夜夜精品视频一区二区| 亚洲欧洲制服丝袜| 欧美r级电影在线观看| 宅男在线国产精品| 粉嫩aⅴ一区二区三区四区五区| 久久99在线观看| 免费成人你懂的| 亚洲精品中文在线影院| 欧美va在线播放| 91精品欧美福利在线观看| 51精品久久久久久久蜜臀| 欧美人与禽zozo性伦| 7777女厕盗摄久久久| 91精品国产91热久久久做人人 | 亚洲国产成人av好男人在线观看| 亚洲免费观看高清完整| 亚洲精品一二三| 一区二区三区四区亚洲| 亚洲国产精品久久艾草纯爱| 午夜视频在线观看一区| 日韩成人免费电影| 久久99精品久久只有精品| 亚洲一区在线看| 婷婷夜色潮精品综合在线| 免费在线观看一区| 国产一区二区在线观看免费| 亚洲成av人片一区二区梦乃| 国产精品对白交换视频| 精品99一区二区| 91精品国产综合久久久久久久 | 成人av资源网站| 另类小说图片综合网| 国产一区二区三区最好精华液| 国模套图日韩精品一区二区| 高清不卡一区二区在线| 91捆绑美女网站| 在线不卡一区二区| 欧美网站大全在线观看| 日韩丝袜美女视频| 欧美久久久久久蜜桃| 日韩欧美综合一区| 国产嫩草影院久久久久| 欧美精品一区二区三区高清aⅴ| 国产欧美一区二区精品婷婷| 亚洲男女毛片无遮挡| 日韩高清国产一区在线| 国产一区二区三区在线观看精品| 成人18视频在线播放| 欧美日韩久久一区| 国产欧美精品一区| 亚洲午夜在线观看视频在线| 久久国产精品第一页| 99久久婷婷国产综合精品电影| 福利电影一区二区| 欧美日韩和欧美的一区二区| 久久综合久久综合亚洲| 一区二区高清在线| 韩国成人精品a∨在线观看| 91捆绑美女网站| 亚洲精品在线三区| 亚洲在线免费播放| 丁香六月久久综合狠狠色| 欧美日韩一区二区欧美激情| 欧美日韩精品一区二区三区四区 | 国产精品免费看片| 日韩高清欧美激情| 91亚洲国产成人精品一区二区三| 日韩视频中午一区| 亚洲一二三四在线| 国产69精品久久久久777| 欧美日本在线一区| 亚洲人妖av一区二区| 亚洲影院免费观看| 成人精品视频网站| 日韩欧美国产一二三区| 一片黄亚洲嫩模| 成人精品鲁一区一区二区| 欧美一卡二卡三卡| 亚洲一二三四区| 不卡视频一二三四| 久久久久国产免费免费| 亚洲色图20p| 国产麻豆91精品| 欧美电影免费观看高清完整版在| 亚洲精品成人在线| 99精品热视频| 国产精品五月天| 国产精品一级二级三级| 精品免费国产一区二区三区四区| 亚洲国产另类精品专区| 日本精品一区二区三区高清| 国产精品久久二区二区| 国产精品白丝av| 久久婷婷色综合| 国产在线精品一区二区| 欧美成人一区二区三区 | 成人美女视频在线看| 26uuu国产电影一区二区| 老司机一区二区| 日韩欧美成人午夜| 青青草成人在线观看| 欧美一级欧美三级在线观看| 午夜久久电影网| 欧美精品tushy高清| 午夜精品久久久久久久久久| 欧美性猛片xxxx免费看久爱| 亚洲一区在线电影| 欧美日韩国产高清一区| 亚洲va中文字幕| 777亚洲妇女| 另类小说综合欧美亚洲| 久久久影视传媒| 丁香婷婷综合激情五月色| 欧美国产综合色视频| 亚洲国产精品一区二区www在线| 在线亚洲一区二区| 亚洲电影视频在线| 欧美精品久久一区二区三区| 青青草精品视频| 精品免费日韩av| 国产91精品精华液一区二区三区 | 成人欧美一区二区三区黑人麻豆 | 欧美日韩大陆一区二区| 日本成人超碰在线观看| 26uuu国产日韩综合| 粉嫩一区二区三区性色av| 中文字幕中文字幕在线一区| 91看片淫黄大片一级| 午夜视黄欧洲亚洲| 精品日韩av一区二区| 成人午夜又粗又硬又大| 亚洲精品少妇30p| 91精品国产综合久久久久久久久久| 精品一区二区免费看| 中文字幕乱码亚洲精品一区| 在线观看网站黄不卡| 日韩二区三区四区| 国产天堂亚洲国产碰碰| 91九色最新地址| 久久国产福利国产秒拍| 国产精品久久久久久久久搜平片| 色婷婷精品大视频在线蜜桃视频| 天天亚洲美女在线视频| 久久久www成人免费毛片麻豆 | 日本道在线观看一区二区| 日韩av一区二区在线影视| 久久亚洲免费视频| 一本一道久久a久久精品综合蜜臀| 日韩成人一级片| 中文字幕av不卡| 337p亚洲精品色噜噜| 国产成人精品影院| 午夜精品福利在线| 中文字幕av一区二区三区| 67194成人在线观看| jlzzjlzz欧美大全| 国产精品麻豆一区二区| 欧美日韩亚洲综合一区二区三区| 国产一区欧美二区| 五月天亚洲婷婷| 中文字幕亚洲一区二区av在线| 91麻豆精品国产自产在线观看一区| 国产毛片精品一区| 日一区二区三区| 亚洲女与黑人做爰| 久久久亚洲精品一区二区三区| 欧美三级中文字| 成人99免费视频|