File: pitchdnn.h

package info (click to toggle)
opus 1.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,860 kB
  • sloc: ansic: 592,652; sh: 4,541; asm: 723; makefile: 457; perl: 264; python: 77
file content (34 lines) | stat: -rw-r--r-- 710 bytes parent folder | download
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
31
32
33
34
#ifndef PITCHDNN_H
#define PITCHDNN_H


typedef struct PitchDNN PitchDNN;

#include "pitchdnn_data.h"

#define PITCH_MIN_PERIOD 32
#define PITCH_MAX_PERIOD 256

#define NB_XCORR_FEATURES (PITCH_MAX_PERIOD-PITCH_MIN_PERIOD)


typedef struct {
  PitchDNN model;
  float gru_state[GRU_1_STATE_SIZE];
  float xcorr_mem1[(NB_XCORR_FEATURES + 2)*2];
  float xcorr_mem2[(NB_XCORR_FEATURES + 2)*2*8];
  float xcorr_mem3[(NB_XCORR_FEATURES + 2)*2*8];
} PitchDNNState;


void pitchdnn_init(PitchDNNState *st);
int pitchdnn_load_model(PitchDNNState *st, const void *data, int len);

float compute_pitchdnn(
    PitchDNNState *st,
    const float *if_features,
    const float *xcorr_features,
    int arch
    );

#endif