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
55784465
Commit
55784465
authored
Apr 10, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Apr 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvidc: Fix 16bit VIDEO-1/CRAM decompression.
parent
c29cf059
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
33 deletions
+22
-33
msvideo1.c
dlls/msvidc32/msvideo1.c
+22
-33
No files found.
dlls/msvidc32/msvideo1.c
View file @
55784465
...
...
@@ -95,10 +95,18 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s
blocks_high
=
height
/
4
;
total_blocks
=
blocks_wide
*
blocks_high
;
block_inc
=
4
;
#ifdef ORIGINAL
row_dec
=
stride
+
4
;
#else
row_dec
=
-
(
stride
-
4
);
/* such that -row_dec > 0 */
#endif
for
(
block_y
=
blocks_high
;
block_y
>
0
;
block_y
--
)
{
#ifdef ORIGINAL
block_ptr
=
((
block_y
*
4
)
-
1
)
*
stride
;
#else
block_ptr
=
((
blocks_high
-
block_y
)
*
4
)
*
stride
;
#endif
for
(
block_x
=
blocks_wide
;
block_x
>
0
;
block_x
--
)
{
/* check if this block should be skipped */
if
(
skip_blocks
)
{
...
...
@@ -131,16 +139,7 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s
for
(
pixel_y
=
0
;
pixel_y
<
4
;
pixel_y
++
)
{
for
(
pixel_x
=
0
;
pixel_x
<
4
;
pixel_x
++
,
flags
>>=
1
)
{
#ifdef ORIGINAL
pixels
[
pixel_ptr
++
]
=
colors
[(
flags
&
0x1
)
^
1
];
#else
pixels
[
width
*
(
height
-
(
pixel_ptr
/
width
)
-
1
)
+
pixel_ptr
%
width
]
=
colors
[(
flags
&
0x1
)
^
1
];
pixel_ptr
++
;
#endif
}
pixel_ptr
-=
row_dec
;
}
}
else
if
(
byte_b
>=
0x90
)
{
...
...
@@ -153,19 +152,9 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s
for
(
pixel_y
=
0
;
pixel_y
<
4
;
pixel_y
++
)
{
for
(
pixel_x
=
0
;
pixel_x
<
4
;
pixel_x
++
,
flags
>>=
1
)
{
#ifdef ORIGINAL
pixels
[
pixel_ptr
++
]
=
colors
[((
pixel_y
&
0x2
)
<<
1
)
+
(
pixel_x
&
0x2
)
+
((
flags
&
0x1
)
^
1
)];
#else
pixels
[
width
*
(
height
-
(
pixel_ptr
/
width
)
-
1
)
+
pixel_ptr
%
width
]
=
colors
[((
pixel_y
&
0x2
)
<<
1
)
+
pixels
[
pixel_ptr
++
]
=
colors
[((
pixel_y
&
0x2
)
<<
1
)
+
(
pixel_x
&
0x2
)
+
((
flags
&
0x1
)
^
1
)];
pixel_ptr
++
;
#endif
}
pixel_ptr
-=
row_dec
;
}
}
else
{
...
...
@@ -174,15 +163,7 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s
for
(
pixel_y
=
0
;
pixel_y
<
4
;
pixel_y
++
)
{
for
(
pixel_x
=
0
;
pixel_x
<
4
;
pixel_x
++
)
{
#ifdef ORIGINAL
pixels
[
pixel_ptr
++
]
=
colors
[
0
];
#else
pixels
[
width
*
(
height
-
(
pixel_ptr
/
width
)
-
1
)
+
pixel_ptr
%
width
]
=
colors
[
0
];
pixel_ptr
++
;
#endif
}
pixel_ptr
-=
row_dec
;
}
}
...
...
@@ -218,10 +199,18 @@ msvideo1_decode_16bit( int width, int height, const unsigned char *buf, int buf_
blocks_high
=
height
/
4
;
total_blocks
=
blocks_wide
*
blocks_high
;
block_inc
=
4
;
#ifdef ORIGINAL
row_dec
=
stride
+
4
;
#else
row_dec
=
-
(
stride
-
4
);
/* such that -row_dec > 0 */
#endif
for
(
block_y
=
blocks_high
;
block_y
>
0
;
block_y
--
)
{
#ifdef ORIGINAL
block_ptr
=
((
block_y
*
4
)
-
1
)
*
stride
;
#else
block_ptr
=
((
blocks_high
-
block_y
)
*
4
)
*
stride
;
#endif
for
(
block_x
=
blocks_wide
;
block_x
>
0
;
block_x
--
)
{
/* check if this block should be skipped */
if
(
skip_blocks
)
{
...
...
@@ -272,8 +261,8 @@ msvideo1_decode_16bit( int width, int height, const unsigned char *buf, int buf_
for
(
pixel_y
=
0
;
pixel_y
<
4
;
pixel_y
++
)
{
for
(
pixel_x
=
0
;
pixel_x
<
4
;
pixel_x
++
,
flags
>>=
1
)
pixels
[
pixel_ptr
++
]
=
colors
[((
pixel_y
&
0x2
)
<<
1
)
+
pixels
[
pixel_ptr
++
]
=
colors
[((
pixel_y
&
0x2
)
<<
1
)
+
(
pixel_x
&
0x2
)
+
((
flags
&
0x1
)
^
1
)];
pixel_ptr
-=
row_dec
;
}
...
...
@@ -408,7 +397,7 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD
width
=
icd
->
lpbiInput
->
biWidth
;
height
=
icd
->
lpbiInput
->
biHeight
;
bit_per_pixel
=
icd
->
lpbiInput
->
biBitCount
;
stride
=
width
*
bit_per_pixel
/
8
;
stride
=
width
;
/* in bytes or 16bit words */
sz
=
icd
->
lpbiInput
->
biSizeImage
;
if
(
info
->
mode_8bit
)
...
...
@@ -440,7 +429,7 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW
width
=
icd
->
lpbiSrc
->
biWidth
;
height
=
icd
->
lpbiSrc
->
biHeight
;
bit_per_pixel
=
icd
->
lpbiSrc
->
biBitCount
;
stride
=
width
*
bit_per_pixel
/
8
;
stride
=
width
;
sz
=
icd
->
lpbiSrc
->
biSizeImage
;
if
(
info
->
mode_8bit
)
...
...
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