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

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

?? rle.c

?? 《Visual C++網絡通信編程實用案例精選》配套源碼
?? C
字號:
// Run Length 編碼解碼函數集
#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;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆精品国产综合久久久久久| 久久99精品国产.久久久久久| 欧美精品99久久久**| 久久99热这里只有精品| 日韩一区欧美一区| 欧美一区二区三区人| 99久久婷婷国产综合精品| 日韩国产欧美在线观看| 久久久青草青青国产亚洲免观| 色婷婷综合激情| 精品一区二区久久久| 亚洲最快最全在线视频| 91久久精品网| 麻豆精品久久精品色综合| 亚洲天堂精品视频| 久久综合久久综合久久| 欧美艳星brazzers| 国产成a人无v码亚洲福利| 亚洲成av人影院在线观看网| 国产亚洲女人久久久久毛片| 欧美日韩国产影片| 国产xxx精品视频大全| 日本伊人色综合网| 一区二区高清在线| 亚洲欧美怡红院| 国产欧美中文在线| 日韩欧美成人一区| 欧美精品视频www在线观看| 色婷婷综合中文久久一本| 国产精品456| 看国产成人h片视频| 丝袜亚洲另类丝袜在线| 玉米视频成人免费看| 国产精品乱人伦中文| 精品国产髙清在线看国产毛片| 欧美日韩另类国产亚洲欧美一级| 色婷婷综合久色| 亚洲精品在线三区| 色婷婷精品大在线视频| 成人看片黄a免费看在线| 久久国产尿小便嘘嘘尿| 五月天激情综合网| 午夜精品久久久| 亚洲二区在线观看| 亚洲福利视频导航| 亚洲成人免费视| 一区二区久久久久久| 亚洲欧美日韩国产手机在线| 国产精品成人免费在线| 国产精品欧美综合在线| 国产精品你懂的在线| 国产精品系列在线| 国产精品久线观看视频| ...av二区三区久久精品| 中文字幕中文乱码欧美一区二区 | 久久综合999| 亚洲电影一区二区三区| 国产盗摄精品一区二区三区在线| 婷婷一区二区三区| 亚洲成人免费在线| 天堂成人国产精品一区| 日韩国产精品久久久| 蜜乳av一区二区| 国产综合久久久久久鬼色| 丰满岳乱妇一区二区三区| 99精品国产91久久久久久| 在线精品视频免费播放| 在线播放日韩导航| 欧美mv日韩mv国产| 国产精品区一区二区三| 一区二区三区在线免费| 日韩vs国产vs欧美| 国产精品国产馆在线真实露脸| 国产99一区视频免费| 国产精品一区二区免费不卡| 福利电影一区二区| 91蝌蚪国产九色| 欧美日韩国产首页| 精品99一区二区三区| 日韩美女精品在线| 五月天婷婷综合| 国产美女主播视频一区| 色婷婷精品大在线视频| 欧美一二三在线| 国产精品毛片高清在线完整版| 一区二区三区.www| 国产人妖乱国产精品人妖| 亚洲精品一线二线三线| 国产精品激情偷乱一区二区∴| 亚洲一区影音先锋| 韩国精品一区二区| 在线观看日韩高清av| 欧美精品一区视频| 国产精品入口麻豆原神| 国产精品久久看| 欧美综合欧美视频| 91麻豆精品国产自产在线观看一区 | 欧美日韩高清不卡| 国产亚洲成年网址在线观看| 一区二区三区中文免费| 精品一区二区三区在线视频| 91视频免费播放| 2欧美一区二区三区在线观看视频| 一区精品在线播放| 久久国产精品免费| 在线精品视频免费观看| 国产欧美在线观看一区| 日本va欧美va精品| 日本久久一区二区三区| 2020国产精品自拍| 亚洲1区2区3区4区| 99国产精品一区| 久久久久久麻豆| 同产精品九九九| 91丨九色丨蝌蚪富婆spa| 精品国产乱码久久久久久闺蜜| 亚洲成人精品在线观看| 一本色道久久综合亚洲91| 久久久天堂av| 欧美日韩美女一区二区| 中文字幕+乱码+中文字幕一区| 一区二区三区欧美视频| 国产精品一级二级三级| 8v天堂国产在线一区二区| 亚洲美女视频在线观看| 国产91丝袜在线18| 久久综合久久综合久久综合| 日本特黄久久久高潮| 欧美亚洲综合在线| 亚洲男帅同性gay1069| 成人性色生活片| 久久日一线二线三线suv| 蜜桃精品在线观看| 911精品产国品一二三产区| 亚洲图片欧美色图| 日本乱人伦aⅴ精品| 亚洲欧美电影院| 不卡免费追剧大全电视剧网站| 国产欧美精品一区二区三区四区 | 欧美成人三级在线| 免费在线观看一区| 日韩女优制服丝袜电影| 日产精品久久久久久久性色| 在线免费不卡视频| 亚洲综合一区二区三区| 在线欧美小视频| 亚洲制服欧美中文字幕中文字幕| 色狠狠色狠狠综合| 一区二区三区日韩欧美精品| 欧美性淫爽ww久久久久无| 一区二区三区色| 欧美日韩三级一区| 秋霞午夜av一区二区三区| 欧美成人精品1314www| 捆绑紧缚一区二区三区视频| 成人免费视频视频在线观看免费| 中文字幕成人网| 91麻豆6部合集magnet| 夜夜夜精品看看| 欧美男人的天堂一二区| 美女mm1313爽爽久久久蜜臀| 精品91自产拍在线观看一区| 国产成人欧美日韩在线电影| 中文字幕成人av| 在线中文字幕不卡| 亚洲成av人片一区二区| 日韩欧美亚洲一区二区| 国产综合久久久久久久久久久久| 亚洲国产精品ⅴa在线观看| av一区二区三区黑人| 亚洲一区二区三区影院| 欧美一级久久久| 国产a精品视频| 亚洲综合免费观看高清完整版在线| 欧美日韩精品是欧美日韩精品| 裸体一区二区三区| 国产欧美va欧美不卡在线| 色老头久久综合| 久久成人羞羞网站| 一区精品在线播放| 91精品在线观看入口| 国产成人激情av| 亚洲成人手机在线| 国产午夜精品在线观看| 欧美日韩亚洲综合一区 | 秋霞国产午夜精品免费视频| 欧美激情一区二区三区蜜桃视频| 在线观看不卡一区| 久久国产日韩欧美精品| 亚洲日本丝袜连裤袜办公室| 欧美一级搡bbbb搡bbbb| 高清日韩电视剧大全免费| 亚洲第一久久影院| 欧美国产综合色视频| 在线观看亚洲精品| 国产精品一区二区在线观看不卡 | 成人av在线看| 亚洲大片免费看| 久久久一区二区三区捆绑**| 欧美性做爰猛烈叫床潮|