Obtain Loudness Info from MPEG-4/MPEG-D DRC stream
Extend API support to query loudness Info obtained from MPEG-4/MPEG-D DRC stream. Bug: 175435457 Test: atest CtsMediaTestCases:DecoderTest Test: atest CtsMediaTestCases:DecoderTestAacDrc Test: atest CtsMediaTestCases:DecoderTestXheAac Test: atest CtsMediaTestCases:DecoderTestAacFormat Test: atest CtsMediaV2TestCases:CodecDecoderTest
This commit is contained in:
parent
a98bafcb28
commit
f7ec92a2c9
4 changed files with 29 additions and 0 deletions
|
|
@ -108,6 +108,7 @@ IA_ERRORCODE ia_drc_dec_api(pVOID p_ia_drc_dec_obj, WORD32 i_cmd, WORD32 i_idx,
|
|||
pUWORD32 pus_value = pv_value;
|
||||
pWORD8 pb_value = pv_value;
|
||||
SIZE_T *ps_value = pv_value;
|
||||
pWORD32 pi_value = pv_value;
|
||||
|
||||
switch (i_cmd) {
|
||||
case IA_API_CMD_GET_MEM_INFO_SIZE:
|
||||
|
|
@ -269,6 +270,15 @@ IA_ERRORCODE ia_drc_dec_api(pVOID p_ia_drc_dec_obj, WORD32 i_cmd, WORD32 i_idx,
|
|||
*ps_value = (SIZE_T)p_obj_drc->str_payload.pstr_drc_sel_proc_output;
|
||||
break;
|
||||
}
|
||||
case IA_DRC_DEC_CONFIG_DRC_TARGET_LOUDNESS: {
|
||||
*pi_value = p_obj_drc->str_payload.pstr_loudness_info->loudness_info
|
||||
->loudness_measure->method_val;
|
||||
if (*pi_value < -1)
|
||||
*pi_value = *pi_value * -4;
|
||||
else
|
||||
*pi_value = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,6 +406,7 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
|||
p_obj_exhaacplus_dec->aac_config.ui_drc_target_level = 108;
|
||||
p_obj_exhaacplus_dec->aac_config.ui_drc_set = 0;
|
||||
p_obj_exhaacplus_dec->aac_config.ui_flush_cmd = 0;
|
||||
p_obj_exhaacplus_dec->aac_config.output_level = -1;
|
||||
|
||||
p_obj_exhaacplus_dec->aac_config.ui_max_channels = 6;
|
||||
|
||||
|
|
@ -580,6 +581,7 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
|||
|
||||
case IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LEVEL: {
|
||||
p_obj_exhaacplus_dec->aac_config.ui_drc_set = 1;
|
||||
p_obj_exhaacplus_dec->aac_config.i_loud_ref_level = *pui_value_signed;
|
||||
if (*pui_value > 127) {
|
||||
p_obj_exhaacplus_dec->aac_config.ui_drc_target_level = 108;
|
||||
return (IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET);
|
||||
|
|
@ -815,6 +817,10 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
|||
(IA_ENHAACPDEC_NUM_MEMTABS);
|
||||
break;
|
||||
}
|
||||
case IA_API_CMD_GET_LOUDNESS_VAL: {
|
||||
*pui_value = p_obj_exhaacplus_dec->aac_config.output_level;
|
||||
break;
|
||||
}
|
||||
case IA_API_CMD_SET_MEMTABS_PTR: {
|
||||
if (pv_value == NULL) return IA_ENHAACPLUS_DEC_API_FATAL_MEM_ALLOC;
|
||||
memset(pv_value, 0, (sizeof(ia_mem_info_struct) + sizeof(pVOID *)) *
|
||||
|
|
@ -1810,6 +1816,16 @@ IA_ERRORCODE ixheaacd_dec_init(
|
|||
p_state_enhaacplus_dec->s_adts_hdr_present,
|
||||
&p_state_enhaacplus_dec->drc_dummy);
|
||||
|
||||
if (p_state_enhaacplus_dec->pstr_drc_dec->drc_element_found == 1) {
|
||||
if (p_obj_exhaacplus_dec->aac_config.i_loud_ref_level < 0) {
|
||||
p_obj_exhaacplus_dec->aac_config.output_level =
|
||||
p_state_enhaacplus_dec->pstr_drc_dec->prog_ref_level;
|
||||
} else {
|
||||
p_obj_exhaacplus_dec->aac_config.output_level =
|
||||
p_obj_exhaacplus_dec->aac_config.i_loud_ref_level;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&(p_obj_exhaacplus_dec->p_state_aac->pstr_aac_dec_info[ch_idx]
|
||||
->pstr_aac_dec_ch_info[0]
|
||||
->str_ics_info.ltp),
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#define IA_API_CMD_GET_TABLE_INFO_PRIORITY 0x001C
|
||||
#define IA_API_CMD_SET_TABLE_PTR 0x001D
|
||||
#define IA_API_CMD_GET_TABLE_PTR 0x001E
|
||||
#define IA_API_CMD_GET_LOUDNESS_VAL 0x001F
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Ittiam standard API command indices */
|
||||
|
|
|
|||
|
|
@ -137,6 +137,8 @@ typedef struct {
|
|||
WORD32 ui_flush_cmd;
|
||||
|
||||
ia_drc_config drc_config_struct;
|
||||
WORD32 output_level;
|
||||
WORD32 i_loud_ref_level;
|
||||
|
||||
} ia_aac_dec_config_struct;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue