aboutsummaryrefslogtreecommitdiff
path: root/decoder/ixheaacd_struct_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/ixheaacd_struct_def.h')
-rw-r--r--decoder/ixheaacd_struct_def.h96
1 files changed, 66 insertions, 30 deletions
diff --git a/decoder/ixheaacd_struct_def.h b/decoder/ixheaacd_struct_def.h
index d348d99..a098594 100644
--- a/decoder/ixheaacd_struct_def.h
+++ b/decoder/ixheaacd_struct_def.h
@@ -21,30 +21,17 @@
#define IXHEAACD_STRUCT_DEF_H
#include <setjmp.h>
+#include <stdbool.h>
+#include "ixheaacd_peak_limiter_struct_def.h"
-#define MAX_OUTPUT_CHANNELS (8)
-#define MAX_NUM_OTT (1)
-
-#define MAX_ARBITRARY_TREE_LEVELS (2)
-#define MAX_PARAMETER_SETS (8)
-#define MAX_ARBITRARY_TREE_INDEX ((1 << (MAX_ARBITRARY_TREE_LEVELS + 1)) - 1)
-#define MAX_NUM_QMF_BANDS (64)
-#define MAX_NUM_OTT_AT \
- (MAX_OUTPUT_CHANNELS * ((1 << MAX_ARBITRARY_TREE_LEVELS) - 1))
-#define MAX_PARAMETER_BANDS (28)
#define MAX_DECOR_CONFIG_IDX (2)
-
-#define MAX_HYBRID_BANDS (MAX_NUM_QMF_BANDS - 3 + 10)
-
#define MAX_TIME_SLOTS (72)
+#define NUM_MPS_TABLES (13)
-#define MAX_M2_OUTPUT (8)
-#define QMF_BANDS_TO_HYBRID (3)
-#define PROTO_LEN (13)
-#define BUFFER_LEN_LF (PROTO_LEN - 1 + MAX_TIME_SLOTS)
-#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
-#define MAX_TIME_SLOTS (72)
-#define MAX_NO_TIME_SLOTS_DELAY (14)
+#define MAX_PREROLL_FRAME_OFFSET 4
+// max of escapedValue(4, 4, 8) i.e. 2^4 -1 + 2^4 -1 + 2^8 -1;
+#define MAX_PREROLL_SIZE 285
+#define IA_ENHAACPLUS_DEC_MPS_PAYLOAD_SIZE (1024)
typedef struct {
WORD8 element_instance_tag;
@@ -106,7 +93,6 @@ typedef struct {
UWORD32 ui_pce_found_in_hdr;
UWORD32 ui_n_memtabs;
- WORD32 ui_drc_enable;
WORD32 ui_drc_boost;
WORD32 ui_drc_cut;
WORD32 ui_drc_target_level;
@@ -137,7 +123,20 @@ typedef struct {
WORD32 ui_flush_cmd;
ia_drc_config drc_config_struct;
-
+ WORD32 output_level;
+ WORD32 i_loud_ref_level;
+ UWORD8 dup_stereo_flag;
+ WORD32 peak_limiter_off;
+
+ WORD32 mps_present;
+ UWORD32 ui_frame_size;
+ WORD32 ui_enh_sbr;
+ WORD32 ui_hq_esbr;
+ WORD32 ui_enh_sbr_ps;
+ WORD32 ui_usac_flag;
+
+ WORD32 ui_err_conceal;
+ FLAG first_frame;
} ia_aac_dec_config_struct;
typedef struct ia_aac_dec_state_struct {
@@ -180,7 +179,7 @@ typedef struct ia_aac_dec_state_struct {
WORD32 last_frame_ok;
WORD32 i_bytes_consumed;
- WORD16 *coup_ch_output;
+ WORD32 *coup_ch_output;
ia_enhaacplus_dec_ind_cc ind_cc_info;
WORD8 protection_absent;
@@ -222,6 +221,9 @@ typedef struct ia_aac_dec_state_struct {
VOID *ia_audio_specific_config;
ia_mps_dec_state_struct mps_dec_handle;
+ ia_heaac_mps_state_struct heaac_mps_handle;
+ UWORD8 mps_buffer[IA_ENHAACPLUS_DEC_MPS_PAYLOAD_SIZE];
+
UWORD16 *huffman_code_book_scl;
UWORD32 *huffman_code_book_scl_index;
@@ -235,8 +237,25 @@ typedef struct ia_aac_dec_state_struct {
ia_sbr_header_data_struct str_sbr_config;
jmp_buf xaac_jmp_buf;
WORD32 decode_create_done;
+ WORD32 ldmps_present;
WORD32 fatal_err_present;
WORD8 *pers_mem_ptr;
+ UWORD8 preroll_config_present;
+ UWORD8 preroll_config_prev[MAX_PREROLL_SIZE];
+
+ UWORD8 qshift_cnt;
+ WORD8 qshift_adj[16];
+ UWORD32 delay_in_samples;
+ UWORD8 peak_lim_init;
+ ia_peak_limiter_struct peak_limiter;
+ UWORD8 sbr_present;
+ UWORD8 slot_pos;
+ WORD32 mps_header;
+ WORD32 ui_mps_out_bytes;
+ WORD32 drc_config_changed;
+ WORD32 apply_crossfade;
+ WORD32 ec_enable;
+ WORD32 first_frame;
} ia_aac_dec_state_struct;
typedef struct ia_exhaacplus_dec_api_struct {
@@ -256,14 +275,13 @@ typedef struct ia_exhaacplus_dec_api_struct {
WORD32 ixheaacd_aacdec_decodeframe(
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec,
- ia_aac_dec_scratch_struct *aac_scratch_ptrs, WORD16 *time_data,
- FLAG frame_status, WORD *type, WORD *ch_idx, WORD init_flag, WORD channel,
- WORD *element_index_order, WORD skip_full_decode, WORD ch_fac,
- WORD slot_element, WORD max_channels, WORD32 total_channels,
- WORD32 frame_length, WORD32 frame_size, ia_drc_dec_struct *pstr_drc_dec,
- WORD32 object_type, WORD32 ch_config,
+ ia_aac_dec_scratch_struct *aac_scratch_ptrs, VOID *time_data, FLAG frame_status, WORD *type,
+ WORD *ch_idx, WORD init_flag, WORD channel, WORD *element_index_order, WORD skip_full_decode,
+ WORD ch_fac, WORD slot_element, WORD max_channels, WORD32 total_channels, WORD32 frame_length,
+ WORD32 frame_size, ia_drc_dec_struct *pstr_drc_dec, WORD32 object_type, WORD32 ch_config,
ia_eld_specific_config_struct eld_specific_config, WORD16 adtsheader,
- ia_drc_dec_struct *drc_dummy);
+ ia_drc_dec_struct *drc_dummy, WORD32 ldmps_present, UWORD8 *slot_pos, UWORD8 *mps_buffer,
+ WORD32 *mps_header, WORD32 *mps_bytes, WORD32 is_init, WORD32 first_frame);
WORD ixheaacd_get_channel_mask(
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec);
@@ -295,4 +313,22 @@ WORD32 ixheaacd_dec_table_api(
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec, WORD32 i_cmd,
WORD32 i_idx, VOID *pv_value);
+IA_ERRORCODE ixheaacd_aac_mps_init(ia_exhaacplus_dec_api_struct *p_obj_mps_dec,
+ UWORD8 *databuf, WORD32 buffer_size,
+ WORD32 sample_rate);
+
+WORD32 ixheaacd_peak_limiter_init(ia_peak_limiter_struct *peak_limiter, UWORD32 num_channels,
+ UWORD32 sample_rate, FLOAT32 *buffer,
+ UWORD32 *delay_in_samples);
+
+VOID ixheaacd_peak_limiter_process(ia_peak_limiter_struct *peak_limiter, VOID *samples,
+ UWORD32 frame_len, WORD8 *qshift_adj);
+
+VOID ixheaacd_scale_adjust(VOID *samples, UWORD32 frame_len, WORD8 *qshift_adj,
+ WORD num_channels);
+VOID ixheaacd_peak_limiter_process_float(ia_peak_limiter_struct *peak_limiter,
+ FLOAT32 samples[MAX_NUM_CHANNELS][4096],
+ UWORD32 frame_len);
+
+
#endif /* IXHEAACD_STRUCT_DEF_H */