Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
d749351a
Commit
d749351a
authored
1 year ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Add lpcnet_compute_single_frame_features_float()
parent
8e2b5393
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dnn/include/lpcnet.h
+9
-0
9 additions, 0 deletions
dnn/include/lpcnet.h
dnn/lpcnet_enc.c
+17
-4
17 additions, 4 deletions
dnn/lpcnet_enc.c
with
26 additions
and
4 deletions
dnn/include/lpcnet.h
+
9
−
0
View file @
d749351a
...
...
@@ -145,6 +145,15 @@ LPCNET_EXPORT int lpcnet_compute_features(LPCNetEncState *st, const short *pcm,
*/
LPCNET_EXPORT
int
lpcnet_compute_single_frame_features
(
LPCNetEncState
*
st
,
const
short
*
pcm
,
float
features
[
NB_TOTAL_FEATURES
]);
/** Compute features on LPCNET_FRAME_SIZE speech samples (currently 160) and output features for one 10-ms frame.
* @param [in] st <tt>LPCNetDecState*</tt>: Encoder state
* @param [in] pcm <tt>float *</tt>: Input speech to be analyzed
* @param [out] features <tt>float[NB_TOTAL_FEATURES]</tt>: Four feature vectors
* @retval 0 Success
*/
LPCNET_EXPORT
int
lpcnet_compute_single_frame_features_float
(
LPCNetEncState
*
st
,
const
float
*
pcm
,
float
features
[
NB_TOTAL_FEATURES
]);
/** Gets the size of an <code>LPCNetState</code> structure.
* @returns The size in bytes.
*/
...
...
This diff is collapsed.
Click to expand it.
dnn/lpcnet_enc.c
+
17
−
4
View file @
d749351a
...
...
@@ -894,13 +894,26 @@ LPCNET_EXPORT int lpcnet_compute_features(LPCNetEncState *st, const short *pcm,
return
0
;
}
int
lpcnet_compute_single_frame_features
(
LPCNetEncState
*
st
,
const
short
*
pcm
,
float
features
[
NB_TOTAL_FEATURES
])
{
int
i
;
float
x
[
FRAME_SIZE
];
for
(
i
=
0
;
i
<
FRAME_SIZE
;
i
++
)
x
[
i
]
=
pcm
[
i
];
static
int
lpcnet_compute_single_frame_features_impl
(
LPCNetEncState
*
st
,
float
*
x
,
float
features
[
NB_TOTAL_FEATURES
])
{
preemphasis
(
x
,
&
st
->
mem_preemph
,
x
,
PREEMPHASIS
,
FRAME_SIZE
);
compute_frame_features
(
st
,
x
);
process_single_frame
(
st
,
NULL
);
RNN_COPY
(
features
,
&
st
->
features
[
0
][
0
],
NB_TOTAL_FEATURES
);
return
0
;
}
int
lpcnet_compute_single_frame_features
(
LPCNetEncState
*
st
,
const
short
*
pcm
,
float
features
[
NB_TOTAL_FEATURES
])
{
int
i
;
float
x
[
FRAME_SIZE
];
for
(
i
=
0
;
i
<
FRAME_SIZE
;
i
++
)
x
[
i
]
=
pcm
[
i
];
lpcnet_compute_single_frame_features_impl
(
st
,
x
,
features
);
return
0
;
}
int
lpcnet_compute_single_frame_features_float
(
LPCNetEncState
*
st
,
const
float
*
pcm
,
float
features
[
NB_TOTAL_FEATURES
])
{
int
i
;
float
x
[
FRAME_SIZE
];
for
(
i
=
0
;
i
<
FRAME_SIZE
;
i
++
)
x
[
i
]
=
pcm
[
i
];
lpcnet_compute_single_frame_features_impl
(
st
,
x
,
features
);
return
0
;
}
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