mirror of
https://github.com/xiph/opus.git
synced 2025-05-28 06:09:15 +00:00
Starting to actually test this -- fix a few OOB reads
This commit is contained in:
parent
8d62ba067e
commit
538f25565a
3 changed files with 22 additions and 3 deletions
19
dnn/lpcnet.c
19
dnn/lpcnet.c
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "nnet_data.h"
|
||||
#include "nnet.h"
|
||||
#include "common.h"
|
||||
|
@ -150,3 +151,21 @@ void lpcnet_synthesize(LPCNetState *lpcnet, short *output, const float *features
|
|||
lpcnet->last_exc = exc;
|
||||
}
|
||||
}
|
||||
|
||||
#if 1
|
||||
#define FRAME_SIZE 160
|
||||
int main(int argc, char **argv) {
|
||||
LPCNetState *net;
|
||||
net = lpcnet_create();
|
||||
while (1) {
|
||||
float features[NB_FEATURES];
|
||||
short pcm[FRAME_SIZE];
|
||||
fread(features, sizeof(features[0]), NB_FEATURES, stdin);
|
||||
if (feof(stdin)) break;
|
||||
lpcnet_synthesize(net, pcm, features, FRAME_SIZE);
|
||||
fwrite(pcm, sizeof(pcm[0]), FRAME_SIZE, stdout);
|
||||
}
|
||||
lpcnet_destroy(net);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue