Skip to content

Commit

Permalink
Updated goa_elementId in external inteface bit-stream #82
Browse files Browse the repository at this point in the history
Siginificance:
--------------
- Fixes element id writing to oam external rendering interface stream.

Tests:
------
- Conformance tested for x86 and x64 builds
- Verified the element ID value picked for a pure object file
  and a file with multiple signal groups.
  • Loading branch information
SakethSathuvalli committed Jun 7, 2024
1 parent 604fec5 commit 8310c88
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion decoder/ia_core_coder_decode_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@ IA_ERRORCODE ia_core_coder_dec_ext_ele_proc(VOID *temp_handle, WORD32 *num_chann
mpegh_dec_handle->p_config->ptr_oam_md_bit_buf, 768, 1);
impeghd_write_oam_meta_data_for_ext_ren(
&str_bit_buf, pstr_usac_config, &pstr_dec_data->str_obj_ren_dec_state,
ia_signals_3da, &pstr_dec_data->str_enh_obj_md_frame);
ia_signals_3da, &pstr_dec_data->str_enh_obj_md_frame, &pstr_asc->str_mae_asi);
mpegh_dec_handle->p_config->oam_md_payload_length = (str_bit_buf.cnt_bits + 7) >> 3;
}
if (pstr_usac_config->signals_3d.num_ch != 0)
Expand Down
45 changes: 42 additions & 3 deletions decoder/impeghd_ext_rend_intrfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,32 @@ impeghd_write_gha_prod_meta_data_for_ext_ren(ia_write_bit_buf_struct *pstr_bit_b
}
}

/**
* impeghd_get_goa_ele_id
*
* \brief Returns the appropriate element id for a particular object.
*
* \param [in] pstr_mae_asi pointer to ASI structure
* \param [in] grp group number
* \param [in] obj object number
* \param [in] ele_id_offset element id offset
*
*
*
*/
static WORD16
impeghd_get_goa_ele_id(ia_mae_audio_scene_info *pstr_mae_asi, WORD32 grp, WORD32 obj, WORD32 ele_id_offset)
{
if (pstr_mae_asi->asi_present)
{
pstr_mae_asi->group_definition[grp].metadata_ele_id[obj];
}
else
{
return (ele_id_offset + obj);
}
}

/**
* impeghd_write_downmix_cfg
*
Expand Down Expand Up @@ -511,22 +537,23 @@ IA_ERRORCODE impeghd_write_ch_meta_data_for_ext_ren(ia_write_bit_buf_struct *pst
* \param [in] pstr_obj_ren_dec_state Pointer to object renderer state struct
* \param [in] pstr_3d_signals Pointer to 3d signals struct
* \param [in] pstr_enh_oam_frm Pointer to oam frame struct
* \param [in] pstr_mae_asi Pointer to ASI structure
*
* \return IA_ERRORCODE Error code
*
*/
IA_ERRORCODE impeghd_write_oam_meta_data_for_ext_ren(
ia_write_bit_buf_struct *pstr_bit_buf, ia_usac_config_struct *pstr_usac_config,
ia_obj_ren_dec_state_struct *pstr_obj_ren_dec_state, ia_signals_3d *pstr_3d_signals,
ia_enh_obj_md_frame_str *pstr_enh_oam_frm)
ia_enh_obj_md_frame_str *pstr_enh_oam_frm, ia_mae_audio_scene_info *pstr_mae_asi)
{
ia_oam_dec_config_struct *pstr_oam_cfg = &pstr_usac_config->obj_md_cfg;
ia_oam_dec_state_struct *pstr_oam_dec_state = &pstr_obj_ren_dec_state->str_obj_md_dec_state;
ia_enh_oam_config_struct *pstr_enh_oam_cfg = &pstr_usac_config->enh_obj_md_cfg;
WORD32 audio_truncation_goa = 0, goa_num_samples = 0;
WORD32 num_frames_goa = (pstr_oam_cfg->cc_frame_length / pstr_oam_cfg->frame_length);
WORD32 num_objects = pstr_oam_dec_state->num_objects;
WORD32 num_ext_elements;
WORD32 num_ext_elements, grp, mae_ele_id_offset = 0;
/* FRAME CONFIGURATION */
impeghd_write_bits_buf(pstr_bit_buf, (pstr_oam_cfg->frame_length >> 6), 6);
impeghd_write_bits_buf(pstr_bit_buf, audio_truncation_goa, 2);
Expand All @@ -535,11 +562,23 @@ IA_ERRORCODE impeghd_write_oam_meta_data_for_ext_ren(
impeghd_write_bits_buf(pstr_bit_buf, goa_num_samples, 13);
}

for (grp = 0; grp < pstr_3d_signals->num_sig_group; grp++)
{
if (SIG_GROUP_TYPE_OBJ == pstr_3d_signals->group_type[grp])
{
break;
}
else
{
mae_ele_id_offset += pstr_3d_signals->num_sig[grp];
}
}

/* OBJECT METADATA */
impeghd_write_bits_buf(pstr_bit_buf, pstr_oam_dec_state->num_objects, 9);
for (WORD32 obj = 0; obj < pstr_oam_dec_state->num_objects; obj++)
{
impeghd_write_bits_buf(pstr_bit_buf, 0, 9); /*goa_element_id[obj]*/
impeghd_write_bits_buf(pstr_bit_buf, impeghd_get_goa_ele_id(pstr_mae_asi, grp, obj, mae_ele_id_offset), 9); /*goa_element_id[obj]*/
impeghd_write_bits_buf(pstr_bit_buf, pstr_oam_cfg->dyn_obj_priority_present, 1);
impeghd_write_bits_buf(pstr_bit_buf, pstr_oam_cfg->uniform_spread_present, 1);

Expand Down
2 changes: 1 addition & 1 deletion decoder/impeghd_ext_rend_intrfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
IA_ERRORCODE impeghd_write_oam_meta_data_for_ext_ren(
ia_write_bit_buf_struct *pstr_bit_buf, ia_usac_config_struct *pstr_usac_cfg,
ia_obj_ren_dec_state_struct *pstr_obj_ren_dec_state, ia_signals_3d *pstr_signals_3d,
ia_enh_obj_md_frame_str *pstr_enh_oam_frm);
ia_enh_obj_md_frame_str *pstr_enh_oam_frm, ia_mae_audio_scene_info *pstr_mae_asi);

IA_ERRORCODE impeghd_write_ch_meta_data_for_ext_ren(ia_write_bit_buf_struct *pstr_bit_buf,
ia_usac_config_struct *pstr_usac_cfg,
Expand Down

0 comments on commit 8310c88

Please sign in to comment.