xref: /btstack/3rd-party/lc3-google/src/attdet.h (revision 6897da5c53aac5b1f90f41b5b15d0bd43d61dfff)
19a19cd78SMatthias Ringwald /******************************************************************************
29a19cd78SMatthias Ringwald  *
3*4930cef6SMatthias Ringwald  *  Copyright 2022 Google LLC
49a19cd78SMatthias Ringwald  *
59a19cd78SMatthias Ringwald  *  Licensed under the Apache License, Version 2.0 (the "License");
69a19cd78SMatthias Ringwald  *  you may not use this file except in compliance with the License.
79a19cd78SMatthias Ringwald  *  You may obtain a copy of the License at:
89a19cd78SMatthias Ringwald  *
99a19cd78SMatthias Ringwald  *  http://www.apache.org/licenses/LICENSE-2.0
109a19cd78SMatthias Ringwald  *
119a19cd78SMatthias Ringwald  *  Unless required by applicable law or agreed to in writing, software
129a19cd78SMatthias Ringwald  *  distributed under the License is distributed on an "AS IS" BASIS,
139a19cd78SMatthias Ringwald  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149a19cd78SMatthias Ringwald  *  See the License for the specific language governing permissions and
159a19cd78SMatthias Ringwald  *  limitations under the License.
169a19cd78SMatthias Ringwald  *
179a19cd78SMatthias Ringwald  ******************************************************************************/
189a19cd78SMatthias Ringwald 
199a19cd78SMatthias Ringwald #ifndef __LC3_ATTDET_H
209a19cd78SMatthias Ringwald #define __LC3_ATTDET_H
219a19cd78SMatthias Ringwald 
229a19cd78SMatthias Ringwald #include "common.h"
239a19cd78SMatthias Ringwald 
249a19cd78SMatthias Ringwald 
259a19cd78SMatthias Ringwald /**
269a19cd78SMatthias Ringwald  * Time domain attack detector
279a19cd78SMatthias Ringwald  * dt, sr          Duration and samplerate of the frame
289a19cd78SMatthias Ringwald  * nbytes          Size in bytes of the frame
299a19cd78SMatthias Ringwald  * attdet          Context of the Attack Detector
309a19cd78SMatthias Ringwald  * x               [-6..-1] Previous, [0..ns-1] Current samples
319a19cd78SMatthias Ringwald  * return          1: Attack detected  0: Otherwise
329a19cd78SMatthias Ringwald  */
339a19cd78SMatthias Ringwald bool lc3_attdet_run(enum lc3_dt dt, enum lc3_srate sr,
34*4930cef6SMatthias Ringwald     int nbytes, lc3_attdet_analysis_t *attdet, const int16_t *x);
359a19cd78SMatthias Ringwald 
369a19cd78SMatthias Ringwald 
379a19cd78SMatthias Ringwald #endif /* __LC3_ATTDET_H */
38