aboutsummaryrefslogtreecommitdiffstats
path: root/include/libpqf.h
blob: a9c05af439b24f64ff1309c61e82e8deb8632f65 (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * This file is part of libpqf project.
 *
 * libpqf is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * libpqf is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with libpqf; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef LIBPQF_H
#define LIBPQF_H

#include <stdint.h>

typedef struct pqf_a_ctx *pqf_a_ctx_t;

typedef enum {
    PQF_SUCCESS,
    PQF_WRONG_SUBBAND_SZ,
    PQF_WRONG_SUBBANDS_NUM,
    PQF_WRONG_PROTO_SZ,
    PQF_FRAME_TOO_LONG,
    PQF_CONTRACT_VIOLATION,
    PQF_NOMEM
} pqf_status_t;

#ifdef __cplusplus
extern "C" {
#endif

pqf_status_t pqf_create_a_ctx(uint16_t subband_sz, uint16_t subbands_num, uint16_t proto_sz, float* proto, pqf_a_ctx_t* ctx);
void pqf_free_a_ctx(pqf_a_ctx_t ctx);

uint16_t pqf_get_frame_sz(pqf_a_ctx_t ctx);
uint16_t pqf_get_subband_sz(pqf_a_ctx_t ctx);
uint16_t pqf_get_subbands_num(pqf_a_ctx_t ctx);
void pqf_do_analyse(pqf_a_ctx_t ctx, const float* in, float* out);

#ifdef __cplusplus
}
#endif

#endif