xref: /aosp_15_r20/external/liblc3/src/attdet.h (revision 49fe348c0058011ee60b6957cdd9d52742df84bc)
1*49fe348cSAndroid Build Coastguard Worker /******************************************************************************
2*49fe348cSAndroid Build Coastguard Worker  *
3*49fe348cSAndroid Build Coastguard Worker  *  Copyright 2022 Google LLC
4*49fe348cSAndroid Build Coastguard Worker  *
5*49fe348cSAndroid Build Coastguard Worker  *  Licensed under the Apache License, Version 2.0 (the "License");
6*49fe348cSAndroid Build Coastguard Worker  *  you may not use this file except in compliance with the License.
7*49fe348cSAndroid Build Coastguard Worker  *  You may obtain a copy of the License at:
8*49fe348cSAndroid Build Coastguard Worker  *
9*49fe348cSAndroid Build Coastguard Worker  *  http://www.apache.org/licenses/LICENSE-2.0
10*49fe348cSAndroid Build Coastguard Worker  *
11*49fe348cSAndroid Build Coastguard Worker  *  Unless required by applicable law or agreed to in writing, software
12*49fe348cSAndroid Build Coastguard Worker  *  distributed under the License is distributed on an "AS IS" BASIS,
13*49fe348cSAndroid Build Coastguard Worker  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*49fe348cSAndroid Build Coastguard Worker  *  See the License for the specific language governing permissions and
15*49fe348cSAndroid Build Coastguard Worker  *  limitations under the License.
16*49fe348cSAndroid Build Coastguard Worker  *
17*49fe348cSAndroid Build Coastguard Worker  ******************************************************************************/
18*49fe348cSAndroid Build Coastguard Worker 
19*49fe348cSAndroid Build Coastguard Worker #ifndef __LC3_ATTDET_H
20*49fe348cSAndroid Build Coastguard Worker #define __LC3_ATTDET_H
21*49fe348cSAndroid Build Coastguard Worker 
22*49fe348cSAndroid Build Coastguard Worker #include "common.h"
23*49fe348cSAndroid Build Coastguard Worker 
24*49fe348cSAndroid Build Coastguard Worker 
25*49fe348cSAndroid Build Coastguard Worker /**
26*49fe348cSAndroid Build Coastguard Worker  * Time domain attack detector
27*49fe348cSAndroid Build Coastguard Worker  * dt, sr          Duration and samplerate of the frame
28*49fe348cSAndroid Build Coastguard Worker  * nbytes          Size in bytes of the frame
29*49fe348cSAndroid Build Coastguard Worker  * attdet          Context of the Attack Detector
30*49fe348cSAndroid Build Coastguard Worker  * x               [-6..-1] Previous, [0..ns-1] Current samples
31*49fe348cSAndroid Build Coastguard Worker  * return          1: Attack detected  0: Otherwise
32*49fe348cSAndroid Build Coastguard Worker  */
33*49fe348cSAndroid Build Coastguard Worker bool lc3_attdet_run(enum lc3_dt dt, enum lc3_srate sr,
34*49fe348cSAndroid Build Coastguard Worker     int nbytes, lc3_attdet_analysis_t *attdet, const int16_t *x);
35*49fe348cSAndroid Build Coastguard Worker 
36*49fe348cSAndroid Build Coastguard Worker 
37*49fe348cSAndroid Build Coastguard Worker #endif /* __LC3_ATTDET_H */
38