Welcome to mirror list, hosted at ThFree Co, Russian Federation.

lossgen.h « dnn - gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cb0460ae1dd777ebd9447ee9a99322d990feccec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef LOSSGEN_H
#define LOSSGEN_H


#include "lossgen_data.h"

#define PITCH_MIN_PERIOD 32
#define PITCH_MAX_PERIOD 256

#define NB_XCORR_FEATURES (PITCH_MAX_PERIOD-PITCH_MIN_PERIOD)


typedef struct {
  LossGen model;
  float gru1_state[LOSSGEN_GRU1_STATE_SIZE];
  float gru2_state[LOSSGEN_GRU2_STATE_SIZE];
  int last_loss;
} LossGenState;


void lossgen_init(LossGenState *st);
int lossgen_load_model(LossGenState *st, const unsigned char *data, int len);

int sample_loss(
    LossGenState *st,
    float percent_loss,
    int arch
    );

#endif