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
24702a91
Commit
24702a91
authored
Oct 06, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pca: get rid of VLA
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
56d7f7d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
pca.c
libavutil/pca.c
+4
-1
No files found.
libavutil/pca.c
View file @
24702a91
...
...
@@ -32,6 +32,7 @@ typedef struct PCA{
int
n
;
double
*
covariance
;
double
*
mean
;
double
*
z
;
}
PCA
;
PCA
*
ff_pca_init
(
int
n
){
...
...
@@ -41,6 +42,7 @@ PCA *ff_pca_init(int n){
pca
=
av_mallocz
(
sizeof
(
PCA
));
pca
->
n
=
n
;
pca
->
z
=
av_malloc
(
sizeof
(
*
pca
->
z
)
*
n
);
pca
->
count
=
0
;
pca
->
covariance
=
av_mallocz
(
sizeof
(
double
)
*
n
*
n
);
pca
->
mean
=
av_mallocz
(
sizeof
(
double
)
*
n
);
...
...
@@ -51,6 +53,7 @@ PCA *ff_pca_init(int n){
void
ff_pca_free
(
PCA
*
pca
){
av_freep
(
&
pca
->
covariance
);
av_freep
(
&
pca
->
mean
);
av_freep
(
&
pca
->
z
);
av_free
(
pca
);
}
...
...
@@ -70,7 +73,7 @@ int ff_pca(PCA *pca, double *eigenvector, double *eigenvalue){
int
i
,
j
,
pass
;
int
k
=
0
;
const
int
n
=
pca
->
n
;
double
z
[
n
]
;
double
*
z
=
pca
->
z
;
memset
(
eigenvector
,
0
,
sizeof
(
double
)
*
n
*
n
);
...
...
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