Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
93c286e5
Commit
93c286e5
authored
Nov 25, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qtrle: simplify 32-bit decode using intreadwrite macros
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
3bd1162a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
qtrle.c
libavcodec/qtrle.c
+7
-14
No files found.
libavcodec/qtrle.c
View file @
93c286e5
...
@@ -328,7 +328,6 @@ static void qtrle_decode_32bpp(QtrleContext *s, int stream_ptr, int row_ptr, int
...
@@ -328,7 +328,6 @@ static void qtrle_decode_32bpp(QtrleContext *s, int stream_ptr, int row_ptr, int
int
rle_code
;
int
rle_code
;
int
pixel_ptr
;
int
pixel_ptr
;
int
row_inc
=
s
->
frame
.
linesize
[
0
];
int
row_inc
=
s
->
frame
.
linesize
[
0
];
unsigned
char
a
,
r
,
g
,
b
;
unsigned
int
argb
;
unsigned
int
argb
;
unsigned
char
*
rgb
=
s
->
frame
.
data
[
0
];
unsigned
char
*
rgb
=
s
->
frame
.
data
[
0
];
int
pixel_limit
=
s
->
frame
.
linesize
[
0
]
*
s
->
avctx
->
height
;
int
pixel_limit
=
s
->
frame
.
linesize
[
0
]
*
s
->
avctx
->
height
;
...
@@ -347,16 +346,13 @@ static void qtrle_decode_32bpp(QtrleContext *s, int stream_ptr, int row_ptr, int
...
@@ -347,16 +346,13 @@ static void qtrle_decode_32bpp(QtrleContext *s, int stream_ptr, int row_ptr, int
/* decode the run length code */
/* decode the run length code */
rle_code
=
-
rle_code
;
rle_code
=
-
rle_code
;
CHECK_STREAM_PTR
(
4
);
CHECK_STREAM_PTR
(
4
);
a
=
s
->
buf
[
stream_ptr
++
];
argb
=
AV_RB32
(
s
->
buf
+
stream_ptr
);
r
=
s
->
buf
[
stream_ptr
++
];
stream_ptr
+=
4
;
g
=
s
->
buf
[
stream_ptr
++
];
b
=
s
->
buf
[
stream_ptr
++
];
argb
=
(
a
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
<<
0
);
CHECK_PIXEL_PTR
(
rle_code
*
4
);
CHECK_PIXEL_PTR
(
rle_code
*
4
);
while
(
rle_code
--
)
{
while
(
rle_code
--
)
{
*
(
unsigned
int
*
)(
&
rgb
[
pixel_ptr
])
=
argb
;
AV_WN32A
(
rgb
+
pixel_ptr
,
argb
)
;
pixel_ptr
+=
4
;
pixel_ptr
+=
4
;
}
}
}
else
{
}
else
{
...
@@ -365,13 +361,10 @@ static void qtrle_decode_32bpp(QtrleContext *s, int stream_ptr, int row_ptr, int
...
@@ -365,13 +361,10 @@ static void qtrle_decode_32bpp(QtrleContext *s, int stream_ptr, int row_ptr, int
/* copy pixels directly to output */
/* copy pixels directly to output */
while
(
rle_code
--
)
{
while
(
rle_code
--
)
{
a
=
s
->
buf
[
stream_ptr
++
];
argb
=
AV_RB32
(
s
->
buf
+
stream_ptr
);
r
=
s
->
buf
[
stream_ptr
++
];
AV_WN32A
(
rgb
+
pixel_ptr
,
argb
);
g
=
s
->
buf
[
stream_ptr
++
];
stream_ptr
+=
4
;
b
=
s
->
buf
[
stream_ptr
++
];
pixel_ptr
+=
4
;
argb
=
(
a
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
<<
0
);
*
(
unsigned
int
*
)(
&
rgb
[
pixel_ptr
])
=
argb
;
pixel_ptr
+=
4
;
}
}
}
}
}
}
...
...
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