shithub: opus

Download patch

ref: 3982144f8ed9d3b42e001b670929e95fd7d29f3e
parent: ea405cc6844ef4bc025525223c9ab3c589fc2882
author: Jean-Marc Valin <jmvalin@amazon.com>
date: Wed Feb 23 22:22:04 EST 2022

Revert PLC state to use Burg in the causal overlap

--- a/dnn/lpcnet_plc.c
+++ b/dnn/lpcnet_plc.c
@@ -121,6 +121,7 @@
       float zeros[2*NB_BANDS+NB_FEATURES+1] = {0};
       RNN_COPY(zeros, plc_features, 2*NB_BANDS);
       zeros[2*NB_BANDS+NB_FEATURES] = 1;
+      st->plc_net = st->plc_copy;
       compute_plc_pred(&st->plc_net, st->features, zeros);
       if (st->enable_blending) {
         LPCNetState copy;
@@ -196,6 +197,7 @@
     st->pcm_fill -= update_count;
     st->skip_analysis++;
   }
+  st->plc_copy = st->plc_net;
   lpcnet_synthesize_tail_impl(&st->lpcnet, pcm, FRAME_SIZE-TRAINING_OFFSET, 0);
   compute_plc_pred(&st->plc_net, st->features, zeros);
   if (st->loss_count >= 10) st->features[0] = MAX16(-10, st->features[0]+att_table[9] - 2*(st->loss_count-9));
--- a/dnn/lpcnet_private.h
+++ b/dnn/lpcnet_private.h
@@ -78,6 +78,7 @@
   float features[NB_TOTAL_FEATURES];
   int loss_count;
   PLCNetState plc_net;
+  PLCNetState plc_copy;
   int enable_blending;
   int non_causal;
   double dc_mem;
--