optek_hifi2_vol.h
2.52 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
Optek Vol
Copyright by Optek in May 24, 2016
*/
#ifndef _OPTEK_HIFI2_VOL_H
#define _OPTEK_HIFI2_VOL_H
/*
input->no input
return->string of optek_vol build date,time and version
*/
const char *optek_vol_data_get(void);
const char *optek_vol_time_get(void);
const char *optek_vol_version_get(void);
/*
input no
return->how many bytes needed for optek_vol
*/
int optek_vol_alloc(void);
void optek_vol_init (void);
/*
handle->optek_vol
master_vol->real vol = master_vol * vol, for different applications
return->no return
*/
void optek_vol_set_master_vol (void *handle, int master_vol);
/*
handle->optek_vol
vol_L->request vol for chan L
vol_R->request vol for chan R
return->no return
*/
void optek_vol_set_vol (void *handle, int vol_L, int vol_R);
/*
objmem->mem allocated for optek_vol
master_vol->real vol = master_vol * vol, for different applications
vol_curr_L->current vol for chan L
vol_req_L->request vol for chan L
vol_curr_R->current vol for chan R
vol_req_R->request vol for chan R
up_rate->soft vol up step, should > 0db, vol* up_rate
down_rate->soft vol down step, should <0db, vol * down_rate
update_samples->soft vol update time, about 1ms
post_scale->0, not support post scale; 1, support post scale
L_R_same_vol->for soft vol, 0 means L/R vol is not same, 1 means L/R vol is same
return->no return
*/
void * optek_vol_open (void * objmem, int master_vol, int vol_curr_L, int vol_req_L, int vol_curr_R, int vol_req_R, uint8_t L_R_same_vol);
/*
handle->optek_vol
x->input buf
r->output buf
N->samples (L sampes + R samples for stereo, samples for mono)
return->no return
*/
//MCPS: 0.78 Average: 0.78 Peak: 0.85
void optek_vol_stereo_24b_w_zdt_process (void *handle, const int *x, int *r, int N) OPTEK_HIFI2_DSP_ATTIB;
/*
x->input buf
r->output buf
gain->gain(VOL_EXP)
N->samples (L sampes + R samples for stereo, samples for mono)
return->no return
*/
//MCPS: 0.34 Average: 0.34 Peak: 0.34
void optek_vol_24b_process (const int *x, int *r, int gain, int N) OPTEK_HIFI2_DSP_ATTIB;
/*
x->input buf
r->output buf
gain->gain(EBASS_VOL_EXP)
N->samples (L sampes + R samples for stereo, samples for mono)
return->no return
*/
void optek_vol_ebass_24b_process (const int *x, int *r, int gain, int N) OPTEK_HIFI2_DSP_ATTIB;
/*
x->input buf
r->output buf
gain->gain(VOL_EXP)
N->samples (L sampes + R samples for stereo, samples for mono)
return->no return
*/
//MCPS: 0.34 Average: 0.34 Peak: 0.34
void optek_vol_16b_process (const short *x, short *r, int gain, int N) OPTEK_HIFI2_DSP_ATTIB;
#endif //_OPTEK_HIFI2_VOL_H