forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrc.h
More file actions
70 lines (53 loc) · 1.78 KB
/
drc.h
File metadata and controls
70 lines (53 loc) · 1.78 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
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2020 Google LLC. All rights reserved.
*
* Author: Pin-chih Lin <johnylin@google.com>
*/
#ifndef __USER_DRC_H__
#define __USER_DRC_H__
#include <stdint.h>
/* Maximum number allowed in configuration blob */
#define SOF_DRC_MAX_SIZE 1024
/* The parameters of the DRC compressor */
struct sof_drc_params {
/* 1 to enable DRC, 0 to disable it */
int32_t enabled;
/* The value above which the compression starts, in dB */
int32_t db_threshold; /* Q8.24 */
/* The value above which the knee region starts, in dB */
int32_t db_knee; /* Q8.24 */
/* The input/output dB ratio after the knee region */
int32_t ratio; /* Q8.24 */
/* The lookahead time for the compressor, in seconds */
int32_t pre_delay_time; /* Q2.30 */
/* The input to output change below the threshold is 1:1 */
int32_t linear_threshold; /* Q2.30 */
/* Inverse ratio */
int32_t slope; /* Q2.30 */
/* Internal parameter for the knee portion of the curve. */
int32_t K; /* Q12.20 */
/* Pre-calculated parameters */
int32_t knee_alpha; /* Q8.24 */
int32_t knee_beta; /* Q8.24 */
int32_t knee_threshold; /* Q8.24 */
int32_t ratio_base; /* Q2.30 */
int32_t master_linear_gain; /* Q8.24 */
int32_t one_over_attack_frames; /* Q2.30 */
int32_t sat_release_frames_inv_neg; /* Q2.30 */
int32_t sat_release_rate_at_neg_two_db; /* Q2.30 */
/* The release frames coefficients */
int32_t kSpacingDb; /* Q32.0 */
int32_t kA; /* Q20.12 */
int32_t kB; /* Q20.12 */
int32_t kC; /* Q20.12 */
int32_t kD; /* Q20.12 */
int32_t kE; /* Q20.12 */
} __attribute__((packed));
struct sof_drc_config {
uint32_t size;
/* reserved */
uint32_t reserved[4];
struct sof_drc_params params;
} __attribute__((packed));
#endif // __USER_DRC_H__