Moving LPCNetState

This commit is contained in:
Jean-Marc Valin 2019-03-18 13:42:30 -04:00
parent e63292bd56
commit fe608dfc51
2 changed files with 17 additions and 16 deletions

View file

@ -31,9 +31,8 @@
#include "common.h" #include "common.h"
#include "arch.h" #include "arch.h"
#include "lpcnet.h" #include "lpcnet.h"
#include "lpcnet_private.h"
#define LPC_ORDER 16
#define PREEMPH 0.85f #define PREEMPH 0.85f
#define PITCH_GAIN_FEATURE 37 #define PITCH_GAIN_FEATURE 37
@ -41,20 +40,6 @@
#define FRAME_INPUT_SIZE (NB_FEATURES + EMBED_PITCH_OUT_SIZE) #define FRAME_INPUT_SIZE (NB_FEATURES + EMBED_PITCH_OUT_SIZE)
#define SAMPLE_INPUT_SIZE (2*EMBED_SIG_OUT_SIZE + EMBED_EXC_OUT_SIZE + FEATURE_DENSE2_OUT_SIZE)
#define FEATURES_DELAY (FEATURE_CONV1_DELAY + FEATURE_CONV2_DELAY)
struct LPCNetState {
NNetState nnet;
int last_exc;
float last_sig[LPC_ORDER];
float old_input[FEATURES_DELAY][FEATURE_CONV2_OUT_SIZE];
float old_lpc[FEATURES_DELAY][LPC_ORDER];
float old_gain[FEATURES_DELAY];
int frame_count;
float deemph_mem;
};
#if 0 #if 0
static void print_vector(float *x, int N) static void print_vector(float *x, int N)

View file

@ -4,6 +4,8 @@
#include "common.h" #include "common.h"
#include "freq.h" #include "freq.h"
#include "lpcnet.h" #include "lpcnet.h"
#include "nnet_data.h"
#include "celt_lpc.h"
#define BITS_PER_CHAR 8 #define BITS_PER_CHAR 8
@ -18,6 +20,20 @@
#define FORBIDDEN_INTERP 7 #define FORBIDDEN_INTERP 7
#define FEATURES_DELAY (FEATURE_CONV1_DELAY + FEATURE_CONV2_DELAY)
struct LPCNetState {
NNetState nnet;
int last_exc;
float last_sig[LPC_ORDER];
float old_input[FEATURES_DELAY][FEATURE_CONV2_OUT_SIZE];
float old_lpc[FEATURES_DELAY][LPC_ORDER];
float old_gain[FEATURES_DELAY];
int frame_count;
float deemph_mem;
};
struct LPCNetEncState{ struct LPCNetEncState{
float analysis_mem[OVERLAP_SIZE]; float analysis_mem[OVERLAP_SIZE];