Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a46dc497
Commit
a46dc497
authored
Jan 08, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpza: move some variables to the blocks where they are used
parent
c7769df1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
rpza.c
libavcodec/rpza.c
+4
-7
No files found.
libavcodec/rpza.c
View file @
a46dc497
...
...
@@ -74,11 +74,8 @@ static void rpza_decode_stream(RpzaContext *s)
int
stride
=
s
->
frame
->
linesize
[
0
]
/
2
;
int
row_inc
=
stride
-
4
;
int
chunk_size
;
uint8_t
opcode
;
int
n_blocks
;
uint16_t
colorA
=
0
,
colorB
;
uint16_t
color4
[
4
];
uint8_t
index
,
idx
;
uint16_t
ta
,
tb
;
uint16_t
*
pixels
=
(
uint16_t
*
)
s
->
frame
->
data
[
0
];
...
...
@@ -105,9 +102,9 @@ static void rpza_decode_stream(RpzaContext *s)
/* Process chunk data */
while
(
bytestream2_get_bytes_left
(
&
s
->
gb
))
{
opcode
=
bytestream2_get_byte
(
&
s
->
gb
);
/* Get opcode */
uint8_t
opcode
=
bytestream2_get_byte
(
&
s
->
gb
);
/* Get opcode */
n_blocks
=
(
opcode
&
0x1f
)
+
1
;
/* Extract block counter from opcode */
int
n_blocks
=
(
opcode
&
0x1f
)
+
1
;
/* Extract block counter from opcode */
/* If opcode MSbit is 0, we need more data to decide what to do */
if
((
opcode
&
0x80
)
==
0
)
{
...
...
@@ -182,9 +179,9 @@ static void rpza_decode_stream(RpzaContext *s)
while
(
n_blocks
--
)
{
block_ptr
=
row_ptr
+
pixel_ptr
;
for
(
pixel_y
=
0
;
pixel_y
<
4
;
pixel_y
++
)
{
index
=
bytestream2_get_byteu
(
&
s
->
gb
);
uint8_t
index
=
bytestream2_get_byteu
(
&
s
->
gb
);
for
(
pixel_x
=
0
;
pixel_x
<
4
;
pixel_x
++
){
idx
=
(
index
>>
(
2
*
(
3
-
pixel_x
)))
&
0x03
;
uint8_t
idx
=
(
index
>>
(
2
*
(
3
-
pixel_x
)))
&
0x03
;
pixels
[
block_ptr
]
=
color4
[
idx
];
block_ptr
++
;
}
...
...
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