Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-11-24 21:33:04 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-11-24 21:33:04 +0300
commit176507e4fcb4c6376af5ec465f23692ce84495fd (patch)
tree3263bc0ed6b82c65764e5062bba8eb715fe4ad5c
parent9d0425d88be5de3278f687f766df1f0b3d14005a (diff)
Remove process_single_frame()
Code moved to compute_frame_features()
-rw-r--r--dnn/dump_data.c1
-rw-r--r--dnn/lpcnet_enc.c12
-rw-r--r--dnn/lpcnet_private.h1
3 files changed, 4 insertions, 10 deletions
diff --git a/dnn/dump_data.c b/dnn/dump_data.c
index 257e627a..c502b60d 100644
--- a/dnn/dump_data.c
+++ b/dnn/dump_data.c
@@ -263,7 +263,6 @@ int main(int argc, char **argv) {
}
fwrite(pitch_features, PITCH_MAX_PERIOD-PITCH_MIN_PERIOD+PITCH_IF_FEATURES, 1, ffeat);
} else {
- process_single_frame(st);
fwrite(st->features, sizeof(float), NB_TOTAL_FEATURES, ffeat);
}
/*if(pitch) fwrite(pcm, FRAME_SIZE, 2, stdout);*/
diff --git a/dnn/lpcnet_enc.c b/dnn/lpcnet_enc.c
index 1e248e6a..e9178b55 100644
--- a/dnn/lpcnet_enc.c
+++ b/dnn/lpcnet_enc.c
@@ -106,6 +106,9 @@ void compute_frame_features(LPCNetEncState *st, const float *in, int arch) {
float ener0;
float ener;
float x[FRAME_SIZE+LPC_ORDER];
+ float frame_corr;
+ float xy, xx, yy;
+ int pitch;
/* [b,a]=ellip(2, 2, 20, 1200/8000); */
static const float lp_b[2] = {-0.84946f, 1.f};
static const float lp_a[2] = {-1.54220f, 0.70781f};
@@ -166,13 +169,7 @@ void compute_frame_features(LPCNetEncState *st, const float *in, int arch) {
/*printf("\n");*/
}
st->dnn_pitch = compute_pitchdnn(&st->pitchdnn, st->if_features, st->xcorr_features, arch);
-}
-
-void process_single_frame(LPCNetEncState *st) {
- float frame_corr;
- float xy, xx, yy;
- /*int pitch = (best[2]+best[3])/2;*/
- int pitch = (int)floor(.5+256./pow(2.f,((1./60.)*((st->dnn_pitch+1.5)*60))));
+ pitch = (int)floor(.5+256./pow(2.f,((1./60.)*((st->dnn_pitch+1.5)*60))));
xx = celt_inner_prod_c(&st->lp_buf[PITCH_MAX_PERIOD], &st->lp_buf[PITCH_MAX_PERIOD], FRAME_SIZE);
yy = celt_inner_prod_c(&st->lp_buf[PITCH_MAX_PERIOD-pitch], &st->lp_buf[PITCH_MAX_PERIOD-pitch], FRAME_SIZE);
xy = celt_inner_prod_c(&st->lp_buf[PITCH_MAX_PERIOD], &st->lp_buf[PITCH_MAX_PERIOD-pitch], FRAME_SIZE);
@@ -196,7 +193,6 @@ void preemphasis(float *y, float *mem, const float *x, float coef, int N) {
static int lpcnet_compute_single_frame_features_impl(LPCNetEncState *st, float *x, float features[NB_TOTAL_FEATURES], int arch) {
preemphasis(x, &st->mem_preemph, x, PREEMPHASIS, FRAME_SIZE);
compute_frame_features(st, x, arch);
- process_single_frame(st);
OPUS_COPY(features, &st->features[0], NB_TOTAL_FEATURES);
return 0;
}
diff --git a/dnn/lpcnet_private.h b/dnn/lpcnet_private.h
index 85325e31..e1e3e9c6 100644
--- a/dnn/lpcnet_private.h
+++ b/dnn/lpcnet_private.h
@@ -77,7 +77,6 @@ void run_frame_network_flush(LPCNetState *lpcnet);
void lpcnet_synthesize_tail_impl(LPCNetState *lpcnet, opus_int16 *output, int N, int preload);
void lpcnet_synthesize_impl(LPCNetState *lpcnet, const float *features, opus_int16 *output, int N, int preload);
void lpcnet_synthesize_blend_impl(LPCNetState *lpcnet, const opus_int16 *pcm_in, opus_int16 *output, int N);
-void process_single_frame(LPCNetEncState *st);
void run_frame_network(LPCNetState *lpcnet, float *gru_a_condition, float *gru_b_condition, float *lpc, const float *features);