xref: /aosp_15_r20/external/libxaac/encoder/ixheaace_mps_frame_windowing.h (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
1*15dc779aSAndroid Build Coastguard Worker /******************************************************************************
2*15dc779aSAndroid Build Coastguard Worker  *                                                                            *
3*15dc779aSAndroid Build Coastguard Worker  * Copyright (C) 2023 The Android Open Source Project
4*15dc779aSAndroid Build Coastguard Worker  *
5*15dc779aSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
6*15dc779aSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
7*15dc779aSAndroid Build Coastguard Worker  * You may obtain a copy of the License at:
8*15dc779aSAndroid Build Coastguard Worker  *
9*15dc779aSAndroid Build Coastguard Worker  * http://www.apache.org/licenses/LICENSE-2.0
10*15dc779aSAndroid Build Coastguard Worker  *
11*15dc779aSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
12*15dc779aSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
13*15dc779aSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*15dc779aSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
15*15dc779aSAndroid Build Coastguard Worker  * limitations under the License.
16*15dc779aSAndroid Build Coastguard Worker  *
17*15dc779aSAndroid Build Coastguard Worker  *****************************************************************************
18*15dc779aSAndroid Build Coastguard Worker  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*15dc779aSAndroid Build Coastguard Worker  */
20*15dc779aSAndroid Build Coastguard Worker 
21*15dc779aSAndroid Build Coastguard Worker #pragma once
22*15dc779aSAndroid Build Coastguard Worker struct ixheaace_mps_frame_win {
23*15dc779aSAndroid Build Coastguard Worker   WORD32 num_time_slots_max;
24*15dc779aSAndroid Build Coastguard Worker   WORD32 frame_keep_flag;
25*15dc779aSAndroid Build Coastguard Worker   WORD32 start_slope;
26*15dc779aSAndroid Build Coastguard Worker   WORD32 stop_slope;
27*15dc779aSAndroid Build Coastguard Worker   WORD32 start_rect;
28*15dc779aSAndroid Build Coastguard Worker   WORD32 stop_rect;
29*15dc779aSAndroid Build Coastguard Worker 
30*15dc779aSAndroid Build Coastguard Worker   WORD32 taper_ana_len;
31*15dc779aSAndroid Build Coastguard Worker   WORD32 taper_syn_len;
32*15dc779aSAndroid Build Coastguard Worker 
33*15dc779aSAndroid Build Coastguard Worker   FLOAT32 p_taper_ana_flt[MAX_TIME_SLOTS];
34*15dc779aSAndroid Build Coastguard Worker   FLOAT32 p_tapper_sync_flt[MAX_TIME_SLOTS];
35*15dc779aSAndroid Build Coastguard Worker };
36*15dc779aSAndroid Build Coastguard Worker 
37*15dc779aSAndroid Build Coastguard Worker struct ixheaace_mps_frame_win_config {
38*15dc779aSAndroid Build Coastguard Worker   WORD32 num_time_slots_max;
39*15dc779aSAndroid Build Coastguard Worker   WORD32 frame_keep_flag;
40*15dc779aSAndroid Build Coastguard Worker };
41*15dc779aSAndroid Build Coastguard Worker 
42*15dc779aSAndroid Build Coastguard Worker typedef struct {
43*15dc779aSAndroid Build Coastguard Worker   WORD32 slot;
44*15dc779aSAndroid Build Coastguard Worker   WORD32 hold;
45*15dc779aSAndroid Build Coastguard Worker 
46*15dc779aSAndroid Build Coastguard Worker } ixheaace_mps_frame_win_data;
47*15dc779aSAndroid Build Coastguard Worker 
48*15dc779aSAndroid Build Coastguard Worker struct ixheaace_mps_frame_win_list {
49*15dc779aSAndroid Build Coastguard Worker   ixheaace_mps_frame_win_data dat[MAX_NUM_PARAMS];
50*15dc779aSAndroid Build Coastguard Worker   WORD32 win_list_cnt;
51*15dc779aSAndroid Build Coastguard Worker };
52*15dc779aSAndroid Build Coastguard Worker 
53*15dc779aSAndroid Build Coastguard Worker typedef struct ixheaace_mps_frame_win ixheaace_mps_frame_win, *ixheaace_mps_pstr_frame_win;
54*15dc779aSAndroid Build Coastguard Worker 
55*15dc779aSAndroid Build Coastguard Worker typedef struct ixheaace_mps_frame_win_config ixheaace_mps_frame_win_config,
56*15dc779aSAndroid Build Coastguard Worker     *ixheaace_mps_pstr_frame_win_config;
57*15dc779aSAndroid Build Coastguard Worker 
58*15dc779aSAndroid Build Coastguard Worker typedef struct ixheaace_mps_frame_win_list ixheaace_mps_frame_win_list,
59*15dc779aSAndroid Build Coastguard Worker     *ixheaace_mps_pstr_frame_win_list;
60*15dc779aSAndroid Build Coastguard Worker 
61*15dc779aSAndroid Build Coastguard Worker IA_ERRORCODE ixheaace_mps_212_frame_window_init(
62*15dc779aSAndroid Build Coastguard Worker     ixheaace_mps_pstr_frame_win pstr_frame_window,
63*15dc779aSAndroid Build Coastguard Worker     const ixheaace_mps_pstr_frame_win_config pstr_frame_window_config);
64*15dc779aSAndroid Build Coastguard Worker 
65*15dc779aSAndroid Build Coastguard Worker IA_ERRORCODE ixheaace_mps_212_frame_window_get_window(
66*15dc779aSAndroid Build Coastguard Worker     ixheaace_mps_pstr_frame_win pstr_frame_window, WORD32 tr_pos[MAX_NUM_PARAMS],
67*15dc779aSAndroid Build Coastguard Worker     const WORD32 time_slots, ixheaace_mps_framing_info *const pstr_framing_info,
68*15dc779aSAndroid Build Coastguard Worker     FLOAT32 *p_window_ana_mps[MAX_NUM_PARAMS],
69*15dc779aSAndroid Build Coastguard Worker     ixheaace_mps_pstr_frame_win_list const p_frame_win_list, const WORD32 avoid_keep);
70*15dc779aSAndroid Build Coastguard Worker 
71*15dc779aSAndroid Build Coastguard Worker VOID ixheaace_mps_212_analysis_windowing(
72*15dc779aSAndroid Build Coastguard Worker     const WORD32 num_time_slots, const WORD32 start_time_slot, FLOAT32 *p_frame_window_ana_mps,
73*15dc779aSAndroid Build Coastguard Worker     ixheaace_cmplx_str pp_cmplx_data_in[MAX_ANA_TIME_SLOT][MAX_QMF_BANDS],
74*15dc779aSAndroid Build Coastguard Worker     ixheaace_cmplx_str pp_cmplx_data_out[MAX_ANA_TIME_SLOT][MAX_QMF_BANDS],
75*15dc779aSAndroid Build Coastguard Worker     const WORD32 num_hybrid_bands);
76