/src/libxaac/encoder/ixheaace_sbr_qmf_enc_init.c
Line | Count | Source |
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 | | #include <string.h> |
22 | | |
23 | | #include "ixheaac_type_def.h" |
24 | | #include "ixheaac_constants.h" |
25 | | #include "ixheaace_sbr_def.h" |
26 | | #include "ixheaace_resampler.h" |
27 | | #include "ixheaace_sbr_rom.h" |
28 | | #include "ixheaace_common_rom.h" |
29 | | #include "ixheaace_sbr_hbe.h" |
30 | | #include "ixheaace_sbr_qmf_enc.h" |
31 | | |
32 | | #include "ixheaace_sbr_hybrid.h" |
33 | | #include "ixheaace_aac_constants.h" |
34 | | #include "ixheaac_basic_ops32.h" |
35 | | #include "ixheaac_basic_ops16.h" |
36 | | #include "ixheaac_basic_ops40.h" |
37 | | #include "ixheaac_basic_ops.h" |
38 | | #include "ixheaac_error_standards.h" |
39 | | |
40 | | VOID ixheaace_create_synthesis_qmf_bank( |
41 | | ixheaace_pstr_sbr_qmf_filter_bank pstr_sbr_qmf_filter_bank, WORD32 *ptr_common_buffer, |
42 | 316 | ixheaace_str_sbr_tabs *pstr_sbr_tab) { |
43 | 316 | WORD32 *ptr_temp; |
44 | 316 | ptr_temp = |
45 | 316 | &ptr_common_buffer[5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS + IXHEAACE_PS_BUF4_SIZE]; |
46 | 316 | memset(pstr_sbr_qmf_filter_bank, 0, sizeof(ixheaace_str_sbr_qmf_filter_bank)); |
47 | | |
48 | 316 | pstr_sbr_qmf_filter_bank->ptr_flt_filter = pstr_sbr_tab->ptr_qmf_tab->sbr_p_64_640_qmf; |
49 | 316 | pstr_sbr_qmf_filter_bank->ptr_flt_alt_sin_twiddle = |
50 | 316 | pstr_sbr_tab->ptr_qmf_tab->sbr_alt_sin_twiddle; |
51 | 316 | pstr_sbr_qmf_filter_bank->ptr_flt_cos_twiddle = pstr_sbr_tab->ptr_qmf_tab->sbr_cos_sin_twiddle; |
52 | | |
53 | 316 | pstr_sbr_qmf_filter_bank->ptr_flt_work_buf = (FLOAT32 *)ptr_temp; |
54 | 316 | ptr_temp += 64; |
55 | 316 | pstr_sbr_qmf_filter_bank->ptr_flt_time_buf = (FLOAT32 *)ptr_temp; |
56 | 316 | } |
57 | | |
58 | | VOID ixheaace_create_qmf_bank(ixheaace_pstr_sbr_qmf_filter_bank pstr_sbr_qmf_filter_bank, |
59 | 10.5k | ixheaace_str_sbr_tabs *pstr_sbr_tab, WORD32 is_ld_sbr) { |
60 | 10.5k | pstr_sbr_qmf_filter_bank->offset = 0; |
61 | 10.5k | pstr_sbr_qmf_filter_bank->flag = 0; |
62 | | |
63 | 10.5k | pstr_sbr_qmf_filter_bank->ptr_filter = |
64 | 10.5k | (is_ld_sbr) ? &cld_fb_64_640[0] : pstr_sbr_tab->ptr_qmf_tab->sbr_qmf_64_640; |
65 | | |
66 | 10.5k | pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf = |
67 | 10.5k | (FLOAT32 *)pstr_sbr_qmf_filter_bank->ptr_sbr_qmf_states_ana; |
68 | | |
69 | 10.5k | if (is_ld_sbr) { |
70 | 2.20k | pstr_sbr_qmf_filter_bank->ptr_qmf_states_curr_pos = |
71 | 2.20k | (FLOAT32 *)pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf; |
72 | 2.20k | pstr_sbr_qmf_filter_bank->ptr_fp1 = pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf; |
73 | 2.20k | pstr_sbr_qmf_filter_bank->ptr_fp2 = pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf + 64; |
74 | | |
75 | 2.20k | pstr_sbr_qmf_filter_bank->start_coeff_cnt = 0; |
76 | 2.20k | } |
77 | | |
78 | 10.5k | pstr_sbr_qmf_filter_bank->ptr_ref_coeff_l = pstr_sbr_tab->ptr_qmf_tab->sbr_qmf_64_640 + 10; |
79 | 10.5k | pstr_sbr_qmf_filter_bank->ptr_ref_coeff_r = pstr_sbr_tab->ptr_qmf_tab->sbr_qmf_64_640 + 640; |
80 | 10.5k | pstr_sbr_qmf_filter_bank->ptr_cld_filt = pstr_sbr_tab->ptr_qmf_tab->sbr_cld_fb; |
81 | | |
82 | 10.5k | pstr_sbr_qmf_filter_bank->offset_l = 5; |
83 | 10.5k | pstr_sbr_qmf_filter_bank->offset_r = 5; |
84 | | |
85 | 10.5k | memset(pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf, 0, |
86 | 10.5k | QMF_FILTER_LENGTH * sizeof(pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf[0])); |
87 | 10.5k | } |