Repository navigation
Expand file tree
/
Copy pathwindow.h
More file actions
69 lines (55 loc) · 2.27 KB
/
Copy pathwindow.h
File metadata and controls
69 lines (55 loc) · 2.27 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*****************************************************************************
* window.h : Header for FFT window routines
*****************************************************************************
* Copyright (C) 2014 Ronald Wright
*
* Author: Ronald Wright <logiconcepts819@gmail.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_VISUAL_WINDOW_H_
#define VLC_VISUAL_WINDOW_H_
#include <stdlib.h>
#include <string.h>
#ifndef __cplusplus
# include <stdbool.h>
#endif
/* Window type enum */
enum _enum_window_type { NONE, HANN, FLATTOP, BLACKMANHARRIS, KAISER };
/* Window context structure */
struct _struct_window_context {
/* Storage for window function values */
float * pf_window_table;
/* Buffer size for the window */
int i_buffer_size;
};
typedef enum _enum_window_type window_type;
/* Window parameter structure */
struct _struct_window_param {
/* Window type */
window_type wind_type;
/* Kaiser window parameter */
float f_kaiser_alpha;
};
/* Prototypes for the window function */
typedef struct _struct_window_context window_context;
typedef struct _struct_window_param window_param;
void window_get_param(window_param * p_param);
bool window_init(int i_buffer_size, window_param * p_param, window_context * p_ctx);
void window_scale_in_place(int16_t * p_buffer, window_context * p_ctx);
void window_close(window_context * p_ctx);
/* Macro for defining a new window context */
#define DEFINE_WIND_CONTEXT(name) window_context name = {NULL, 0}
#endif /* include-guard */