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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Luma Media Server
ffmpeg
Commits
9d4da474
Commit
9d4da474
authored
12 years ago
by
Luca Barbato
Browse files
Options
Downloads
Patches
Plain Diff
lls: move to the private namespace
The functions are private.
parent
7ac6d242
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libavcodec/lpc.c
+4
-4
4 additions, 4 deletions
libavcodec/lpc.c
libavutil/lls.c
+27
-8
27 additions, 8 deletions
libavutil/lls.c
libavutil/lls.h
+7
-1
7 additions, 1 deletion
libavutil/lls.h
libavutil/version.h
+4
-0
4 additions, 0 deletions
libavutil/version.h
with
42 additions
and
13 deletions
libavcodec/lpc.c
+
4
−
4
View file @
9d4da474
...
...
@@ -203,7 +203,7 @@ int ff_lpc_calc_coefs(LPCContext *s,
double
var
[
MAX_LPC_ORDER
+
1
],
av_uninit
(
weight
);
for
(
pass
=
0
;
pass
<
lpc_passes
;
pass
++
){
av_init_lls
(
&
m
[
pass
&
1
],
max_order
);
av
priv
_init_lls
(
&
m
[
pass
&
1
],
max_order
);
weight
=
0
;
for
(
i
=
max_order
;
i
<
blocksize
;
i
++
){
...
...
@@ -212,7 +212,7 @@ int ff_lpc_calc_coefs(LPCContext *s,
if
(
pass
){
double
eval
,
inv
,
rinv
;
eval
=
av_evaluate_lls
(
&
m
[(
pass
-
1
)
&
1
],
var
+
1
,
max_order
-
1
);
eval
=
av
priv
_evaluate_lls
(
&
m
[(
pass
-
1
)
&
1
],
var
+
1
,
max_order
-
1
);
eval
=
(
512
>>
pass
)
+
fabs
(
eval
-
var
[
0
]);
inv
=
1
/
eval
;
rinv
=
sqrt
(
inv
);
...
...
@@ -222,9 +222,9 @@ int ff_lpc_calc_coefs(LPCContext *s,
}
else
weight
++
;
av_update_lls
(
&
m
[
pass
&
1
],
var
,
1
.
0
);
av
priv
_update_lls
(
&
m
[
pass
&
1
],
var
,
1
.
0
);
}
av_solve_lls
(
&
m
[
pass
&
1
],
0
.
001
,
0
);
av
priv
_solve_lls
(
&
m
[
pass
&
1
],
0
.
001
,
0
);
}
for
(
i
=
0
;
i
<
max_order
;
i
++
){
...
...
This diff is collapsed.
Click to expand it.
libavutil/lls.c
+
27
−
8
View file @
9d4da474
...
...
@@ -30,13 +30,13 @@
#include
"lls.h"
void
av_init_lls
(
LLSModel
*
m
,
int
indep_count
)
void
av
priv
_init_lls
(
LLSModel
*
m
,
int
indep_count
)
{
memset
(
m
,
0
,
sizeof
(
LLSModel
));
m
->
indep_count
=
indep_count
;
}
void
av_update_lls
(
LLSModel
*
m
,
double
*
var
,
double
decay
)
void
av
priv
_update_lls
(
LLSModel
*
m
,
double
*
var
,
double
decay
)
{
int
i
,
j
;
...
...
@@ -48,7 +48,7 @@ void av_update_lls(LLSModel *m, double *var, double decay)
}
}
void
av_solve_lls
(
LLSModel
*
m
,
double
threshold
,
int
min_order
)
void
av
priv
_solve_lls
(
LLSModel
*
m
,
double
threshold
,
int
min_order
)
{
int
i
,
j
,
k
;
double
(
*
factor
)[
MAX_VARS
+
1
]
=
(
void
*
)
&
m
->
covariance
[
1
][
0
];
...
...
@@ -105,7 +105,7 @@ void av_solve_lls(LLSModel *m, double threshold, int min_order)
}
}
double
av_evaluate_lls
(
LLSModel
*
m
,
double
*
param
,
int
order
)
double
av
priv
_evaluate_lls
(
LLSModel
*
m
,
double
*
param
,
int
order
)
{
int
i
;
double
out
=
0
;
...
...
@@ -116,6 +116,25 @@ double av_evaluate_lls(LLSModel *m, double *param, int order)
return
out
;
}
#ifndef FF_API_LLS_PRIVATE
void
av_init_lls
(
LLSModel
*
m
,
int
indep_count
)
{
return
avpriv_init_lls
(
m
,
indep_count
);
}
void
av_update_lls
(
LLSModel
*
m
,
double
*
param
,
double
decay
)
{
return
avpriv_update_lls
(
m
,
param
,
decay
);
}
void
av_solve_lls
(
LLSModel
*
m
,
double
threshold
,
int
min_order
)
{
return
avpriv_solve_lls
(
m
,
threshold
,
min_order
);
}
double
av_evaluate_lls
(
LLSModel
*
m
,
double
*
param
,
int
order
)
{
return
avpriv_evaluate_lls
(
m
,
param
,
order
);
}
#endif
#ifdef TEST
#include
<stdio.h>
...
...
@@ -129,7 +148,7 @@ int main(void)
AVLFG
lfg
;
av_lfg_init
(
&
lfg
,
1
);
av_init_lls
(
&
m
,
3
);
av
priv
_init_lls
(
&
m
,
3
);
for
(
i
=
0
;
i
<
100
;
i
++
)
{
double
var
[
4
];
...
...
@@ -139,10 +158,10 @@ int main(void)
var
[
1
]
=
var
[
0
]
+
av_lfg_get
(
&
lfg
)
/
(
double
)
UINT_MAX
-
0
.
5
;
var
[
2
]
=
var
[
1
]
+
av_lfg_get
(
&
lfg
)
/
(
double
)
UINT_MAX
-
0
.
5
;
var
[
3
]
=
var
[
2
]
+
av_lfg_get
(
&
lfg
)
/
(
double
)
UINT_MAX
-
0
.
5
;
av_update_lls
(
&
m
,
var
,
0
.
99
);
av_solve_lls
(
&
m
,
0
.
001
,
0
);
av
priv
_update_lls
(
&
m
,
var
,
0
.
99
);
av
priv
_solve_lls
(
&
m
,
0
.
001
,
0
);
for
(
order
=
0
;
order
<
3
;
order
++
)
{
eval
=
av_evaluate_lls
(
&
m
,
var
+
1
,
order
);
eval
=
av
priv
_evaluate_lls
(
&
m
,
var
+
1
,
order
);
printf
(
"real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f
\n
"
,
var
[
0
],
order
,
eval
,
sqrt
(
m
.
variance
[
order
]
/
(
i
+
1
)),
m
.
coeff
[
order
][
0
],
m
.
coeff
[
order
][
1
],
...
...
This diff is collapsed.
Click to expand it.
libavutil/lls.h
+
7
−
1
View file @
9d4da474
...
...
@@ -37,9 +37,15 @@ typedef struct LLSModel {
int
indep_count
;
}
LLSModel
;
void
avpriv_init_lls
(
LLSModel
*
m
,
int
indep_count
);
void
avpriv_update_lls
(
LLSModel
*
m
,
double
*
param
,
double
decay
);
void
avpriv_solve_lls
(
LLSModel
*
m
,
double
threshold
,
int
min_order
);
double
avpriv_evaluate_lls
(
LLSModel
*
m
,
double
*
param
,
int
order
);
#ifndef FF_API_LLS_PRIVATE
void
av_init_lls
(
LLSModel
*
m
,
int
indep_count
);
void
av_update_lls
(
LLSModel
*
m
,
double
*
param
,
double
decay
);
void
av_solve_lls
(
LLSModel
*
m
,
double
threshold
,
int
min_order
);
double
av_evaluate_lls
(
LLSModel
*
m
,
double
*
param
,
int
order
);
#endif
#endif
/* AVUTIL_LLS_H */
This diff is collapsed.
Click to expand it.
libavutil/version.h
+
4
−
0
View file @
9d4da474
...
...
@@ -79,6 +79,10 @@
#ifndef FF_API_CPU_FLAG_MMX2
#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53)
#endif
#ifndef FF_API_LLS_PRIVATE
#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53)
#endif
/**
* @}
...
...
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