1 /****************************************************************************** 2 * * 3 * Copyright (C) 2023 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ***************************************************************************** 18 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore 19 */ 20 21 #pragma once 22 23 #define IXHEAACE_MAX_NUM_REGIONS 10 24 25 typedef struct { 26 FLOAT32 org_quota_mean[IXHEAACE_INVF_SMOOTHING_LENGTH + 1]; 27 FLOAT32 sbr_quota_mean[IXHEAACE_INVF_SMOOTHING_LENGTH + 1]; 28 29 FLOAT32 org_quota_mean_filt; 30 FLOAT32 sbr_quota_mean_filt; 31 FLOAT32 avg_energy; 32 } ixheaace_str_detector_values; 33 34 typedef struct { 35 WORD32 prev_region_sbr[MAXIMUM_NUM_NOISE_VALUES]; 36 WORD32 prev_region_orig[MAXIMUM_NUM_NOISE_VALUES]; 37 WORD32 freq_band_tab_inv_filt[MAXIMUM_NUM_NOISE_VALUES]; 38 WORD32 no_detector_bands; 39 WORD32 no_detector_bands_max; 40 const ixheaace_str_det_params *ptr_detector_params; 41 ixheaace_invf_mode prev_invf_mode[MAXIMUM_NUM_NOISE_VALUES]; 42 ixheaace_str_detector_values detector_values[MAXIMUM_NUM_NOISE_VALUES]; 43 } ixheaace_str_sbr_inv_filt_est; 44 45 typedef ixheaace_str_sbr_inv_filt_est *ixheaace_pstr_sbr_inv_filt_est; 46 47 VOID ixheaace_qmf_inverse_filtering_detector(ixheaace_pstr_sbr_inv_filt_est pstr_inv_filt, 48 FLOAT32 **ptr_quota_mtx, FLOAT32 *ptr_energy_vec, 49 WORD8 *ptr_idx_vx, WORD32 start_index, 50 WORD32 stop_index, WORD32 transient_flag, 51 ixheaace_invf_mode *ptr_inf_vec, WORD32 is_ld_sbr); 52 53 VOID ixheaace_create_inv_filt_detector(ixheaace_pstr_sbr_inv_filt_est pstr_inv_filt, 54 WORD32 *ptr_freq_band_tab_detector, WORD32 num_det_bands, 55 UWORD32 use_speech_config, 56 ixheaace_str_qmf_tabs *ptr_qmf_tab); 57