mirror of https://github.com/drowe67/LPCNet.git
resolved compile issues due to merge
parent
55f1db3113
commit
70aded5485
10
src/lpcnet.c
10
src/lpcnet.c
|
@ -134,7 +134,7 @@ void lpcnet_open_test_file(LPCNetState *lpcnet, char file_name[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lpcnet_synthesize(LPCNetState *lpcnet, short *output, const float *features, int N)
|
void lpcnet_synthesize(LPCNetState *lpcnet, short *output, const float *features, int N, int logmag)
|
||||||
{
|
{
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -156,12 +156,12 @@ void lpcnet_synthesize(LPCNetState *lpcnet, short *output, const float *features
|
||||||
memmove(lpcnet->old_lpc[1], lpcnet->old_lpc[0], (FEATURES_DELAY-1)*LPC_ORDER*sizeof(lpc[0]));
|
memmove(lpcnet->old_lpc[1], lpcnet->old_lpc[0], (FEATURES_DELAY-1)*LPC_ORDER*sizeof(lpc[0]));
|
||||||
|
|
||||||
if (logmag) {
|
if (logmag) {
|
||||||
float tmp[NB_BANDS];
|
float tmp[NB_BANDS];
|
||||||
for (i=0;i<NB_BANDS;i++) tmp[i] = pow(10.f, features[i]);
|
for (i=0;i<NB_BANDS;i++) tmp[i] = pow(10.f, features[i]);
|
||||||
lpc_from_bands(lpcnet->old_lpc[0], tmp);
|
lpc_from_bands(lpcnet->old_lpc[0], tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lpc_from_cepstrum(lpcnet->old_lpc[0], features);
|
lpc_from_cepstrum(lpcnet->old_lpc[0], features);
|
||||||
|
|
||||||
if (lpcnet->ftest) {
|
if (lpcnet->ftest) {
|
||||||
float pitch_f = pitch;
|
float pitch_f = pitch;
|
||||||
|
|
|
@ -243,7 +243,7 @@ void lpcnet_dump(LPCNET_DUMP *d, float x[], float features[])
|
||||||
c2_Sn[i+c2_Sn_size-c2_frame_size] = x[i];
|
c2_Sn[i+c2_Sn_size-c2_frame_size] = x[i];
|
||||||
|
|
||||||
float f0, voicing, snr; int pitch_index;
|
float f0, voicing, snr; int pitch_index;
|
||||||
pitch_index = codec2_pitch_est(d->c2pitch, c2_Sn, &f0, &voicing), &snr;
|
pitch_index = codec2_pitch_est(d->c2pitch, c2_Sn, &f0, &voicing, &snr);
|
||||||
if (pitch_index >= 2*PITCH_MAX_PERIOD) pitch_index = 2*PITCH_MAX_PERIOD-1;
|
if (pitch_index >= 2*PITCH_MAX_PERIOD) pitch_index = 2*PITCH_MAX_PERIOD-1;
|
||||||
if (pitch_index < 2*PITCH_MIN_PERIOD) pitch_index = 2*PITCH_MIN_PERIOD;
|
if (pitch_index < 2*PITCH_MIN_PERIOD) pitch_index = 2*PITCH_MIN_PERIOD;
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ int main(int argc, char **argv) {
|
||||||
int o = 0;
|
int o = 0;
|
||||||
int opt_idx = 0;
|
int opt_idx = 0;
|
||||||
while( o != -1 ) {
|
while( o != -1 ) {
|
||||||
static struct option long_opts[] = {
|
static struct option long_opts[] = {
|
||||||
{"mag", no_argument,0, 'i'},
|
{"mag", no_argument,0, 'i'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
o = getopt_long(argc,argv,"ih",long_opts,&opt_idx);
|
o = getopt_long(argc,argv,"ih",long_opts,&opt_idx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue