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