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
a3a0691b
Commit
a3a0691b
authored
Jan 30, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcmenc: remove some unneeded casts
parent
149f2058
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
adpcmenc.c
libavcodec/adpcmenc.c
+4
-4
No files found.
libavcodec/adpcmenc.c
View file @
a3a0691b
...
...
@@ -230,12 +230,12 @@ static inline uint8_t adpcm_ms_compress_sample(ADPCMChannelStatus *c,
nibble
=
(
nibble
+
bias
)
/
c
->
idelta
;
nibble
=
av_clip
(
nibble
,
-
8
,
7
)
&
0x0F
;
predictor
+=
(
signed
)(
(
nibble
&
0x08
)
?
(
nibble
-
0x10
)
:
nibble
)
*
c
->
idelta
;
predictor
+=
((
nibble
&
0x08
)
?
(
nibble
-
0x10
)
:
nibble
)
*
c
->
idelta
;
c
->
sample2
=
c
->
sample1
;
c
->
sample1
=
av_clip_int16
(
predictor
);
c
->
idelta
=
(
ff_adpcm_AdaptationTable
[
(
int
)
nibble
]
*
c
->
idelta
)
>>
8
;
c
->
idelta
=
(
ff_adpcm_AdaptationTable
[
nibble
]
*
c
->
idelta
)
>>
8
;
if
(
c
->
idelta
<
16
)
c
->
idelta
=
16
;
...
...
@@ -491,14 +491,14 @@ static int adpcm_encode_frame(AVCodecContext *avctx, uint8_t *frame,
/* c->status[0].step_index = 0;
XXX: not sure how to init the state machine */
bytestream_put_le16
(
&
dst
,
c
->
status
[
0
].
prev_sample
);
*
dst
++
=
(
uint8_t
)
c
->
status
[
0
].
step_index
;
*
dst
++
=
c
->
status
[
0
].
step_index
;
*
dst
++
=
0
;
/* unknown */
samples
++
;
if
(
avctx
->
channels
==
2
)
{
c
->
status
[
1
].
prev_sample
=
samples
[
0
];
/* c->status[1].step_index = 0; */
bytestream_put_le16
(
&
dst
,
c
->
status
[
1
].
prev_sample
);
*
dst
++
=
(
uint8_t
)
c
->
status
[
1
].
step_index
;
*
dst
++
=
c
->
status
[
1
].
step_index
;
*
dst
++
=
0
;
samples
++
;
}
...
...
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