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
62ef8925
Commit
62ef8925
authored
Mar 25, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify
Originally committed as revision 8509 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
b6661510
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
lzw.c
libavcodec/lzw.c
+4
-10
No files found.
libavcodec/lzw.c
View file @
62ef8925
...
...
@@ -55,7 +55,7 @@ struct LZWState {
int
end_code
;
int
newcodes
;
///< First available code
int
top_slot
;
///< Highest code for current size
int
top_slot2
;
///< Highest possible code for current size (<=top_slot)
int
extra_slot
;
int
slot
;
///< Last read code
int
fc
,
oc
;
uint8_t
*
sp
;
...
...
@@ -158,10 +158,10 @@ int ff_lzw_decode_init(LZWState *p, int csize, uint8_t *buf, int buf_size, int m
s
->
mode
=
mode
;
switch
(
s
->
mode
){
case
FF_LZW_GIF
:
s
->
top_slot2
=
s
->
top_slot
;
s
->
extra_slot
=
0
;
break
;
case
FF_LZW_TIFF
:
s
->
top_slot2
=
s
->
top_slot
-
1
;
s
->
extra_slot
=
1
;
break
;
default:
return
-
1
;
...
...
@@ -208,9 +208,6 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
s
->
curmask
=
mask
[
s
->
cursize
];
s
->
slot
=
s
->
newcodes
;
s
->
top_slot
=
1
<<
s
->
cursize
;
s
->
top_slot2
=
s
->
top_slot
;
if
(
s
->
mode
==
FF_LZW_TIFF
)
s
->
top_slot2
--
;
while
((
c
=
lzw_get_code
(
s
))
==
s
->
clear_code
);
if
(
c
==
s
->
end_code
)
{
s
->
end_code
=
-
1
;
...
...
@@ -239,12 +236,9 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
s
->
prefix
[
s
->
slot
++
]
=
oc
;
oc
=
c
;
}
if
(
s
->
slot
>=
s
->
top_slot
2
)
{
if
(
s
->
slot
>=
s
->
top_slot
-
s
->
extra_slot
)
{
if
(
s
->
cursize
<
LZW_MAXBITS
)
{
s
->
top_slot
<<=
1
;
s
->
top_slot2
=
s
->
top_slot
;
if
(
s
->
mode
==
FF_LZW_TIFF
)
s
->
top_slot2
--
;
s
->
curmask
=
mask
[
++
s
->
cursize
];
}
}
...
...
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