Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
cb767f73
Commit
cb767f73
authored
Jan 02, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msrle32: Append EOI instead of replacing EOL.
parent
f9be296b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
5 deletions
+48
-5
msrle32.c
dlls/msrle32/msrle32.c
+6
-4
msrle.c
dlls/msrle32/tests/msrle.c
+42
-1
No files found.
dlls/msrle32/msrle32.c
View file @
cb767f73
...
...
@@ -256,7 +256,7 @@ static LONG MSRLE32_GetMaxCompressedSize(LPCBITMAPINFOHEADER lpbi)
}
size
=
(
2
+
a
*
(
2
+
((
a
+
2
)
&
~
2
))
+
b
*
(
2
+
((
b
+
2
)
&
~
2
)));
return
size
*
lpbi
->
biHeight
;
return
size
*
lpbi
->
biHeight
+
2
;
}
/* lpP => current pos in previous frame
...
...
@@ -820,14 +820,16 @@ LRESULT MSRLE32_CompressRLE8(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
}
}
/* add EOL
-- will be changed to EOI
*/
/* add EOL */
lpbiOut
->
biSizeImage
+=
2
;
*
((
LPWORD
)
lpOut
)
=
0
;
lpOut
+=
sizeof
(
WORD
);
}
/* change EOL to EOI -- end of image */
lpOut
[
-
1
]
=
1
;
/* add EOI -- end of image */
lpbiOut
->
biSizeImage
+=
2
;
*
lpOut
++
=
0
;
*
lpOut
++
=
1
;
assert
(
lpOut
==
(
lpOutStart
+
lpbiOut
->
biSizeImage
));
return
ICERR_OK
;
...
...
dlls/msrle32/tests/msrle.c
View file @
cb767f73
...
...
@@ -24,13 +24,40 @@
#include "wine/test.h"
static
void
test_output
(
const
BYTE
*
output
,
int
out_size
,
const
BYTE
*
expect
,
int
size
)
{
char
buf
[
512
],
*
ptr
;
int
i
;
i
=
out_size
==
size
&&
!
memcmp
(
output
,
expect
,
size
);
ok
(
i
,
"Unexpected output
\n
"
);
if
(
i
)
return
;
for
(
i
=
0
,
ptr
=
buf
;
i
<
out_size
;
i
++
)
ptr
+=
sprintf
(
ptr
,
"%x "
,
output
[
i
]);
trace
(
"Got: %s
\n
"
,
buf
);
for
(
i
=
0
,
ptr
=
buf
;
i
<
size
;
i
++
)
ptr
+=
sprintf
(
ptr
,
"%x "
,
expect
[
i
]);
trace
(
"Exp: %s
\n
"
,
buf
);
}
static
void
test_encode
(
void
)
{
DWORD
quality
;
BITMAPINFOHEADER
*
output_header
;
DWORD
output_size
,
flags
,
quality
;
BYTE
buf
[
64
];
ICINFO
info
;
HIC
hic
;
LRESULT
res
;
struct
{
BITMAPINFOHEADER
header
;
RGBQUAD
map
[
256
];
}
input_header
=
{
{
sizeof
(
BITMAPINFOHEADER
),
32
,
1
,
1
,
8
,
0
,
32
*
8
,
0
,
0
,
256
,
256
},
{{
255
,
0
,
0
},
{
0
,
255
,
0
},
{
0
,
0
,
255
},
{
255
,
255
,
255
}}};
static
BYTE
input1
[
32
]
=
{
1
,
2
,
3
,
3
,
3
,
3
,
2
,
3
,
1
};
static
const
BYTE
output1
[]
=
{
1
,
1
,
1
,
2
,
4
,
3
,
0
,
3
,
2
,
3
,
1
,
0
,
23
,
0
,
0
,
0
,
0
,
1
};
hic
=
ICOpen
(
FCC
(
'V'
,
'I'
,
'D'
,
'C'
),
FCC
(
'm'
,
'r'
,
'l'
,
'e'
),
ICMODE_COMPRESS
);
ok
(
hic
!=
NULL
,
"ICOpen failed
\n
"
);
...
...
@@ -55,6 +82,20 @@ static void test_encode(void)
res
=
ICSendMessage
(
hic
,
ICM_SETQUALITY
,
(
DWORD_PTR
)
&
quality
,
0
);
ok
(
res
==
ICERR_UNSUPPORTED
,
"ICSendMessage(ICM_SETQUALITY) failed: %ld
\n
"
,
res
);
output_size
=
ICCompressGetFormatSize
(
hic
,
&
input_header
.
header
);
ok
(
output_size
==
1064
,
"output_size = %d
\n
"
,
output_size
);
output_header
=
HeapAlloc
(
GetProcessHeap
(),
0
,
output_size
);
ICCompressGetFormat
(
hic
,
&
input_header
.
header
,
output_header
);
flags
=
0
;
res
=
ICCompress
(
hic
,
ICCOMPRESS_KEYFRAME
,
output_header
,
buf
,
&
input_header
.
header
,
input1
,
0
,
&
flags
,
0
,
0
,
0
,
NULL
,
NULL
);
ok
(
res
==
ICERR_OK
,
"ICCompress failed: %ld
\n
"
,
res
);
test_output
(
buf
,
output_header
->
biSizeImage
,
output1
,
sizeof
(
output1
));
todo_wine
ok
(
flags
==
(
AVIIF_TWOCC
|
AVIIF_KEYFRAME
),
"flags = %x
\n
"
,
flags
);
HeapFree
(
GetProcessHeap
(),
0
,
output_header
);
ICClose
(
hic
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment