Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi signal group processing update. #99

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions decoder/ia_core_coder_cnst.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,20 @@
#define CORE_LEFT 0
#define CORE_RIGHT 1

#define MAX_NUM_ELEMENTS 50
#define MAX_NUM_CHANNELS 24
#define MAX_NUM_CHANNELS_LVL1 5
#define MAX_NUM_CHANNELS_LVL2 9
#define MAX_NUM_CHANNELS_LVL3 16
#define MAX_NUM_CHANNELS_LVL1 (10)
#define MAX_NUM_CHANNELS_LVL2 (18)
#define MAX_NUM_CHANNELS_LVL3 (32)
#ifdef LC_LEVEL_4
#define MAX_NUM_CHANNELS_LVL4 (28)
#define MAX_NUM_CHANNELS_LVL4 (56)
#define MAX_NUM_CHANNELS (56)
#define MAX_CORE_CODER_CHANS (56)
#else
#define MAX_NUM_CHANNELS_LVL4 (32)
#define MAX_NUM_CHANNELS (32)
#define MAX_CORE_CODER_CHANS (32)
#endif
#define MAX_NUM_CHANNELS_USAC_LVL2 24

#define MAX_NUM_ELEMENTS (2 * MAX_CORE_CODER_CHANS + (MAX_CORE_CODER_CHANS >> 1))

#define SFB_NUM_MAX ((NSFB_SHORT + 1) * MAX_SHORT_IN_LONG_BLOCK)

Expand Down
31 changes: 19 additions & 12 deletions decoder/ia_core_coder_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@

#include <impeghd_type_def.h>

#define MAX_ELEMENTS_USAC (50)
// MAX_NUM_CHANNELS * 1.5
#define MAX_EXT_ELEMENTS (84)
#ifdef LC_LEVEL_4
// The bit stream extracted value can be 32.
// Currently this is limited to 3 considering:
// Audio Channels, Objects and HOA Transport channels.
#define MAX_NUM_SIGNALGROUPS (28)
#define MAX_NUM_SIGNALGROUPS (32)
/* The multi‐channel coding tool (MCT) shall not employ
* more stereo boxes than 28 for LC profile lvl 4*/
#define MAX_NUM_MC_BOXES (28)
Expand Down Expand Up @@ -404,6 +405,8 @@ typedef struct
{
WORD32 frame_length;
WORD32 cc_frame_length;
WORD32 num_objects;
WORD32 sig_start_id;
FLAG ld_md_coding_present;
FLAG dyn_obj_priority_present;
FLAG uniform_spread_present;
Expand Down Expand Up @@ -431,6 +434,10 @@ typedef struct
UWORD32 group_type[MAX_AUDIO_GROUPS];
UWORD32 num_sig[MAX_AUDIO_GROUPS];
UWORD32 differs_from_ref_layout[MAX_AUDIO_GROUPS];
UWORD32 inactive_signals[MAX_NUM_CHANNELS];
UWORD32 inactive_signal_grp[MAX_AUDIO_GROUPS];
UWORD32 num_grp_objs[MAX_AUDIO_GROUPS];
UWORD32 num_grp_tc[MAX_AUDIO_GROUPS];
UWORD32 num_ch;
UWORD32 num_audio_obj;
UWORD32 num_saoc_transport_ch;
Expand Down Expand Up @@ -507,29 +514,29 @@ typedef struct
{
UWORD32 num_elements;
UWORD32 num_config_extensions;
UWORD32 usac_element_type[MAX_ELEMENTS_USAC];
WORD32 ia_ext_ele_payload_type[MAX_ELEMENTS_USAC];
UWORD32 usac_element_type[MAX_NUM_ELEMENTS];
WORD32 ia_ext_ele_payload_type[MAX_NUM_ELEMENTS];
ia_multichannel_data ia_mcdata[MAX_NUM_SIGNALGROUPS];
UWORD32 ia_ext_element_start;
UWORD32 ia_ext_element_stop;
ia_sfb_info *ia_sfb_info[MAX_TIME_CHANNELS];
WORD32 num_output_chns[MAX_ELEMENTS_USAC];
WORD32 num_output_chns[MAX_NUM_ELEMENTS];
ia_hoa_config_struct str_hoa_config;
WORD32 ele_length_present;
ia_usac_ext_cfg_dmx_cfg dmx_cfg;
WORD32 cicp_idx;
ia_usac_dec_element_config_struct str_usac_element_config[MAX_ELEMENTS_USAC];
ia_usac_dec_element_config_struct str_usac_element_config[MAX_NUM_ELEMENTS];

WORD32 usac_cfg_ext_info_present[MAX_CONFIG_EXTENSIONS];
WORD32 usac_ext_ele_payload_present[MAX_ELEMENTS_USAC];
WORD32 usac_ext_ele_payload_present[MAX_NUM_ELEMENTS];
WORD32 usac_cfg_ext_info_len[MAX_CONFIG_EXTENSIONS];
WORD32 usac_cfg_ext_info_type[MAX_CONFIG_EXTENSIONS];
WORD32 usac_ext_ele_payload_len[MAX_ELEMENTS_USAC];
WORD32 usac_ext_gain_payload_len[MAX_ELEMENTS_USAC];
WORD32 usac_ext_ele_payload_len[MAX_NUM_ELEMENTS];
WORD32 usac_ext_gain_payload_len[MAX_NUM_ELEMENTS];
WORD32 usac_ext_gain_payload_prev_len;
UWORD8 usac_cfg_ext_info_buf[MAX_CONFIG_EXTENSIONS][MAX_EXT_ELE_PAYLOAD];
UWORD8 usac_ext_ele_payload_buf[MAX_ELEMENTS_USAC][MAX_EXT_ELE_PAYLOAD];
UWORD8 usac_ext_gain_payload_buf[MAX_ELEMENTS_USAC][MAX_AUDIO_PREROLLS * MAX_EXT_ELE_PAYLOAD];
UWORD8 usac_ext_ele_payload_buf[MAX_NUM_ELEMENTS][MAX_EXT_ELE_PAYLOAD];
UWORD8 usac_ext_gain_payload_buf[MAX_NUM_ELEMENTS][MAX_AUDIO_PREROLLS * MAX_EXT_ELE_PAYLOAD];
UWORD8 usac_ext_gain_payload_prev_buf[MAX_EXT_ELE_PAYLOAD];
WORD32 loudness_ext_config_present;
WORD32 loudness_ext_config_idx;
Expand Down Expand Up @@ -576,7 +583,7 @@ typedef struct
UINT32 receiver_delay_compensation;
ia_usac_decoder_config_struct str_usac_dec_config;
ia_signals_3d signals_3d;
ia_oam_dec_config_struct obj_md_cfg;
ia_oam_dec_config_struct obj_md_cfg[MAX_AUDIO_GROUPS];
ia_enh_oam_config_struct enh_obj_md_cfg;
ia_drc_config uni_drc_cfg;
ia_drc_params_bs_dec_struct uni_drc_bs_params;
Expand Down
32 changes: 23 additions & 9 deletions decoder/ia_core_coder_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,9 @@ static IA_ERRORCODE ia_core_coder_decode_init(VOID *handle, ia_usac_data_struct
ia_usac_config_struct *ptr_usac_config = &(pstr_stream_config->str_usac_config);
ia_usac_decoder_config_struct *ptr_usac_dec_config =
&(pstr_stream_config->str_usac_config.str_usac_dec_config);
ia_signals_3d *pstr_signals = &ptr_usac_config->signals_3d;

WORD32 sample, ch, element_id = 0, slpd_index = 0, chan = 0,
WORD32 sample, ch, element_id = 0, slpd_index = 0, chan = 0, tot_chan = 0,
num_elements = ptr_usac_dec_config->num_elements, typ;
UWORD32 element_type;

Expand Down Expand Up @@ -322,7 +323,13 @@ static IA_ERRORCODE ia_core_coder_decode_init(VOID *handle, ia_usac_data_struct

case ID_USAC_CPE:
{
if (chan > MAX_NUM_CHANNELS_USAC_LVL2 - 2)
if (pstr_signals->inactive_signals[tot_chan])
{
tot_chan += 2;
break;
}
tot_chan += 2;
if (chan > MAX_NUM_CHANNELS - 2)
return IA_MPEGH_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX;
for (typ = 0; typ < 2; typ++)
{
Expand All @@ -348,8 +355,14 @@ static IA_ERRORCODE ia_core_coder_decode_init(VOID *handle, ia_usac_data_struct
break;
case ID_USAC_LFE:
{
if (pstr_signals->inactive_signals[tot_chan])
{
tot_chan += 1;
break;
}
tot_chan += 1;
/*fix for bug:119118558*/
if (chan > MAX_NUM_CHANNELS_USAC_LVL2 - 1)
if (chan > MAX_NUM_CHANNELS - 1)
return IA_MPEGH_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX;
usac_data->seed_value[chan] = 0x3039;
chan++;
Expand All @@ -358,7 +371,13 @@ static IA_ERRORCODE ia_core_coder_decode_init(VOID *handle, ia_usac_data_struct
break;
case ID_USAC_SCE:
{
if (chan > MAX_NUM_CHANNELS_USAC_LVL2 - 1)
if (pstr_signals->inactive_signals[tot_chan])
{
tot_chan += 1;
break;
}
tot_chan += 1;
if (chan > MAX_NUM_CHANNELS - 1)
return IA_MPEGH_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX;
usac_data->seed_value[chan] = 0x3039;

Expand Down Expand Up @@ -570,11 +589,6 @@ WORD32 ia_core_coder_frm_data_init(ia_audio_specific_config_struct *pstr_audio_c
pstr_dec_data->str_frame_data.str_audio_specific_config.cicp_spk_layout_idx;
}

pstr_dec_data->str_obj_ren_dec_state.str_obj_md_dec_state.num_objects =
pstr_dec_data->str_frame_data.str_audio_specific_config.str_usac_config.signals_3d
.num_audio_obj;
pstr_dec_data->str_obj_ren_dec_state.str_obj_md_dec_state.p_obj_md_cfg =
&pstr_dec_data->str_frame_data.str_audio_specific_config.str_usac_config.obj_md_cfg;

memset(&pstr_dec_data->str_frame_data.str_layer, 0,
sizeof(pstr_dec_data->str_frame_data.str_layer));
Expand Down
Loading