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
1ba909fa
Commit
1ba909fa
authored
Dec 28, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_afir: use segment pointer
parent
30bf54b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
af_afir.c
libavfilter/af_afir.c
+20
-19
No files found.
libavfilter/af_afir.c
View file @
1ba909fa
...
@@ -59,42 +59,43 @@ static void fcmul_add_c(float *sum, const float *t, const float *c, ptrdiff_t le
...
@@ -59,42 +59,43 @@ static void fcmul_add_c(float *sum, const float *t, const float *c, ptrdiff_t le
static
int
fir_channel
(
AVFilterContext
*
ctx
,
void
*
arg
,
int
ch
,
int
nb_jobs
)
static
int
fir_channel
(
AVFilterContext
*
ctx
,
void
*
arg
,
int
ch
,
int
nb_jobs
)
{
{
AudioFIRContext
*
s
=
ctx
->
priv
;
AudioFIRContext
*
s
=
ctx
->
priv
;
AudioFIRSegment
*
seg
=
&
s
->
seg
;
const
float
*
src
=
(
const
float
*
)
s
->
in
[
0
]
->
extended_data
[
ch
];
const
float
*
src
=
(
const
float
*
)
s
->
in
[
0
]
->
extended_data
[
ch
];
float
*
sum
=
(
float
*
)
s
->
seg
.
sum
->
extended_data
[
ch
];
float
*
sum
=
(
float
*
)
s
eg
->
sum
->
extended_data
[
ch
];
AVFrame
*
out
=
arg
;
AVFrame
*
out
=
arg
;
float
*
block
,
*
dst
,
*
ptr
;
float
*
block
,
*
dst
,
*
ptr
;
int
n
,
i
,
j
;
int
n
,
i
,
j
;
memset
(
sum
,
0
,
sizeof
(
*
sum
)
*
s
->
seg
.
fft_length
);
memset
(
sum
,
0
,
sizeof
(
*
sum
)
*
s
eg
->
fft_length
);
block
=
(
float
*
)
s
->
seg
.
block
->
extended_data
[
ch
]
+
s
->
seg
.
part_index
*
s
->
seg
.
block_size
;
block
=
(
float
*
)
s
eg
->
block
->
extended_data
[
ch
]
+
seg
->
part_index
*
seg
->
block_size
;
memset
(
block
,
0
,
sizeof
(
*
block
)
*
s
->
seg
.
fft_length
);
memset
(
block
,
0
,
sizeof
(
*
block
)
*
s
eg
->
fft_length
);
s
->
fdsp
->
vector_fmul_scalar
(
block
,
src
,
s
->
dry_gain
,
FFALIGN
(
out
->
nb_samples
,
4
));
s
->
fdsp
->
vector_fmul_scalar
(
block
,
src
,
s
->
dry_gain
,
FFALIGN
(
out
->
nb_samples
,
4
));
emms_c
();
emms_c
();
av_rdft_calc
(
s
->
seg
.
rdft
[
ch
],
block
);
av_rdft_calc
(
s
eg
->
rdft
[
ch
],
block
);
block
[
2
*
s
->
seg
.
part_size
]
=
block
[
1
];
block
[
2
*
s
eg
->
part_size
]
=
block
[
1
];
block
[
1
]
=
0
;
block
[
1
]
=
0
;
j
=
s
->
seg
.
part_index
;
j
=
s
eg
->
part_index
;
for
(
i
=
0
;
i
<
s
->
seg
.
nb_partitions
;
i
++
)
{
for
(
i
=
0
;
i
<
s
eg
->
nb_partitions
;
i
++
)
{
const
int
coffset
=
i
*
s
->
seg
.
coeff_size
;
const
int
coffset
=
i
*
s
eg
->
coeff_size
;
const
float
*
block
=
(
const
float
*
)
s
->
seg
.
block
->
extended_data
[
ch
]
+
j
*
s
->
seg
.
block_size
;
const
float
*
block
=
(
const
float
*
)
s
eg
->
block
->
extended_data
[
ch
]
+
j
*
seg
->
block_size
;
const
FFTComplex
*
coeff
=
s
->
seg
.
coeff
[
ch
*
!
s
->
one2many
]
+
coffset
;
const
FFTComplex
*
coeff
=
s
eg
->
coeff
[
ch
*
!
s
->
one2many
]
+
coffset
;
s
->
fcmul_add
(
sum
,
block
,
(
const
float
*
)
coeff
,
s
->
seg
.
part_size
);
s
->
fcmul_add
(
sum
,
block
,
(
const
float
*
)
coeff
,
s
eg
->
part_size
);
if
(
j
==
0
)
if
(
j
==
0
)
j
=
s
->
seg
.
nb_partitions
;
j
=
s
eg
->
nb_partitions
;
j
--
;
j
--
;
}
}
sum
[
1
]
=
sum
[
2
*
s
->
seg
.
part_size
];
sum
[
1
]
=
sum
[
2
*
s
eg
->
part_size
];
av_rdft_calc
(
s
->
seg
.
irdft
[
ch
],
sum
);
av_rdft_calc
(
s
eg
->
irdft
[
ch
],
sum
);
dst
=
(
float
*
)
s
->
seg
.
buffer
->
extended_data
[
ch
];
dst
=
(
float
*
)
s
eg
->
buffer
->
extended_data
[
ch
];
for
(
n
=
0
;
n
<
s
->
seg
.
part_size
;
n
++
)
{
for
(
n
=
0
;
n
<
s
eg
->
part_size
;
n
++
)
{
dst
[
n
]
+=
sum
[
n
];
dst
[
n
]
+=
sum
[
n
];
}
}
...
@@ -102,8 +103,8 @@ static int fir_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
...
@@ -102,8 +103,8 @@ static int fir_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
s
->
fdsp
->
vector_fmul_scalar
(
ptr
,
dst
,
s
->
wet_gain
,
FFALIGN
(
out
->
nb_samples
,
4
));
s
->
fdsp
->
vector_fmul_scalar
(
ptr
,
dst
,
s
->
wet_gain
,
FFALIGN
(
out
->
nb_samples
,
4
));
emms_c
();
emms_c
();
dst
=
(
float
*
)
s
->
seg
.
buffer
->
extended_data
[
ch
];
dst
=
(
float
*
)
s
eg
->
buffer
->
extended_data
[
ch
];
memcpy
(
dst
,
sum
+
s
->
seg
.
part_size
,
s
->
seg
.
part_size
*
sizeof
(
*
dst
));
memcpy
(
dst
,
sum
+
s
eg
->
part_size
,
seg
->
part_size
*
sizeof
(
*
dst
));
return
0
;
return
0
;
}
}
...
...
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