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

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

?? rle.c

?? 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一区二区三区免费野_久草精品视频
在线观看国产日韩| 国产成人啪免费观看软件| 欧美在线啊v一区| 亚洲与欧洲av电影| 中文字幕高清一区| 高清成人在线观看| 中文字幕免费一区| 99国产精品一区| 亚洲午夜电影在线| 欧美一区二视频| 激情av综合网| 国产精品蜜臀在线观看| 色综合久久99| 亚洲一区二区美女| 日韩欧美亚洲国产另类| 成人性色生活片免费看爆迷你毛片| 国产精品久久午夜| 欧美日韩视频一区二区| 蜜臀av在线播放一区二区三区| 精品久久久久久久久久久久包黑料| 国产成人在线影院| 亚洲精品免费播放| 日韩一级成人av| 丁香婷婷综合激情五月色| 亚洲欧美日韩国产综合| 欧美精品黑人性xxxx| 国产一区二区三区免费在线观看| 国产精品久久久久久久久动漫 | eeuss鲁片一区二区三区| 亚洲三级在线看| 欧美精品日日鲁夜夜添| 国产盗摄一区二区| 亚洲bt欧美bt精品| 国产精品网站一区| 欧美精品xxxxbbbb| 成人av午夜影院| 久久国产婷婷国产香蕉| 成人免费在线播放视频| 日韩欧美久久一区| 日本韩国一区二区三区视频| 六月婷婷色综合| 亚洲综合一区二区精品导航| 久久新电视剧免费观看| 精品视频一区 二区 三区| 国产精品亚洲人在线观看| 天天爽夜夜爽夜夜爽精品视频| 国产日韩欧美精品电影三级在线| 欧美日韩一区二区三区在线 | 国产v综合v亚洲欧| 日韩高清欧美激情| 亚洲女人的天堂| 久久午夜国产精品| 欧美剧情电影在线观看完整版免费励志电影| 紧缚捆绑精品一区二区| 亚洲国产日韩综合久久精品| 欧美激情在线一区二区三区| 日韩欧美第一区| 欧美亚洲国产一区二区三区va| 不卡一区在线观看| 国产成人av电影免费在线观看| 久久99精品久久久久久国产越南| 亚洲自拍都市欧美小说| 国产精品久久久久一区| 国产午夜精品一区二区三区四区| 欧美日韩国产成人在线91| 色狠狠一区二区| av亚洲精华国产精华精| 国产精品一二三四区| 精品在线一区二区| 日本午夜精品视频在线观看| 亚洲国产va精品久久久不卡综合| 中文字幕亚洲一区二区va在线| 国产区在线观看成人精品| 精品国产乱码久久久久久蜜臀| 欧美美女网站色| 欧美日韩精品综合在线| 欧美午夜电影在线播放| 欧美私人免费视频| 欧美视频一区二区三区四区| 欧美性受极品xxxx喷水| 欧美系列亚洲系列| 欧美日韩精品久久久| 69成人精品免费视频| 777xxx欧美| 日韩欧美一区在线| 精品国产成人系列| 久久久久久久久伊人| 欧美国产日本韩| 自拍偷拍欧美精品| 一区二区国产视频| 天堂va蜜桃一区二区三区| 日本美女一区二区| 国产毛片精品一区| 99精品视频免费在线观看| 91在线视频官网| 欧美日韩亚洲不卡| 欧美一二三区精品| 久久精品欧美日韩精品 | 欧美不卡一区二区三区四区| 欧美成人综合网站| 国产欧美一区二区三区在线老狼| 中文字幕乱码一区二区免费| 亚洲欧美日韩中文播放| 午夜欧美视频在线观看| 精品一区二区精品| 91在线你懂得| 51久久夜色精品国产麻豆| 26uuu亚洲综合色欧美 | 欧美羞羞免费网站| 精品国精品国产| 亚洲女厕所小便bbb| 日韩和欧美一区二区三区| 国产呦精品一区二区三区网站| 国产v日产∨综合v精品视频| 欧美性大战久久久久久久蜜臀| 日韩一区二区精品葵司在线| 国产三级精品三级在线专区| 一区二区视频在线| 欧美a级理论片| 99久久99精品久久久久久| 91.xcao| 中文字幕免费一区| 日韩av一级片| 91毛片在线观看| 亚洲精品一线二线三线| 亚洲尤物视频在线| 成人小视频免费观看| 欧美日本视频在线| 国产精品女主播在线观看| 日韩精品一区第一页| av电影天堂一区二区在线观看| 欧美精品久久天天躁| 中文字幕在线观看一区| 久久国产精品一区二区| 欧洲日韩一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲国产中文字幕在线视频综合| 国产99久久久国产精品潘金| 欧美男人的天堂一二区| 中文字幕一区视频| 国产美女av一区二区三区| 欧美精品在线观看播放| 伊人色综合久久天天| 成人免费高清在线| 亚洲精品一区二区在线观看| 亚洲sss视频在线视频| 色又黄又爽网站www久久| 亚洲国产精品精华液2区45| 日韩va欧美va亚洲va久久| 91国产成人在线| 国产精品拍天天在线| 国产成人一区二区精品非洲| 欧美成人精品高清在线播放| 水蜜桃久久夜色精品一区的特点| 色综合久久久久| 最新欧美精品一区二区三区| 成人免费看片app下载| 精品91自产拍在线观看一区| 美洲天堂一区二卡三卡四卡视频| 欧美三级日韩在线| 亚洲福利电影网| 在线视频综合导航| 亚洲制服丝袜av| 欧美色男人天堂| 亚洲国产精品久久久久婷婷884| 色诱视频网站一区| 亚洲综合丁香婷婷六月香| 一本久久a久久免费精品不卡| 中文字幕av资源一区| 国产成人av电影在线观看| 国产欧美精品一区aⅴ影院| 国产精品99久久久| 国产丝袜欧美中文另类| 成人高清免费观看| 中文字幕日本不卡| 91视频www| 亚洲在线中文字幕| 911精品国产一区二区在线| 秋霞影院一区二区| 精品国产a毛片| 国产乱理伦片在线观看夜一区| 久久综合久久鬼色中文字| 国产精品一二三区在线| 国产精品美女久久久久aⅴ | 国产一区二区三区四| 国产欧美一区二区精品性色| 成人97人人超碰人人99| 亚洲色图视频网站| 欧美乱妇20p| 久88久久88久久久| 中文字幕精品一区二区精品绿巨人| 成人精品视频网站| 夜夜嗨av一区二区三区| 欧美高清视频在线高清观看mv色露露十八 | 丝袜诱惑亚洲看片| 精品剧情在线观看| 成人黄色在线看| 亚洲一区二区三区中文字幕 | 欧美精品一区二区三区四区 | 国产日韩在线不卡|