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
b2e30cb3
Commit
b2e30cb3
authored
Jul 02, 2006
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify compute_autocorr
Originally committed as revision 5575 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
41275956
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
flacenc.c
libavcodec/flacenc.c
+10
-22
No files found.
libavcodec/flacenc.c
View file @
b2e30cb3
...
@@ -583,34 +583,22 @@ static void apply_welch_window(const int32_t *data, int len, double *w_data)
...
@@ -583,34 +583,22 @@ static void apply_welch_window(const int32_t *data, int len, double *w_data)
static
void
compute_autocorr
(
const
int32_t
*
data
,
int
len
,
int
lag
,
static
void
compute_autocorr
(
const
int32_t
*
data
,
int
len
,
int
lag
,
double
*
autoc
)
double
*
autoc
)
{
{
int
i
;
int
i
,
lag_ptr
;
double
*
data1
;
double
tmp
[
len
+
lag
]
;
int
lag_ptr
,
ptr
;
double
*
data1
=
tmp
+
lag
;
data1
=
av_malloc
(
len
*
sizeof
(
double
));
apply_welch_window
(
data
,
len
,
data1
);
apply_welch_window
(
data
,
len
,
data1
);
for
(
i
=
0
;
i
<
lag
;
i
++
)
autoc
[
i
]
=
1
.
0
;
for
(
i
=
0
;
i
<
lag
;
i
++
){
autoc
[
i
]
=
1
.
0
;
ptr
=
0
;
data1
[
i
-
lag
]
=
0
.
0
;
while
(
ptr
<=
lag
)
{
lag_ptr
=
0
;
while
(
lag_ptr
<=
ptr
)
{
autoc
[
ptr
-
lag_ptr
]
+=
data1
[
ptr
]
*
data1
[
lag_ptr
];
lag_ptr
++
;
}
ptr
++
;
}
}
while
(
ptr
<
len
)
{
lag_ptr
=
ptr
-
lag
;
for
(
i
=
0
;
i
<
len
;
i
++
){
while
(
lag_ptr
<=
ptr
)
{
for
(
lag_ptr
=
i
-
lag
;
lag_ptr
<=
i
;
lag_ptr
++
){
autoc
[
ptr
-
lag_ptr
]
+=
data1
[
ptr
]
*
data1
[
lag_ptr
];
autoc
[
i
-
lag_ptr
]
+=
data1
[
i
]
*
data1
[
lag_ptr
];
lag_ptr
++
;
}
}
ptr
++
;
}
}
av_freep
(
&
data1
);
}
}
/**
/**
...
...
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