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
7f8027b7
Commit
7f8027b7
authored
Feb 03, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adler32: avoid "too big" check in the inner loop
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
25f35df1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
adler32.c
libavutil/adler32.c
+10
-4
No files found.
libavutil/adler32.c
View file @
7f8027b7
...
...
@@ -23,6 +23,7 @@
#include "config.h"
#include "adler32.h"
#include "common.h"
#define BASE 65521L
/* largest prime smaller than 65536 */
...
...
@@ -37,17 +38,22 @@ unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
unsigned
long
s2
=
adler
>>
16
;
while
(
len
>
0
)
{
unsigned
len2
=
FFMIN
((
len
-
1
)
&
~
15
,
2048
);
if
(
len2
)
{
len
-=
len2
;
#if CONFIG_SMALL
while
(
len
>
4
&&
s2
<
(
1U
<<
31
)
)
{
while
(
len
2
>=
4
)
{
DO4
(
buf
);
len
-=
4
;
len
2
-=
4
;
}
#else
while
(
len
>
16
&&
s2
<
(
1U
<<
31
)
)
{
while
(
len
2
>=
16
)
{
DO16
(
buf
);
len
-=
16
;
len
2
-=
16
;
}
#endif
}
DO1
(
buf
);
len
--
;
s1
%=
BASE
;
s2
%=
BASE
;
...
...
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