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
af1eb298
Commit
af1eb298
authored
Nov 16, 2011
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: use int16_t instead of short for resampling.
parent
4c0bad51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
resample.c
libswresample/resample.c
+2
-2
swresample_internal.h
libswresample/swresample_internal.h
+1
-1
No files found.
libswresample/resample.c
View file @
af1eb298
...
...
@@ -252,7 +252,7 @@ void swr_compensate(struct SwrContext *s, int sample_delta, int compensation_dis
c
->
dst_incr
=
c
->
ideal_dst_incr
-
c
->
ideal_dst_incr
*
(
int64_t
)
sample_delta
/
compensation_distance
;
}
int
swri_resample
(
ResampleContext
*
c
,
short
*
dst
,
const
shor
t
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
){
int
swri_resample
(
ResampleContext
*
c
,
int16_t
*
dst
,
const
int16_
t
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
){
int
dst_index
,
i
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
...
...
@@ -345,7 +345,7 @@ int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, Aud
int
i
,
ret
=
-
1
;
for
(
i
=
0
;
i
<
dst
->
ch_count
;
i
++
){
ret
=
swri_resample
(
c
,
(
short
*
)
dst
->
ch
[
i
],
(
const
shor
t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
ret
=
swri_resample
(
c
,
(
int16_t
*
)
dst
->
ch
[
i
],
(
const
int16_
t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
}
return
ret
;
...
...
libswresample/swresample_internal.h
View file @
af1eb298
...
...
@@ -80,7 +80,7 @@ struct ResampleContext *swri_resample_init(struct ResampleContext *, int out_rat
void
swri_resample_free
(
struct
ResampleContext
**
c
);
int
swri_multiple_resample
(
struct
ResampleContext
*
c
,
AudioData
*
dst
,
int
dst_size
,
AudioData
*
src
,
int
src_size
,
int
*
consumed
);
void
swri_resample_compensate
(
struct
ResampleContext
*
c
,
int
sample_delta
,
int
compensation_distance
);
int
swri_resample
(
struct
ResampleContext
*
c
,
short
*
dst
,
const
shor
t
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
);
int
swri_resample
(
struct
ResampleContext
*
c
,
int16_t
*
dst
,
const
int16_
t
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
);
int
swri_rematrix_init
(
SwrContext
*
s
);
int
swri_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
...
...
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