xref: /aosp_15_r20/external/libxaac/encoder/ixheaace_mps_enc.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 typedef struct {
23   UWORD8 *p_data;
24   UWORD32 data_size;
25   WORD32 data_type;
26   WORD32 associated_ch_element;
27 } ixheaace_mps_enc_ext_payload;
28 
29 IA_ERRORCODE ixheaace_mps_212_initialise(VOID *pstr_mps_enc, const WORD32 audio_object_type,
30                                          const UWORD32 sampling_rate, WORD32 *ptr_bitrate,
31                                          const UWORD32 sbr_ratio, const UWORD32 frame_length,
32                                          const UWORD32 input_buffer_size_per_channel,
33                                          const UWORD32 core_coder_delay, WORD8 *ptr_scratch);
34 
35 IA_ERRORCODE
36 ixheaace_mps_212_process(VOID *pstr_mps_enc, FLOAT32 *const ptr_audio_samples,
37                          const WORD32 num_audio_samples,
38                          ixheaace_mps_enc_ext_payload *pstr_mps_ext_payload);
39 
40 WORD32 ixheaace_mps_212_get_spatial_specific_config(VOID *pstr_mps_enc, WORD8 *ptr_out_buffer,
41                                                     WORD32 buf_size, WORD32 aot);
42 
43 VOID ixheaace_mps_212_open(VOID **pstr_mps_enc, ixheaace_mps_212_memory_struct *pstr_mps_memory);
44 
45 VOID ixheaace_mps_212_close(VOID **pstr_mps_enc);
46 
47 IA_ERRORCODE
48 ixheaace_mps_515_open(VOID **pstr_mps_enc, WORD32 sample_freq, WORD32 tree_config,
49                       ixheaace_bit_buf_handle pstr_bitstream, WORD32 *ptr_bits_written,
50                       ixheaace_mps_515_memory_struct *pstr_mps_memory, WORD32 flag_480);
51 
52 IA_ERRORCODE ixheaace_mps_515_apply(ixheaace_mps_sac_enc *pstr_mps_enc, FLOAT32 *ptr_audio_input,
53                                     FLOAT32 *ptr_audio_output,
54                                     ixheaace_bit_buf_handle pstr_bitstream, VOID *pstr_scratch);
55 
56 VOID ixheaace_mps_515_close(ixheaace_mps_sac_enc *pstr_mps_enc);
57 
58 WORD32 ixheaace_mps_515_scratch_size(VOID);
59