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
f848a660
Commit
f848a660
authored
Feb 21, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/adpcm: use av_clip_intp2()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d1c70508
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
adpcm.c
libavcodec/adpcm.c
+1
-1
adpcmenc.c
libavcodec/adpcmenc.c
+1
-1
No files found.
libavcodec/adpcm.c
View file @
f848a660
...
@@ -269,7 +269,7 @@ static inline short adpcm_ima_oki_expand_nibble(ADPCMChannelStatus *c, int nibbl
...
@@ -269,7 +269,7 @@ static inline short adpcm_ima_oki_expand_nibble(ADPCMChannelStatus *c, int nibbl
if
(
sign
)
predictor
-=
diff
;
if
(
sign
)
predictor
-=
diff
;
else
predictor
+=
diff
;
else
predictor
+=
diff
;
c
->
predictor
=
av_clip
(
predictor
,
-
2048
,
2047
);
c
->
predictor
=
av_clip
_intp2
(
predictor
,
11
);
c
->
step_index
=
step_index
;
c
->
step_index
=
step_index
;
return
c
->
predictor
<<
4
;
return
c
->
predictor
<<
4
;
...
...
libavcodec/adpcmenc.c
View file @
f848a660
...
@@ -227,7 +227,7 @@ static inline uint8_t adpcm_ms_compress_sample(ADPCMChannelStatus *c,
...
@@ -227,7 +227,7 @@ static inline uint8_t adpcm_ms_compress_sample(ADPCMChannelStatus *c,
bias
=
-
c
->
idelta
/
2
;
bias
=
-
c
->
idelta
/
2
;
nibble
=
(
nibble
+
bias
)
/
c
->
idelta
;
nibble
=
(
nibble
+
bias
)
/
c
->
idelta
;
nibble
=
av_clip
(
nibble
,
-
8
,
7
)
&
0x0F
;
nibble
=
av_clip
_intp2
(
nibble
,
3
)
&
0x0F
;
predictor
+=
((
nibble
&
0x08
)
?
(
nibble
-
0x10
)
:
nibble
)
*
c
->
idelta
;
predictor
+=
((
nibble
&
0x08
)
?
(
nibble
-
0x10
)
:
nibble
)
*
c
->
idelta
;
...
...
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