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
f9a2c5bc
Commit
f9a2c5bc
authored
Apr 11, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: simplify code by using av_get_bytes_per_sample()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6e9c634c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
rematrix.c
libswresample/rematrix.c
+1
-1
resample.c
libswresample/resample.c
+2
-6
No files found.
libswresample/rematrix.c
View file @
f9a2c5bc
...
@@ -290,7 +290,7 @@ int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mus
...
@@ -290,7 +290,7 @@ int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mus
for
(
out_i
=
0
;
out_i
<
out
->
ch_count
;
out_i
++
){
for
(
out_i
=
0
;
out_i
<
out
->
ch_count
;
out_i
++
){
switch
(
s
->
matrix_ch
[
out_i
][
0
]){
switch
(
s
->
matrix_ch
[
out_i
][
0
]){
case
0
:
case
0
:
memset
(
out
->
ch
[
out_i
],
0
,
len
*
(
s
->
int_sample_fmt
==
AV_SAMPLE_FMT_FLT
?
sizeof
(
float
)
:
sizeof
(
int16_t
)
));
memset
(
out
->
ch
[
out_i
],
0
,
len
*
av_get_bytes_per_sample
(
s
->
int_sample_fmt
));
break
;
break
;
case
1
:
case
1
:
in_i
=
s
->
matrix_ch
[
out_i
][
1
];
in_i
=
s
->
matrix_ch
[
out_i
][
1
];
...
...
libswresample/resample.c
View file @
f9a2c5bc
...
@@ -202,21 +202,17 @@ ResampleContext *swri_resample_init(ResampleContext *c, int out_rate, int in_rat
...
@@ -202,21 +202,17 @@ ResampleContext *swri_resample_init(ResampleContext *c, int out_rate, int in_rat
c
->
format
=
format
;
c
->
format
=
format
;
c
->
felem_size
=
av_get_bytes_per_sample
(
c
->
format
);
switch
(
c
->
format
){
switch
(
c
->
format
){
case
AV_SAMPLE_FMT_S16
:
case
AV_SAMPLE_FMT_S16
:
c
->
felem_size
=
2
;
c
->
filter_shift
=
15
;
c
->
filter_shift
=
15
;
break
;
break
;
case
AV_SAMPLE_FMT_S32
:
case
AV_SAMPLE_FMT_S32
:
c
->
felem_size
=
4
;
c
->
filter_shift
=
30
;
c
->
filter_shift
=
30
;
break
;
break
;
case
AV_SAMPLE_FMT_FLT
:
case
AV_SAMPLE_FMT_FLT
:
c
->
felem_size
=
4
;
c
->
filter_shift
=
0
;
break
;
case
AV_SAMPLE_FMT_DBL
:
case
AV_SAMPLE_FMT_DBL
:
c
->
felem_size
=
8
;
c
->
filter_shift
=
0
;
c
->
filter_shift
=
0
;
break
;
break
;
default
:
default
:
...
...
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