diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-12 07:55:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-12 07:55:25 +0100 |
commit | ba4c808721592a8558686b518d12f36e0fe60957 (patch) | |
tree | 90bfefa3d3b0d524c562b6280776807595a10400 /thirdparty/opus/mlp.h | |
parent | 067c259ef139a1d60b64386ff596dfea690aa06d (diff) | |
parent | e00426c512a7905f5f925d382c443bab7a0ca693 (diff) |
Merge pull request #33311 from SneakyFish5/update-opus
Update opus to 1.3.1 and opusfile to 0.11
Diffstat (limited to 'thirdparty/opus/mlp.h')
-rw-r--r-- | thirdparty/opus/mlp.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/thirdparty/opus/mlp.h b/thirdparty/opus/mlp.h index 618e246e2c..d7670550fd 100644 --- a/thirdparty/opus/mlp.h +++ b/thirdparty/opus/mlp.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2008-2011 Octasic Inc. - Written by Jean-Marc Valin */ +/* Copyright (c) 2017 Jean-Marc Valin */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,16 +27,34 @@ #ifndef _MLP_H_ #define _MLP_H_ -#include "arch.h" +#include "opus_types.h" + +#define WEIGHTS_SCALE (1.f/128) + +#define MAX_NEURONS 32 typedef struct { - int layers; - const int *topo; - const float *weights; -} MLP; + const opus_int8 *bias; + const opus_int8 *input_weights; + int nb_inputs; + int nb_neurons; + int sigmoid; +} DenseLayer; + +typedef struct { + const opus_int8 *bias; + const opus_int8 *input_weights; + const opus_int8 *recurrent_weights; + int nb_inputs; + int nb_neurons; +} GRULayer; + +extern const DenseLayer layer0; +extern const GRULayer layer1; +extern const DenseLayer layer2; -extern const MLP net; +void compute_dense(const DenseLayer *layer, float *output, const float *input); -void mlp_process(const MLP *m, const float *in, float *out); +void compute_gru(const GRULayer *gru, float *state, const float *input); #endif /* _MLP_H_ */ |