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
3395ad48
Commit
3395ad48
authored
May 03, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/adpcm: replace char/short/long with int8_t/int16_t/int
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b7d26739
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
adpcm.c
libavcodec/adpcm.c
+12
-12
No files found.
libavcodec/adpcm.c
View file @
3395ad48
...
...
@@ -172,7 +172,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
return
0
;
}
static
inline
short
adpcm_ima_expand_nibble
(
ADPCMChannelStatus
*
c
,
char
nibble
,
int
shift
)
static
inline
int16_t
adpcm_ima_expand_nibble
(
ADPCMChannelStatus
*
c
,
int8_t
nibble
,
int
shift
)
{
int
step_index
;
int
predictor
;
...
...
@@ -195,7 +195,7 @@ static inline short adpcm_ima_expand_nibble(ADPCMChannelStatus *c, char nibble,
c
->
predictor
=
av_clip_int16
(
predictor
);
c
->
step_index
=
step_index
;
return
(
shor
t
)
c
->
predictor
;
return
(
int16_
t
)
c
->
predictor
;
}
static
inline
int16_t
adpcm_ima_wav_expand_nibble
(
ADPCMChannelStatus
*
c
,
GetBitContext
*
gb
,
int
bps
)
...
...
@@ -247,7 +247,7 @@ static inline int adpcm_ima_qt_expand_nibble(ADPCMChannelStatus *c, int nibble,
return
c
->
predictor
;
}
static
inline
shor
t
adpcm_ms_expand_nibble
(
ADPCMChannelStatus
*
c
,
int
nibble
)
static
inline
int16_
t
adpcm_ms_expand_nibble
(
ADPCMChannelStatus
*
c
,
int
nibble
)
{
int
predictor
;
...
...
@@ -266,7 +266,7 @@ static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, int nibble)
return
c
->
sample1
;
}
static
inline
shor
t
adpcm_ima_oki_expand_nibble
(
ADPCMChannelStatus
*
c
,
int
nibble
)
static
inline
int16_
t
adpcm_ima_oki_expand_nibble
(
ADPCMChannelStatus
*
c
,
int
nibble
)
{
int
step_index
,
predictor
,
sign
,
delta
,
diff
,
step
;
...
...
@@ -287,7 +287,7 @@ static inline short adpcm_ima_oki_expand_nibble(ADPCMChannelStatus *c, int nibbl
return
c
->
predictor
<<
4
;
}
static
inline
short
adpcm_ct_expand_nibble
(
ADPCMChannelStatus
*
c
,
char
nibble
)
static
inline
int16_t
adpcm_ct_expand_nibble
(
ADPCMChannelStatus
*
c
,
int8_t
nibble
)
{
int
sign
,
delta
,
diff
;
int
new_step
;
...
...
@@ -305,10 +305,10 @@ static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
new_step
=
(
ff_adpcm_AdaptationTable
[
nibble
&
7
]
*
c
->
step
)
>>
8
;
c
->
step
=
av_clip
(
new_step
,
511
,
32767
);
return
(
shor
t
)
c
->
predictor
;
return
(
int16_
t
)
c
->
predictor
;
}
static
inline
short
adpcm_sbpro_expand_nibble
(
ADPCMChannelStatus
*
c
,
char
nibble
,
int
size
,
int
shift
)
static
inline
int16_t
adpcm_sbpro_expand_nibble
(
ADPCMChannelStatus
*
c
,
int8_t
nibble
,
int
size
,
int
shift
)
{
int
sign
,
delta
,
diff
;
...
...
@@ -325,10 +325,10 @@ static inline short adpcm_sbpro_expand_nibble(ADPCMChannelStatus *c, char nibble
else
if
(
delta
==
0
&&
c
->
step
>
0
)
c
->
step
--
;
return
(
shor
t
)
c
->
predictor
;
return
(
int16_
t
)
c
->
predictor
;
}
static
inline
short
adpcm_yamaha_expand_nibble
(
ADPCMChannelStatus
*
c
,
unsigned
char
nibble
)
static
inline
int16_t
adpcm_yamaha_expand_nibble
(
ADPCMChannelStatus
*
c
,
uint8_t
nibble
)
{
if
(
!
c
->
step
)
{
c
->
predictor
=
0
;
...
...
@@ -452,7 +452,7 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
// similar to IMA adpcm
int
delta
=
get_bits
(
&
gb
,
nb_bits
);
int
step
=
ff_adpcm_step_table
[
c
->
status
[
i
].
step_index
];
long
vpdiff
=
0
;
// vpdiff = (delta+0.5)*step/4
int
vpdiff
=
0
;
// vpdiff = (delta+0.5)*step/4
int
k
=
k0
;
do
{
...
...
@@ -695,7 +695,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
ADPCMDecodeContext
*
c
=
avctx
->
priv_data
;
ADPCMChannelStatus
*
cs
;
int
n
,
m
,
channel
,
i
;
shor
t
*
samples
;
int16_
t
*
samples
;
int16_t
**
samples_p
;
int
st
;
/* stereo */
int
count1
,
count2
;
...
...
@@ -713,7 +713,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
frame
->
nb_samples
=
nb_samples
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
,
0
))
<
0
)
return
ret
;
samples
=
(
shor
t
*
)
frame
->
data
[
0
];
samples
=
(
int16_
t
*
)
frame
->
data
[
0
];
samples_p
=
(
int16_t
**
)
frame
->
extended_data
;
/* use coded_samples when applicable */
...
...
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