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
9d7e71a2
Commit
9d7e71a2
authored
Mar 12, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/xpmdec: rename convert to hex_char_to_number
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
7133ab43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
xpmdec.c
libavcodec/xpmdec.c
+22
-22
No files found.
libavcodec/xpmdec.c
View file @
9d7e71a2
...
...
@@ -185,7 +185,7 @@ static const ColorEntry color_table[] = {
{
"YellowGreen"
,
0xFF9ACD32
}
};
static
unsigned
convert
(
uint8_t
x
)
static
unsigned
hex_char_to_number
(
uint8_t
x
)
{
if
(
x
>=
'a'
&&
x
<=
'f'
)
x
-=
87
;
...
...
@@ -237,30 +237,30 @@ static uint32_t hexstring_to_rgba(const char *p, int len)
p
++
;
len
--
;
if
(
len
==
3
)
{
ret
|=
(
convert
(
p
[
2
])
<<
4
)
|
(
convert
(
p
[
1
])
<<
12
)
|
(
convert
(
p
[
0
])
<<
20
);
ret
|=
(
hex_char_to_number
(
p
[
2
])
<<
4
)
|
(
hex_char_to_number
(
p
[
1
])
<<
12
)
|
(
hex_char_to_number
(
p
[
0
])
<<
20
);
}
else
if
(
len
==
4
)
{
ret
=
(
convert
(
p
[
3
])
<<
4
)
|
(
convert
(
p
[
2
])
<<
12
)
|
(
convert
(
p
[
1
])
<<
20
)
|
(
convert
(
p
[
0
])
<<
28
);
ret
=
(
hex_char_to_number
(
p
[
3
])
<<
4
)
|
(
hex_char_to_number
(
p
[
2
])
<<
12
)
|
(
hex_char_to_number
(
p
[
1
])
<<
20
)
|
(
hex_char_to_number
(
p
[
0
])
<<
28
);
}
else
if
(
len
==
6
)
{
ret
|=
convert
(
p
[
5
])
|
(
convert
(
p
[
4
])
<<
4
)
|
(
convert
(
p
[
3
])
<<
8
)
|
(
convert
(
p
[
2
])
<<
12
)
|
(
convert
(
p
[
1
])
<<
16
)
|
(
convert
(
p
[
0
])
<<
20
);
ret
|=
hex_char_to_number
(
p
[
5
])
|
(
hex_char_to_number
(
p
[
4
])
<<
4
)
|
(
hex_char_to_number
(
p
[
3
])
<<
8
)
|
(
hex_char_to_number
(
p
[
2
])
<<
12
)
|
(
hex_char_to_number
(
p
[
1
])
<<
16
)
|
(
hex_char_to_number
(
p
[
0
])
<<
20
);
}
else
if
(
len
==
8
)
{
ret
=
convert
(
p
[
7
])
|
(
convert
(
p
[
6
])
<<
4
)
|
(
convert
(
p
[
5
])
<<
8
)
|
(
convert
(
p
[
4
])
<<
12
)
|
(
convert
(
p
[
3
])
<<
16
)
|
(
convert
(
p
[
2
])
<<
20
)
|
(
convert
(
p
[
1
])
<<
24
)
|
(
convert
(
p
[
0
])
<<
28
);
ret
=
hex_char_to_number
(
p
[
7
])
|
(
hex_char_to_number
(
p
[
6
])
<<
4
)
|
(
hex_char_to_number
(
p
[
5
])
<<
8
)
|
(
hex_char_to_number
(
p
[
4
])
<<
12
)
|
(
hex_char_to_number
(
p
[
3
])
<<
16
)
|
(
hex_char_to_number
(
p
[
2
])
<<
20
)
|
(
hex_char_to_number
(
p
[
1
])
<<
24
)
|
(
hex_char_to_number
(
p
[
0
])
<<
28
);
}
}
else
{
strncpy
(
color_name
,
p
,
len
);
...
...
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