Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
af1eb298
Commit
af1eb298
authored
13 years ago
by
Clément Bœsch
Browse files
Options
Downloads
Patches
Plain Diff
swr: use int16_t instead of short for resampling.
parent
4c0bad51
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libswresample/resample.c
+2
-2
2 additions, 2 deletions
libswresample/resample.c
libswresample/swresample_internal.h
+1
-1
1 addition, 1 deletion
libswresample/swresample_internal.h
with
3 additions
and
3 deletions
libswresample/resample.c
+
2
−
2
View file @
af1eb298
...
@@ -252,7 +252,7 @@ void swr_compensate(struct SwrContext *s, int sample_delta, int compensation_dis
...
@@ -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
;
c
->
dst_incr
=
c
->
ideal_dst_incr
-
c
->
ideal_dst_incr
*
(
int64_t
)
sample_delta
/
compensation_distance
;
}
}
int
swri_resample
(
ResampleContext
*
c
,
shor
t
*
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
dst_index
,
i
;
int
index
=
c
->
index
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
int
frac
=
c
->
frac
;
...
@@ -345,7 +345,7 @@ int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, Aud
...
@@ -345,7 +345,7 @@ int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, Aud
int
i
,
ret
=
-
1
;
int
i
,
ret
=
-
1
;
for
(
i
=
0
;
i
<
dst
->
ch_count
;
i
++
){
for
(
i
=
0
;
i
<
dst
->
ch_count
;
i
++
){
ret
=
swri_resample
(
c
,
(
shor
t
*
)
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
;
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
libswresample/swresample_internal.h
+
1
−
1
View file @
af1eb298
...
@@ -80,7 +80,7 @@ struct ResampleContext *swri_resample_init(struct ResampleContext *, int out_rat
...
@@ -80,7 +80,7 @@ struct ResampleContext *swri_resample_init(struct ResampleContext *, int out_rat
void
swri_resample_free
(
struct
ResampleContext
**
c
);
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
);
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
);
void
swri_resample_compensate
(
struct
ResampleContext
*
c
,
int
sample_delta
,
int
compensation_distance
);
int
swri_resample
(
struct
ResampleContext
*
c
,
shor
t
*
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_init
(
SwrContext
*
s
);
int
swri_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
int
swri_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment