lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/******************************************************************************
 *                                                                            *
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#ifndef IXHEAACD_AACDEC_H
#define IXHEAACD_AACDEC_H
 
#define AAC_DEC_OK IA_ENHAACPLUS_DEC_API_NONFATAL_NO_ERROR
 
#define IA_ENHAACPDEC_NUM_MEMTABS (4)
 
#define FRAME_SIZE 1024
 
#define ADTS_BSFORMAT 2
#define LOAS_BSFORMAT 3
 
typedef struct ia_aac_decoder_struct {
  FLAG frame_status;
  WORD32 byte_align_bits;
  ia_aac_dec_sbr_bitstream_struct *pstr_sbr_bitstream;
  ia_aac_dec_channel_info_struct *pstr_aac_dec_ch_info[CHANNELS];
 
  ia_aac_dec_channel_info *ptr_aac_dec_static_channel_info[CHANNELS];
 
  ia_aac_dec_overlap_info *pstr_aac_dec_overlap_info[CHANNELS];
  ia_pns_rand_vec_struct *pstr_pns_rand_vec_data;
  void *p_ind_channel_info;
  WORD32 block_number;
  WORD16 sampling_rate_index;
  WORD32 sampling_rate;
  WORD32 samples_per_frame;
  WORD16 channels;
  WORD8 num_swb_window[2];
  ia_aac_dec_tables_struct *pstr_aac_tables;
  ixheaacd_misc_tables *pstr_common_tables;
} ia_aac_decoder_struct;
 
struct ia_aac_persistent_struct {
  WORD32 *overlap_buffer;
  ia_aac_dec_overlap_info str_aac_dec_overlap_info[CHANNELS];
  ia_pns_rand_vec_struct str_pns_rand_vec_data;
  struct ia_aac_decoder_struct str_aac_decoder;
  WORD8 *sbr_payload_buffer;
 
  ia_aac_dec_channel_info *ptr_aac_dec_static_channel_info[CHANNELS];
  WORD16 *ltp_buf[CHANNELS];
};
 
typedef struct {
  VOID *base_scr_8k;
  VOID *extra_scr_4k[4];
 
  WORD32 *in_data;
  WORD32 *out_data;
 
} ia_aac_dec_scratch_struct;
 
WORD16 ixheaacd_individual_ch_stream(
    ia_bit_buf_struct *it_bit_buff, ia_aac_decoder_struct *aac_dec_handle,
    WORD32 num_ch, WORD32 frame_size, WORD32 total_channels, WORD32 object_type,
    ia_eld_specific_config_struct eld_specific_config, WORD32 ele_type);
 
VOID ixheaacd_huff_tables_create(ia_aac_dec_tables_struct *);
 
WORD32 ixheaacd_set_aac_persistent_buffers(VOID *aac_persistent_mem_v,
                                           WORD32 channels);
 
VOID ixheaacd_huffman_decode(WORD32 it_bit_buff, WORD16 *h_index, WORD16 *len,
                             const UWORD16 *input_table,
                             const UWORD32 *idx_table);
 
#endif /* #ifndef IXHEAACD_AACDEC_H */