Deluge Firmware
1.3.0
Build date: 2026.03.02
Loading...
Searching...
No Matches
fm_core.h
1
/*
2
* Copyright 2012 Google Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include "aligned_buf.h"
20
#include "fm_op_kernel.h"
21
22
#define div_n(base, inv_n) ((int)((((int64_t)(base)) * (int64_t)(inv_n)) >> 30))
23
24
// TRICKY: neon_fm_kernel claims (n%12)==8 not allowed.
25
// make it 132 to allow 128 output with 4 byte padding
26
const
static
int
DX_MAX_N = 132;
27
28
class
FmOperatorInfo
{
29
public
:
30
int
in;
31
int
out;
32
};
33
34
// operator should be considered inaudible when gain_out is below this
35
const
int
kGainLevelThresh = 1120;
36
37
enum
FmOperatorFlags {
38
OUT_BUS_ONE = 1 << 0,
39
OUT_BUS_TWO = 1 << 1,
40
OUT_BUS_ADD = 1 << 2,
41
IN_BUS_ONE = 1 << 4,
42
IN_BUS_TWO = 1 << 5,
43
FB_IN = 1 << 6,
44
FB_OUT = 1 << 7
45
};
46
47
class
FmAlgorithm
{
48
public
:
49
int
ops[6];
50
};
51
52
class
FmCore
{
53
public
:
54
virtual
~FmCore
() {};
55
static
void
dump();
56
virtual
void
render(int32_t* output,
int
n,
FmOpParams
*
params
,
int
algorithm, int32_t* fb_buf,
57
int32_t feedback_gain);
58
const
static
FmAlgorithm
algorithms[32];
59
bool
neon =
false
;
60
61
protected
:
62
AlignedBuf<int32_t, DX_MAX_N>
buf_[2];
63
};
AlignedBuf
Definition
aligned_buf.h:26
FmAlgorithm
Definition
fm_core.h:47
FmCore
Definition
fm_core.h:52
FmOperatorInfo
Definition
fm_core.h:28
deluge::modulation::params
Definition
param.cpp:27
FmOpParams
Definition
fm_op_kernel.h:21