• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *                                                                            *
3  * Copyright (C) 2018 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 #ifndef IXHEAACD_LPP_TRAN_H
21 #define IXHEAACD_LPP_TRAN_H
22 
23 #define MAX_NUM_PATCHES 6
24 #define GUARDBANDS 0
25 #define SHIFT_START_SB 1
26 
27 typedef struct {
28   WORD32 phi_11;
29   WORD32 phi_22;
30   WORD32 phi_01;
31   WORD32 phi_02;
32   WORD32 phi_12;
33   WORD32 phi_01_im;
34   WORD32 phi_02_im;
35   WORD32 phi_12_im;
36   WORD32 d;
37 } ixheaacd_lpp_trans_cov_matrix;
38 
39 typedef struct {
40   WORD16 src_start_band;
41   WORD16 src_end_band;
42   WORD16 guard_start_band;
43 
44   WORD16 dst_start_band;
45   WORD16 dst_end_band;
46   WORD16 num_bands_in_patch;
47 } ia_patch_param_struct;
48 
49 typedef struct {
50   WORD16 num_columns;
51   WORD16 num_patches;
52   WORD16 start_patch;
53   WORD16 stop_patch;
54   WORD16 bw_borders[MAX_NUM_NOISE_VALUES];
55   ia_patch_param_struct str_patch_param[MAX_NUM_PATCHES];
56 } ia_transposer_settings_struct;
57 
58 typedef struct {
59   ia_transposer_settings_struct *pstr_settings;
60   WORD32 bw_array_prev[MAX_NUM_PATCHES];
61   WORD32 *lpc_filt_states_real[LPC_ORDER];
62   WORD32 *lpc_filt_states_imag[LPC_ORDER];
63 } ia_sbr_hf_generator_struct;
64 
65 VOID ixheaacd_low_pow_hf_generator(
66     ia_sbr_hf_generator_struct *hf_generator, WORD32 **qmf_buff_re,
67     WORD16 *degree_alias, WORD first_slot_offset, WORD last_slot_offset,
68     WORD num_if_bands, WORD max_qmf_subband_aac, WORD32 *sbr_invf_mode,
69     WORD32 *sbr_invf_mode_prev, WORD32 norm_max, WORD32 *ptr_qmf_matrix);
70 
71 VOID ixheaacd_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
72                            ia_sbr_scale_fact_struct *sbr_scale_factor,
73                            WORD32 **qmf_buff_re, WORD32 **qmf_buff_im,
74                            WORD time_step, WORD first_slot_offset,
75                            WORD last_slot_offset, WORD num_if_bands,
76                            WORD max_qmf_subband_aac, WORD32 *sbr_invf_mode,
77                            WORD32 *sbr_invf_mode_prev, WORD32 *ptr_qmf_matrix,
78                            WORD audio_object_type);
79 
80 VOID ixheaacd_invfilt_level_emphasis(ia_sbr_hf_generator_struct *hf_generator,
81                                      WORD32 num_if_bands, WORD32 *sbr_invf_mode,
82                                      WORD32 *sbr_invf_mode_prev,
83                                      WORD32 *bw_array);
84 
85 struct ixheaacd_lpp_trans_patch {
86   WORD32 num_patches;
87   WORD32 start_subband[MAX_NUM_PATCHES + 1];
88 };
89 
90 VOID ixheaacd_covariance_matrix_calc_dec(
91     WORD32 *sub_sign_xlow, ixheaacd_lpp_trans_cov_matrix *cov_matrix,
92     WORD32 count);
93 
94 VOID ixheaacd_covariance_matrix_calc_armv7(
95     WORD32 *sub_sign_xlow, ixheaacd_lpp_trans_cov_matrix *cov_matrix,
96     WORD32 count);
97 
98 VOID ixheaacd_covariance_matrix_calc_2_dec(
99     ixheaacd_lpp_trans_cov_matrix *cov_matrix, WORD32 *real_buffer,
100     WORD32 ixheaacd_num_bands, WORD16 slots);
101 
102 VOID ixheaacd_covariance_matrix_calc_2_armv7(
103     ixheaacd_lpp_trans_cov_matrix *cov_matrix, WORD32 *real_buffer,
104     WORD32 ixheaacd_num_bands, WORD16 slots);
105 
106 #endif /* IXHEAACD_LPP_TRAN_H */
107