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
88e2d588
Commit
88e2d588
authored
Aug 11, 2007
by
Aurelien Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more usage of av_clip()
Originally committed as revision 10082 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
e4a50e6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
adpcm.c
libavcodec/adpcm.c
+2
-14
No files found.
libavcodec/adpcm.c
View file @
88e2d588
...
...
@@ -706,11 +706,7 @@ static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
c
->
predictor
=
av_clip_int16
(
c
->
predictor
);
/* calculate new step and clamp it to range 511..32767 */
new_step
=
(
ct_adpcm_table
[
nibble
&
7
]
*
c
->
step
)
>>
8
;
c
->
step
=
new_step
;
if
(
c
->
step
<
511
)
c
->
step
=
511
;
if
(
c
->
step
>
32767
)
c
->
step
=
32767
;
c
->
step
=
av_clip
(
new_step
,
511
,
32767
);
return
(
short
)
c
->
predictor
;
}
...
...
@@ -723,16 +719,8 @@ static inline short adpcm_sbpro_expand_nibble(ADPCMChannelStatus *c, char nibble
delta
=
nibble
&
((
1
<<
(
size
-
1
))
-
1
);
diff
=
delta
<<
(
7
+
c
->
step
+
shift
);
if
(
sign
)
c
->
predictor
-=
diff
;
else
c
->
predictor
+=
diff
;
/* clamp result */
if
(
c
->
predictor
>
16256
)
c
->
predictor
=
16256
;
else
if
(
c
->
predictor
<
-
16384
)
c
->
predictor
=
-
16384
;
c
->
predictor
=
av_clip
(
c
->
predictor
+
(
sign
?
-
diff
:
diff
),
-
16384
,
16256
);
/* calculate new step */
if
(
delta
>=
(
2
*
size
-
3
)
&&
c
->
step
<
3
)
...
...
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