我今天在修改eboot的开机logo的时候发现我的bootloader中居然是用了压缩算法 我人为是压缩算法
下面是源程序,这个图像的压缩是怎么实现的?
#define RLE_MARK 0x1234
static void
rle_express(const unsigned short *src, unsigned short *tgt, int cnt)
{
unsigned short a;
unsigned short n;
unsigned short i;
while (cnt)
{
a = *src++;
if (a == RLE_MARK)
{
a = *src++;
n = *src++;
for (i = 0; i < n; i++)
*tgt++ = a;
cnt -= 3;
}
else
{
*tgt++ = a;
cnt--;
}
}
}
下面是那个数组
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Module Name: bitmap.c
Date Created: 10/30/2002
Abstract: This file contains a 16 bpp bitmap image displayed during boot-up.
Functions:
Notes:
--*/
#include
const unsigned short ScreenBitmap[] =
{
/* File Size = 25800, Zipped Size = 8a8c, 23 % */
0x1234,0xffff,0x0d2f,0x0000,0x0000,0x0000,0x1234,0xffff,0x0027,0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,0x0000,
0x0000,0x0000,0x1234,0xffff,0x00bd,0x0000,0x0000,0x0000,0x1234,0xffff,0x0027,0x0000,0x0000,0x0000,0xffff,0xffff,
0xffff,0x0000,0x0000,0x0000,0x1234,0xffff,0x00bd,0x0000,0x0000,0x0000,0x1234,0xffff,0x0027,0x0000,0x0000,0x0000,
0xffff,0xffff,0xffff,0x0000,0x0000,0x0000,0x1234,0xffff,0x003a,0xffdf,0xffff,0xffff,0xffdf,0xffff,0xffdf,0x1234,
0xffff,0x007d,0x0000,0x0000,0x0000,0x1234,0xffff,0x0027,0x0000,0x0000,0x0000,0x1234,0xffff,0x0044,0xffdf,0x1234,
0xffff,0x001b,0xffdf,0xffff,0xffff,0xffff,0xffdf,0x1234,0xffff,0x005e,0x0000,0x0000,0x0000,0x1234,0xffff,0x0027,
0x0000,0x0000,0x0000,0x1234,0xffff,0x0041,0xffdf,0x1234,0xffff,0x0004,0xffdf,0x1234,0xffff,0x0019,0xffdf,0x1234,
0xffff,0x0005,0xffdf,0x1234,0xffff,0x005c,0x0000,0x0000,0x0000,0x1234,0xffff,0x0009,0x1234,0x0000,0x0009,0xffff,
0xffff,0xffff,0x1234,0x0000,0x0009,0xffff,0xffff,0xffff,0x1234,0x0000,0x0009,0xffff,0xffff,0xffff,0x0000,0x0000,
0x0000,0xffff,0xffff,0xffff,0x1234,0x0000,0x0009,0xffff,0xffff,0xffff,0x1234,0x0000,0x0009,0x1234,0xffff,0x0024,
0xffdf,0xffff,0xffdf,0x1234,0xffff,0x001c,0xffdf,0xffff,0xffff,0xffff,0xffdf,0xffff,0xffdf,0x1234,0xffff,0x005b,
0x0000,0x0000,0x0000,0x1234,0xffff,0x0009,0x1234,0x0000,0x0009,0xffff,0xffff,0xffff,0x1234,0x0000,0x0009,0xffff,
0xffff,0xffff,0x1234,0x0000,0x0009,0xffff,0xffff,0xffff,0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,0x1234,0x0000,
0x0009,0xffff,0xffff,0xffff,0x1234,0x0000,0x0009,0x1234,0xffff,0x0022,0xffdf,0xffdf,0xffff,0xef5d,0xb576,0x7bef,
0xd67a,0x1234,0xffff,0x001d,0xffdf,0x1234,0xffff,0x005e,0x0000,0x0000,0x0000,0x1234,0xffff,0x0009,0x0000,0x0000,
0x0000,0xffff,0xffff,0xffff,0x0000,0x0000,0x0000,0x1234,0xffff,0x0009,0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,
0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,0x0000,0x0000,0x0000,0xffff,
0xffff,0xffff,0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,0x0000,0x0000,0x0000,0xffff,0xffff,0xffff,0x0000,0x0000,
0
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
太长截之
};
|