xref: /aosp_15_r20/external/libxaac/encoder/ixheaace_sbr_env_est.h (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
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 M_32 (32)
24 #define M_16 (16)
25 #define M_12 (12)
26 #define IXHEAACE_OP_DELAY_OFFSET (6)
27 
28 typedef struct {
29   WORD32 pre_transient_info[2];
30   FLOAT32 *ptr_r_buffer[MAX_QMF_TIME_SLOTS];
31   FLOAT32 *ptr_i_buffer[MAX_QMF_TIME_SLOTS];
32   FLOAT32 *ptr_y_buffer[MAX_QMF_TIME_SLOTS * 2];
33   WORD8 envelope_compensation[MAXIMUM_FREQ_COEFFS];
34   WORD32 y_buffer_write_offset;
35   WORD32 no_cols;
36   WORD32 no_rows;
37   WORD32 start_index;
38   WORD32 time_slots;
39   WORD32 time_step;
40   WORD32 buffer_flag;
41   WORD32 sbr_ratio_idx;
42 } ixheaace_str_sbr_extr_env;
43 typedef ixheaace_str_sbr_extr_env *ixheaace_pstr_sbr_extract_envelope;
44 
45 WORD32
46 ixheaace_create_extract_sbr_envelope(WORD32 ch,
47                                      ixheaace_pstr_sbr_extract_envelope pstr_sbr_ext_env,
48                                      WORD32 start_index, WORD32 *ptr_common_buffer2,
49                                      FLOAT32 *ptr_sbr_env_r_buf, FLOAT32 *ptr_sbr_env_i_buf,
50                                      WORD32 is_ld_sbr, WORD32 frame_flag_480,
51                                      ixheaace_sbr_codec_type sbr_codec);
52 
53 struct ixheaace_str_sbr_config_data;
54 struct ixheaace_str_sbr_bitstream_data;
55 struct ixheaace_str_enc_channel;
56 struct ixheaace_str_common_data;
57 struct ixheaace_ps_enc;
58 
59 VOID iusace_complex_fft_2048(FLOAT32 *ptr_x, FLOAT32 *ptr_scratch_fft);
60 VOID iusace_complex_fft_4096(FLOAT32 *ptr_x_r, FLOAT32 *ptr_x_i, FLOAT32 *ptr_scratch_fft);
61