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 #ifndef IXHEAACD_MPS_MACRO_DEF_H 21 #define IXHEAACD_MPS_MACRO_DEF_H 22 23 #define SQRT_TWO_Q15 (46341) 24 #define SQRT_THREE_Q15 (56784) 25 26 #define ONE_BY_THREE_Q15 (10923) 27 #define TWO_BY_THREE_Q15 (21845) 28 #define MINUS_ONE_BY_THREE_Q15 (-10923) 29 #define ONE_BY_SQRT_2_Q15 (23170) 30 #define ONE_BY_SQRT_8_Q15 (11585) 31 #define ONE_BY_FIVE_Q16 (13107) 32 #define TWO_PI_IN_Q15 (205887) 33 #define MINUS_PI_BY_EIGHT_Q15 (-12868) 34 #define TWO_PI_BY_FIFTEEN_Q15 (13726) 35 #define THIRTYONE_BY_TWO_IN_Q25 (520093696) 36 37 #define MINUS_ONE_IN_Q15 (-32768) 38 #define MINUS_ONE_IN_Q14 (-16384) 39 #define ONE_IN_Q13 (8192) 40 #define ONE_IN_Q14 (16384) 41 #define ONE_IN_Q15 (32768) 42 #define ONE_IN_Q16 (65536) 43 #define ONE_IN_Q30 (1073741824) 44 #define FOUR_IN_Q15 (131072) 45 #define ONE_BY_SQRT_3_Q15 (18919) 46 #define ONE_BY_NINE_Q16 (7282) 47 #define MINUS_SQRT_2_Q30 (-1518500250) 48 #define THIRTY_IN_Q16 (1966080) 49 50 #define ONE_IN_Q28 (268435456) 51 52 #define ONE_IN_Q25 (33554432) 53 54 #define ONE_FORTYNINE_Q15 (4882432) 55 56 #define MINUS_POINT_NINE_EIGHT_Q15 (-32113) 57 58 #define MINUS_POINT_NINE_NINE_Q15 (-32440) 59 60 #define POINT_THREE_THREE_Q15 (10813) 61 62 #define POINT_EIGHT_Q15 (26214) 63 64 #define ONE_BY_SQRT_TWO_Q30 (759250125) 65 66 #define POINT_FOUR_TWO_Q15 (13763) 67 68 #define POINT_ONE_Q15 (3277) 69 70 #define POINT_NINE_Q15 (29491) 71 72 #define SUM_SIZE (2048) 73 74 #define RES_CHXQMFXTSX4 (184320) 75 76 #define RES_CHXQMFXTS (46080) 77 78 #define NR_QMF_BANDS_LFXTS (216) 79 80 #define QMF_BANDSXTSX6 (27648) 81 82 #define LOOP_COUNTER (32) 83 84 #define MAX_PSXPB (224) 85 86 #define SYN_BUFFER_SIZE (18432) 87 88 #define QBXTSX2 (9216) 89 90 #define PARAMETER_BANDSX2 (56) 91 92 #define PARAMETER_BANDSX3 (84) 93 94 #define PARAMETER_BANDSX1_5 (42) 95 96 #define QMF_BANDSX8 (512) 97 98 #define QBXTS (4608) 99 100 #define QBXTSX3 (13824) 101 102 #define TWO_BY_TWENTYFIVE_Q16 (5243) 103 104 #define QBX48 (3072) 105 106 #define TSXHB (5112) 107 108 #define MAX_TIMESLOTSX2 (144) 109 110 #define RESHAPE_OFFSET_1 (18) 111 112 #define RESHAPE_OFFSET_2 (54) 113 114 #define PB_OFFSET (9) 115 116 #define SCRATCH_OFFSET_SMOOTHING (176) 117 118 #define MAX_TIME_SLOTSX12 (864) 119 120 #define INPUT_CHX2 (12) 121 122 #define INPUT_CHX1_5 (9) 123 124 #define OUTPUT_CHX1_5 (20) 125 126 #define OUTPUT_CHX3 (41) 127 128 #define IN_CH_2XOUT_CH (32) 129 130 #define IN_CHXBP_SIZE (150) 131 132 #define OUT_CHXQB (512) 133 134 #define MAX_PARAMETER_BANDS_PLUS_1 (29) 135 136 #define PARAMETER_BANDSX52 (1456) 137 138 #define PARAMETER_BANDSX16 (448) 139 140 #define PARAMETER_BANDSX18 (504) 141 142 #define PARAMETER_BANDSX15 (420) 143 144 #define PARAMETER_BANDSX32 (896) 145 146 #define PARAMETER_BANDSX12 (336) 147 148 #define PARAMETER_BANDSX56 (1568) 149 150 #define PARAMETER_BANDSX24 (672) 151 152 #define PREV_GAINAT (5824) 153 154 #define ARBDMX_ALPHA (24) 155 156 #define M1_PREV (5376) 157 158 #define M2_PREV_RESID (2128) 159 160 #define M2_PREV_DECOR (1680) 161 162 #define QMF_DELAY_INPUT (7680) 163 164 #define ANA_BUF_SIZE (15360) 165 166 #define SYN_BUF_SIZE (18432 + sizeof(ia_mps_dec_synthesis_interface)) 167 168 #define PBXPS (224) 169 170 #define MAX_NUM_DEN_LENGTH (21) 171 172 #define HYB_FILTER_STATE_SIZE sizeof(ia_mps_dec_thyb_filter_state_struct) * 16 173 174 #define TONALITY_STATE_SIZE sizeof(ia_mps_dec_tonality_state_struct) 175 176 #define SMOOTHING_STATE_SIZE sizeof(ia_mps_dec_smoothing_state_struct) 177 178 #define RESHAPE_STATE_SIZE sizeof(ia_mps_dec_reshape_bb_env_state_struct) 179 180 #define SUBBAND_TP_SIZE sizeof(ia_mps_dec_subband_tp_params_struct) 181 182 #define BLIND_DECODER_SIZE sizeof(ia_mps_dec_blind_decoder_struct) 183 184 #define ARRAY_STRUCT_SIZE sizeof(ia_mps_dec_reuse_array_struct) 185 186 #define QMF_RES_BUF_SIZE (368640) 187 188 #define QMF_BUF_SIZE (110592) 189 190 #define BUF_SIZE (163584) 191 192 #define MDCT_RES_BUF_SIZE (327680) 193 194 #define PCXQB (320) 195 196 #define RFX2XMDCTCOEF (8192) 197 198 #define MDCTCOEFX2 (2048) 199 200 #define TSXHBX5 (25560) 201 202 #define INCHXPBXPS (1344) 203 204 #define ONE_BIT_MASK (0x00000001) 205 #define TWO_BIT_MASK (0x00000003) 206 #define THREE_BIT_MASK (0x00000007) 207 #define FOUR_BIT_MASK (0x0000000F) 208 #define FIVE_BIT_MASK (0x0000001F) 209 #define SIX_BIT_MASK (0x0000003F) 210 #define SEVEN_BIT_MASK (0x0000007F) 211 #define WORD_LENGTH (32) 212 213 #define COS_PI_BY_8 (0x7642) 214 #define SIN_PI_BY_8 (0x30fc) 215 216 #endif /* IXHEAACD_MPS_MACRO_DEF_H */ 217