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
21d8f4da
Commit
21d8f4da
authored
Feb 22, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resample: remove an unneeded context variable
parent
f1b239ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
resample.c
libavresample/resample.c
+3
-8
No files found.
libavresample/resample.c
View file @
21d8f4da
...
...
@@ -42,7 +42,6 @@ struct ResampleContext {
int
linear
;
enum
AVResampleFilterType
filter_type
;
int
kaiser_beta
;
double
factor
;
void
(
*
set_filter
)(
void
*
filter
,
double
*
tab
,
int
phase
,
int
tap_count
);
void
(
*
resample_one
)(
struct
ResampleContext
*
c
,
void
*
dst0
,
int
dst_index
,
const
void
*
src0
,
...
...
@@ -94,10 +93,10 @@ static double bessel(double x)
}
/* Build a polyphase filterbank. */
static
int
build_filter
(
ResampleContext
*
c
)
static
int
build_filter
(
ResampleContext
*
c
,
double
factor
)
{
int
ph
,
i
;
double
x
,
y
,
w
,
factor
;
double
x
,
y
,
w
;
double
*
tab
;
int
tap_count
=
c
->
filter_length
;
int
phase_count
=
1
<<
c
->
phase_shift
;
...
...
@@ -107,9 +106,6 @@ static int build_filter(ResampleContext *c)
if
(
!
tab
)
return
AVERROR
(
ENOMEM
);
/* if upsampling, only need to interpolate, no filter */
factor
=
FFMIN
(
c
->
factor
,
1
.
0
);
for
(
ph
=
0
;
ph
<
phase_count
;
ph
++
)
{
double
norm
=
0
;
for
(
i
=
0
;
i
<
tap_count
;
i
++
)
{
...
...
@@ -176,7 +172,6 @@ ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr)
c
->
phase_shift
=
avr
->
phase_shift
;
c
->
phase_mask
=
phase_count
-
1
;
c
->
linear
=
avr
->
linear_interp
;
c
->
factor
=
factor
;
c
->
filter_length
=
FFMAX
((
int
)
ceil
(
avr
->
filter_size
/
factor
),
1
);
c
->
filter_type
=
avr
->
filter_type
;
c
->
kaiser_beta
=
avr
->
kaiser_beta
;
...
...
@@ -209,7 +204,7 @@ ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr)
if
(
!
c
->
filter_bank
)
goto
error
;
if
(
build_filter
(
c
)
<
0
)
if
(
build_filter
(
c
,
factor
)
<
0
)
goto
error
;
memcpy
(
&
c
->
filter_bank
[(
c
->
filter_length
*
phase_count
+
1
)
*
felem_size
],
...
...
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