Fix to handle missing checks on error returned am: bcbd383251 am: f98b3e9ee5
Original change: https://android-review.googlesource.com/c/platform/external/libxaac/+/1425108
Change-Id: Ic4aa96be38c5f425ff7145121e61f79f775cbff8
diff --git a/decoder/drc_src/impd_drc_api.c b/decoder/drc_src/impd_drc_api.c
index f7443e1..62df69b 100644
--- a/decoder/drc_src/impd_drc_api.c
+++ b/decoder/drc_src/impd_drc_api.c
@@ -152,16 +152,19 @@
p_obj_drc->p_state->persistent_ptr =
(UWORD8 *)p_obj_drc->pp_mem[IA_DRC_PERSIST_IDX] +
sizeof(ia_drc_state_struct);
- impd_drc_set_struct_pointer(p_obj_drc);
+ error_code = impd_drc_set_struct_pointer(p_obj_drc);
+ if (error_code) return error_code;
break;
}
case IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS: {
- impd_drc_set_default_config(p_obj_drc);
+ error_code = impd_drc_set_default_config(p_obj_drc);
+ if (error_code) return error_code;
break;
}
case IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS: {
- impd_drc_fill_mem_tables(p_obj_drc);
+ error_code = impd_drc_fill_mem_tables(p_obj_drc);
+ if (error_code) return error_code;
break;
}
case IA_CMD_TYPE_INIT_PROCESS: {
diff --git a/decoder/drc_src/impd_drc_bitbuffer.c b/decoder/drc_src/impd_drc_bitbuffer.c
index e623bc8..de9d020 100644
--- a/decoder/drc_src/impd_drc_bitbuffer.c
+++ b/decoder/drc_src/impd_drc_bitbuffer.c
@@ -87,9 +87,8 @@
it_bit_buff->bit_pos = (WORD16)bit_pos;
return no_of_bits;
}
-ia_bit_buf_struct* impd_create_bit_buf(ia_bit_buf_struct* it_bit_buff,
- UWORD8* ptr_bit_buf_base,
- WORD32 bit_buf_size) {
+VOID impd_create_bit_buf(ia_bit_buf_struct* it_bit_buff,
+ UWORD8* ptr_bit_buf_base, WORD32 bit_buf_size) {
it_bit_buff->ptr_bit_buf_base = ptr_bit_buf_base;
it_bit_buff->ptr_bit_buf_end = ptr_bit_buf_base + bit_buf_size - 1;
@@ -100,15 +99,14 @@
it_bit_buff->size = bit_buf_size << 3;
it_bit_buff->error = 0;
- return it_bit_buff;
+ return;
}
-ia_bit_buf_struct* impd_create_init_bit_buf(ia_bit_buf_struct* it_bit_buff,
- UWORD8* ptr_bit_buf_base,
- WORD32 bit_buf_size) {
+VOID impd_create_init_bit_buf(ia_bit_buf_struct* it_bit_buff,
+ UWORD8* ptr_bit_buf_base, WORD32 bit_buf_size) {
impd_create_bit_buf(it_bit_buff, ptr_bit_buf_base, bit_buf_size);
it_bit_buff->cnt_bits = (bit_buf_size << 3);
- return (it_bit_buff);
+ return;
}
WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
@@ -159,8 +157,8 @@
}
}
- err_code = impd_init_tbls(ia_drc_params_struct->num_gain_values_max_default,
- &p_drc_bs_dec_struct->tables_default);
+ impd_init_tbls(ia_drc_params_struct->num_gain_values_max_default,
+ &p_drc_bs_dec_struct->tables_default);
return err_code;
}
@@ -171,8 +169,7 @@
WORD32 num_bytes) {
WORD32 err_code = 0;
- it_bit_buff =
- impd_create_init_bit_buf(it_bit_buff, bitstream_config, num_bytes);
+ impd_create_init_bit_buf(it_bit_buff, bitstream_config, num_bytes);
err_code = impd_parse_drc_config(
it_bit_buff, &p_drc_bs_dec_struct->ia_drc_params_struct, pstr_drc_config);
@@ -190,8 +187,7 @@
WORD32 dummy;
- it_bit_buff =
- impd_create_init_bit_buf(it_bit_buff, bitstream_gain, num_bytes);
+ impd_create_init_bit_buf(it_bit_buff, bitstream_gain, num_bytes);
dummy = impd_read_bits_buf(it_bit_buff, num_bits_offset);
if (it_bit_buff->error) return it_bit_buff->error;
@@ -216,11 +212,9 @@
UWORD8* bit_stream_loudness, WORD32 num_bytes_loudness) {
WORD32 err_code = 0;
- it_bit_buff = impd_create_init_bit_buf(it_bit_buff, bit_stream_loudness,
- num_bytes_loudness);
+ impd_create_init_bit_buf(it_bit_buff, bit_stream_loudness,
+ num_bytes_loudness);
err_code = impd_parse_loudness_info_set(it_bit_buff, pstr_loudness_info);
- if (err_code) return (err_code);
-
- return 0;
+ return err_code;
}
diff --git a/decoder/drc_src/impd_drc_bitbuffer.h b/decoder/drc_src/impd_drc_bitbuffer.h
index 9e29825..bb8d65a 100644
--- a/decoder/drc_src/impd_drc_bitbuffer.h
+++ b/decoder/drc_src/impd_drc_bitbuffer.h
@@ -34,13 +34,11 @@
} ia_bit_buf_struct;
-ia_bit_buf_struct *impd_create_bit_buf(ia_bit_buf_struct *it_bit_buff,
- UWORD8 *ptr_bit_buf_base,
- WORD32 bit_buf_size);
+VOID impd_create_bit_buf(ia_bit_buf_struct *it_bit_buff,
+ UWORD8 *ptr_bit_buf_base, WORD32 bit_buf_size);
-ia_bit_buf_struct *impd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
- UWORD8 *ptr_bit_buf_base,
- WORD32 bit_buf_size);
+VOID impd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
+ UWORD8 *ptr_bit_buf_base, WORD32 bit_buf_size);
WORD32 impd_read_bits_buf(ia_bit_buf_struct *it_bit_buff, WORD no_of_bits);
diff --git a/decoder/drc_src/impd_drc_dec.c b/decoder/drc_src/impd_drc_dec.c
index 32da663..67dff40 100644
--- a/decoder/drc_src/impd_drc_dec.c
+++ b/decoder/drc_src/impd_drc_dec.c
@@ -190,6 +190,7 @@
} else {
err = impd_select_drc_coefficients(drc_config, &drc_coefficients_uni_drc,
&drc_coefficients_selected);
+ if (err) return err;
}
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter]
@@ -341,11 +342,11 @@
ia_filter_banks_struct);
if (err) return (err);
- err = impd_init_overlap_weight(
+ impd_init_overlap_weight(
drc_coefficients_uni_drc,
&(drc_config->str_drc_instruction_str[drc_instructions_selected]),
ia_drc_params_struct->sub_band_domain_mode, pstr_overlap_params);
- if (err) return (err);
+
} else {
ia_gain_modifiers_struct* gain_modifiers =
drc_config->str_drc_instruction_str->str_gain_modifiers_of_ch_group;
diff --git a/decoder/drc_src/impd_drc_dec.h b/decoder/drc_src/impd_drc_dec.h
index dbe0912..fd30f32 100644
--- a/decoder/drc_src/impd_drc_dec.h
+++ b/decoder/drc_src/impd_drc_dec.h
@@ -35,7 +35,7 @@
,
shape_filter_block* shape_filter_block);
-WORD32 impd_apply_gains_and_add(
+VOID impd_apply_gains_and_add(
ia_drc_instructions_struct* pstr_drc_instruction_arr,
const WORD32 drc_instructions_index,
ia_drc_params_struct* ia_drc_params_struct,
diff --git a/decoder/drc_src/impd_drc_extr_delta_coded_info.c b/decoder/drc_src/impd_drc_extr_delta_coded_info.c
index 485e629..babe75c 100644
--- a/decoder/drc_src/impd_drc_extr_delta_coded_info.c
+++ b/decoder/drc_src/impd_drc_extr_delta_coded_info.c
@@ -27,11 +27,11 @@
#include "impd_drc_filter_bank.h"
#include "impd_drc_rom.h"
-WORD32 impd_init_tbls(const WORD32 num_gain_max_values,
- ia_tables_struct* str_tables) {
+VOID impd_init_tbls(const WORD32 num_gain_max_values,
+ ia_tables_struct* str_tables) {
impd_gen_delta_time_code_tbl(num_gain_max_values,
str_tables->delta_time_code_table);
- return (0);
+ return;
}
void impd_get_delta_gain_code_tbl(
diff --git a/decoder/drc_src/impd_drc_extr_delta_coded_info.h b/decoder/drc_src/impd_drc_extr_delta_coded_info.h
index b9954c0..4c28adc 100644
--- a/decoder/drc_src/impd_drc_extr_delta_coded_info.h
+++ b/decoder/drc_src/impd_drc_extr_delta_coded_info.h
@@ -66,8 +66,8 @@
ia_characteristic_node_coordinate_struct characteristicNodeCoordinate[5];
} ia_cicp_node_characteristic_param;
-WORD32
-impd_init_tbls(const WORD32 num_gain_max_values, ia_tables_struct* str_tables);
+VOID impd_init_tbls(const WORD32 num_gain_max_values,
+ ia_tables_struct* str_tables);
void impd_gen_delta_time_code_tbl(
const WORD32 num_gain_max_values,
diff --git a/decoder/drc_src/impd_drc_filter_bank.h b/decoder/drc_src/impd_drc_filter_bank.h
index 331f0b8..da872ac 100644
--- a/decoder/drc_src/impd_drc_filter_bank.h
+++ b/decoder/drc_src/impd_drc_filter_bank.h
@@ -135,16 +135,15 @@
ia_all_pass_cascade_struct* str_all_pass_cascade, WORD32 c, WORD32 size,
FLOAT32* audio_in);
-WORD32
-impd_shape_filt_block_init(
+VOID impd_shape_filt_block_init(
ia_shape_filter_block_params_struct* pstr_shape_filter_block_params,
shape_filter_block* shape_filter_block);
-WORD32
-impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
- shape_filter_block* shape_filter_block);
+VOID impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
+ shape_filter_block* shape_filter_block);
-WORD32 impd_shape_filt_block_time_process(
- shape_filter_block* shape_filter_block, FLOAT32* drc_gain,
- const WORD32 channel, FLOAT32* audio_in, WORD32 start, WORD32 end);
+VOID impd_shape_filt_block_time_process(shape_filter_block* shape_filter_block,
+ FLOAT32* drc_gain, const WORD32 channel,
+ FLOAT32* audio_in, WORD32 start,
+ WORD32 end);
#endif
diff --git a/decoder/drc_src/impd_drc_gain_dec.c b/decoder/drc_src/impd_drc_gain_dec.c
index f3486fe..dc7430f 100644
--- a/decoder/drc_src/impd_drc_gain_dec.c
+++ b/decoder/drc_src/impd_drc_gain_dec.c
@@ -37,11 +37,10 @@
extern const ia_cicp_sigmoid_characteristic_param_struct
pstr_cicp_sigmoid_characteristic_param[];
-WORD32 impd_gain_db_to_lin(ia_interp_params_struct* interp_params_str,
- WORD32 drc_band, FLOAT32 in_param_db_gain,
- FLOAT32 in_param_db_slope,
- FLOAT32* out_param_lin_gain,
- FLOAT32* out_param_lin_slope) {
+VOID impd_gain_db_to_lin(ia_interp_params_struct* interp_params_str,
+ WORD32 drc_band, FLOAT32 in_param_db_gain,
+ FLOAT32 in_param_db_slope, FLOAT32* out_param_lin_gain,
+ FLOAT32* out_param_lin_slope) {
FLOAT32 loc_db_gain = in_param_db_gain;
FLOAT32 gain_ratio = 1.0;
@@ -93,7 +92,7 @@
}
}
}
- return (0);
+ return;
}
WORD32
@@ -191,8 +190,7 @@
return (0);
}
-WORD32
-impd_compressor_io_nodes_inverse(
+VOID impd_compressor_io_nodes_inverse(
ia_split_drc_characteristic_struct* split_drc_characteristic,
FLOAT32 loc_db_gain, FLOAT32* in_level) {
WORD32 n;
@@ -238,7 +236,7 @@
}
}
}
- return (0);
+ return;
}
WORD32
@@ -256,9 +254,9 @@
if (err) return (err);
break;
case CHARACTERISTIC_NODES:
- err = impd_compressor_io_nodes_inverse(split_drc_characteristic_source,
- gain_in_db, &inLevel);
- if (err) return (err);
+ impd_compressor_io_nodes_inverse(split_drc_characteristic_source,
+ gain_in_db, &inLevel);
+
break;
case CHARACTERISTIC_PASS_THRU:
inLevel = gain_in_db;
@@ -534,8 +532,8 @@
return 0;
}
-WORD32
-impd_advance_buf(WORD32 drc_frame_size, ia_gain_buffer_struct* pstr_gain_buf) {
+VOID impd_advance_buf(WORD32 drc_frame_size,
+ ia_gain_buffer_struct* pstr_gain_buf) {
WORD32 n;
ia_interp_buf_struct* buf_interpolation;
@@ -547,7 +545,7 @@
buf_interpolation->lpcm_gains + drc_frame_size,
sizeof(FLOAT32) * (drc_frame_size + MAX_SIGNAL_DELAY));
}
- return (0);
+ return;
}
WORD32
impd_concatenate_segments(WORD32 drc_frame_size, WORD32 drc_band,
@@ -643,9 +641,8 @@
interp_params_str.clipping_flag = 0;
}
- err = impd_advance_buf(ia_drc_params_struct->drc_frame_size,
- &(drc_gain_buffers->pstr_gain_buf[sel_drc_index]));
- if (err) return (err);
+ impd_advance_buf(ia_drc_params_struct->drc_frame_size,
+ &(drc_gain_buffers->pstr_gain_buf[sel_drc_index]));
gainElementIndex = 0;
for (g = 0; g < num_drc_ch_groups; g++) {
@@ -729,7 +726,7 @@
.buf_interpolation[gainElementIndex])
.lpcm_gains +
MAX_SIGNAL_DELAY;
- err = impd_parametric_lim_type_drc_process(
+ impd_parametric_lim_type_drc_process(
p_drc_gain_dec_structs->audio_in_out_buf.audio_in_out_buf,
loudness_normalization_gain_db,
&p_drc_gain_dec_structs->parametricdrc_params
@@ -737,7 +734,7 @@
[parametricDrcInstanceIndex]
.str_parametric_drc_type_lim_params,
lpcm_gains);
- if (err) return (err);
+
} else if (ia_drc_params_struct->sub_band_domain_mode !=
SUBBAND_DOMAIN_MODE_OFF &&
!(p_drc_gain_dec_structs->parametricdrc_params
diff --git a/decoder/drc_src/impd_drc_gain_decoder.c b/decoder/drc_src/impd_drc_gain_decoder.c
index c9d29ea..2a46c44 100644
--- a/decoder/drc_src/impd_drc_gain_decoder.c
+++ b/decoder/drc_src/impd_drc_gain_decoder.c
@@ -50,7 +50,7 @@
if (err_code != IA_NO_ERROR) return (err_code);
- impd_init_parametric_drc(
+ err_code = impd_init_parametric_drc(
p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size, sample_rate,
sub_band_domain_mode, &p_drc_gain_dec_structs->parametricdrc_params);
@@ -309,15 +309,15 @@
for (ch = 0; ch < p_drc_gain_dec_structs->eq_set->audio_num_chan; ch++) {
audio_channel = audio_in_out_buf[ch];
- impd_process_eq_set_time_domain(
+ err_code = impd_process_eq_set_time_domain(
p_drc_gain_dec_structs->eq_set, ch, audio_channel, audio_channel,
p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size);
+ if (err_code) return (err_code);
}
}
- err_code = impd_store_audio_io_buffer_time(
- audio_in_out_buf, &p_drc_gain_dec_structs->audio_in_out_buf);
- if (err_code != IA_NO_ERROR) return (err_code);
+ impd_store_audio_io_buffer_time(audio_in_out_buf,
+ &p_drc_gain_dec_structs->audio_in_out_buf);
if (pstr_drc_config->apply_drc) {
for (sel_drc_index = 0;
@@ -332,9 +332,9 @@
}
if (p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter == 0) {
- err_code = impd_retrieve_audio_io_buffer_time(
+ impd_retrieve_audio_io_buffer_time(
audio_in_out_buf, &p_drc_gain_dec_structs->audio_in_out_buf);
- if (err_code) return (err_code);
+
} else {
for (sel_drc_index = 0;
sel_drc_index <
@@ -357,7 +357,7 @@
&p_drc_gain_dec_structs->ia_filter_banks_struct, passThru);
if (err_code != IA_NO_ERROR) return (err_code);
- err_code = impd_apply_gains_and_add(
+ impd_apply_gains_and_add(
str_drc_instruction_str,
p_drc_gain_dec_structs->ia_drc_params_struct
.sel_drc_array[sel_drc_index]
@@ -368,14 +368,11 @@
p_drc_gain_dec_structs->shape_filter_block,
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio,
audio_in_out_buf, 1);
- if (err_code != IA_NO_ERROR) return (err_code);
}
}
}
- err_code = impd_advance_audio_io_buffer_time(
- &p_drc_gain_dec_structs->audio_in_out_buf);
- if (err_code != IA_NO_ERROR) return (err_code);
+ impd_advance_audio_io_buffer_time(&p_drc_gain_dec_structs->audio_in_out_buf);
return err_code;
}
diff --git a/decoder/drc_src/impd_drc_init.c b/decoder/drc_src/impd_drc_init.c
index 3e0d622..cc6e2ed 100644
--- a/decoder/drc_src/impd_drc_init.c
+++ b/decoder/drc_src/impd_drc_init.c
@@ -381,22 +381,22 @@
pVOID persistent_ptr = p_obj_drc->p_state->persistent_ptr;
- struct ia_bit_buf_struct *it_bit_buff;
-
WORD32 decDownmixIdList[NUM_GAIN_DEC_INSTANCES] = {0, 4};
p_obj_drc->p_state->delay_in_output = 0;
p_obj_drc->str_payload.pstr_selection_proc->first_frame = 1;
- p_obj_drc->pstr_bit_buf = impd_create_init_bit_buf(
- &p_obj_drc->str_bit_buf, p_obj_drc->str_bit_handler.it_bit_buf,
- p_obj_drc->str_bit_handler.num_bytes_bs / 8);
- it_bit_buff = p_obj_drc->pstr_bit_buf;
+ impd_create_init_bit_buf(&p_obj_drc->str_bit_buf,
+ p_obj_drc->str_bit_handler.it_bit_buf,
+ p_obj_drc->str_bit_handler.num_bytes_bs / 8);
+
+ p_obj_drc->pstr_bit_buf = &p_obj_drc->str_bit_buf;
err_code = impd_init_drc_bitstream_dec(
p_obj_drc->str_payload.pstr_bitstream_dec,
p_obj_drc->str_config.sampling_rate, p_obj_drc->str_config.frame_size,
p_obj_drc->str_config.delay_mode, -1, 0);
+ if (err_code != IA_NO_ERROR) return err_code;
for (i = 0; i < NUM_GAIN_DEC_INSTANCES; i++) {
err_code = impd_init_drc_decode(p_obj_drc->str_config.frame_size,
@@ -405,6 +405,7 @@
p_obj_drc->str_config.delay_mode,
p_obj_drc->str_config.sub_band_domain_mode,
p_obj_drc->str_payload.pstr_gain_dec[i]);
+ if (err_code != IA_NO_ERROR) return err_code;
}
err_code = impd_drc_dec_interface_add_effect_type(
@@ -498,6 +499,7 @@
p_obj_drc->str_payload.pstr_gain_dec[i],
p_obj_drc->str_payload.pstr_drc_config,
p_obj_drc->str_payload.pstr_loudness_info, &persistent_ptr);
+ if (err_code) return err_code;
impd_get_parametric_drc_delay(
p_obj_drc->str_payload.pstr_gain_dec[i],
@@ -554,11 +556,12 @@
}
if (p_obj_drc->str_config.peak_limiter) {
- impd_peak_limiter_init(
+ err_code = impd_peak_limiter_init(
p_obj_drc->str_payload.pstr_peak_limiter, DEFAULT_ATTACK_TIME_MS,
DEFAULT_RELEASE_TIME_MS, LIM_DEFAULT_THRESHOLD,
p_obj_drc->str_config.num_ch_out, p_obj_drc->str_config.sampling_rate,
p_obj_drc->str_payload.pstr_peak_limiter->buffer);
+ if (err_code) return (err_code);
}
return IA_NO_ERROR;
diff --git a/decoder/drc_src/impd_drc_loudness_control.c b/decoder/drc_src/impd_drc_loudness_control.c
index eee37d3..c377a24 100644
--- a/decoder/drc_src/impd_drc_loudness_control.c
+++ b/decoder/drc_src/impd_drc_loudness_control.c
@@ -28,7 +28,7 @@
#include "impd_drc_selection_process.h"
#include "impd_drc_filter_bank.h"
#include "impd_drc_rom.h"
-WORD32 impd_signal_peak_level_info(
+VOID impd_signal_peak_level_info(
ia_drc_config* pstr_drc_config,
ia_drc_loudness_info_set_struct* pstr_loudness_info,
ia_drc_instructions_struct* str_drc_instruction_str,
@@ -325,7 +325,7 @@
} else {
*peak_info_count = pre_lim_count;
}
- return (0);
+ return;
}
WORD32
@@ -456,8 +456,8 @@
return (0);
}
-WORD32 impd_overall_loudness_present(ia_loudness_info_struct* loudness_info,
- WORD32* loudness_info_present) {
+VOID impd_overall_loudness_present(ia_loudness_info_struct* loudness_info,
+ WORD32* loudness_info_present) {
WORD32 m;
*loudness_info_present = 0;
@@ -469,7 +469,7 @@
*loudness_info_present = 1;
}
}
- return (0);
+ return;
}
WORD32 impd_check_loud_info(WORD32 loudness_info_count,
@@ -477,14 +477,14 @@
WORD32 requested_dwnmix_id,
WORD32 drc_set_id_requested, WORD32* info_count,
ia_loudness_info_struct* loudness_info_matching[]) {
- WORD32 n, err;
+ WORD32 n;
WORD32 loudness_info_present;
for (n = 0; n < loudness_info_count; n++) {
if (requested_dwnmix_id == loudness_info[n].downmix_id) {
if (drc_set_id_requested == loudness_info[n].drc_set_id) {
- err = impd_overall_loudness_present(&(loudness_info[n]),
- &loudness_info_present);
- if (err) return (err);
+ impd_overall_loudness_present(&(loudness_info[n]),
+ &loudness_info_present);
+
if (loudness_info_present) {
loudness_info_matching[*info_count] = &(loudness_info[n]);
(*info_count)++;
diff --git a/decoder/drc_src/impd_drc_loudness_control.h b/decoder/drc_src/impd_drc_loudness_control.h
index 76acc26..589d995 100644
--- a/decoder/drc_src/impd_drc_loudness_control.h
+++ b/decoder/drc_src/impd_drc_loudness_control.h
@@ -30,16 +30,14 @@
ia_drc_loudness_info_set_struct* pstr_loudness_info,
WORD32 requested_dwnmix_id, WORD32 drc_set_id_requested,
WORD32 eq_set_id_requested, FLOAT32* mixing_level);
-WORD32
-impd_signal_peak_level_info(ia_drc_config* pstr_drc_config,
- ia_drc_loudness_info_set_struct* pstr_loudness_info,
- ia_drc_instructions_struct* str_drc_instruction_str,
- WORD32 requested_dwnmix_id, WORD32 album_mode,
- WORD32 num_compression_eq_count,
- WORD32* num_compression_eq_id,
- WORD32* peak_info_count, WORD32 eq_set_id[],
- FLOAT32 signal_peak_level[],
- WORD32 explicit_peak_information_present[]);
+VOID impd_signal_peak_level_info(
+ ia_drc_config* pstr_drc_config,
+ ia_drc_loudness_info_set_struct* pstr_loudness_info,
+ ia_drc_instructions_struct* str_drc_instruction_str,
+ WORD32 requested_dwnmix_id, WORD32 album_mode,
+ WORD32 num_compression_eq_count, WORD32* num_compression_eq_id,
+ WORD32* peak_info_count, WORD32 eq_set_id[], FLOAT32 signal_peak_level[],
+ WORD32 explicit_peak_information_present[]);
WORD32
impd_extract_loudness_peak_to_average_info(
diff --git a/decoder/drc_src/impd_drc_main_td_process.c b/decoder/drc_src/impd_drc_main_td_process.c
index ccd190e..4354365 100644
--- a/decoder/drc_src/impd_drc_main_td_process.c
+++ b/decoder/drc_src/impd_drc_main_td_process.c
@@ -224,11 +224,8 @@
}
}
- err_code =
- impd_limiter_process(p_obj_drc->str_payload.pstr_peak_limiter,
- output_buffer, p_obj_drc->str_config.frame_size);
-
- if (err_code != IA_NO_ERROR) return err_code;
+ impd_limiter_process(p_obj_drc->str_payload.pstr_peak_limiter,
+ output_buffer, p_obj_drc->str_config.frame_size);
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
diff --git a/decoder/drc_src/impd_drc_multi_band.h b/decoder/drc_src/impd_drc_multi_band.h
index 4d51d80..84d92c0 100644
--- a/decoder/drc_src/impd_drc_multi_band.h
+++ b/decoder/drc_src/impd_drc_multi_band.h
@@ -40,22 +40,19 @@
str_group_overlap_params[CHANNEL_GROUP_COUNT_MAX];
} ia_overlap_params_struct;
-WORD32
-impd_fcenter_norm_sb_init(WORD32 num_subbands, FLOAT32* fcenter_norm_subband);
+VOID impd_fcenter_norm_sb_init(WORD32 num_subbands,
+ FLOAT32* fcenter_norm_subband);
-WORD32
-impd_generate_slope(WORD32 num_subbands, FLOAT32* fcenter_norm_subband,
- FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
- FLOAT32* response);
+VOID impd_generate_slope(WORD32 num_subbands, FLOAT32* fcenter_norm_subband,
+ FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
+ FLOAT32* response);
-WORD32
-impd_generate_overlap_weights(
+VOID impd_generate_overlap_weights(
WORD32 num_drc_bands, WORD32 drc_band_type,
ia_gain_params_struct* gain_params, WORD32 dec_subband_count,
ia_group_overlap_params_struct* pstr_group_overlap_params);
-WORD32
-impd_init_overlap_weight(
+VOID impd_init_overlap_weight(
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
ia_drc_instructions_struct* str_drc_instruction_str,
WORD32 sub_band_domain_mode, ia_overlap_params_struct* pstr_overlap_params);
diff --git a/decoder/drc_src/impd_drc_multiband.c b/decoder/drc_src/impd_drc_multiband.c
index fc60745..fbe89a2 100644
--- a/decoder/drc_src/impd_drc_multiband.c
+++ b/decoder/drc_src/impd_drc_multiband.c
@@ -29,19 +29,18 @@
#include "impd_drc_multi_band.h"
#include "impd_drc_rom.h"
-IA_ERRORCODE impd_fcenter_norm_sb_init(WORD32 num_subbands,
- FLOAT32* fcenter_norm_subband) {
+VOID impd_fcenter_norm_sb_init(WORD32 num_subbands,
+ FLOAT32* fcenter_norm_subband) {
WORD32 s;
for (s = 0; s < num_subbands; s++) {
fcenter_norm_subband[s] = (s + 0.5f) / (2.0f * num_subbands);
}
- return (0);
+ return;
}
-IA_ERRORCODE impd_generate_slope(WORD32 num_sub_bands,
- FLOAT32* fcenter_norm_subband,
- FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
- FLOAT32* response) {
+VOID impd_generate_slope(WORD32 num_sub_bands, FLOAT32* fcenter_norm_subband,
+ FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
+ FLOAT32* response) {
WORD32 i;
FLOAT32 filter_slope = -24.0f;
FLOAT32 inv_log10_2 = 3.32192809f;
@@ -58,18 +57,18 @@
10.0, norm * log10(fcenter_norm_subband[i] / fcross_norm_hi));
}
}
- return (0);
+ return;
}
-IA_ERRORCODE impd_generate_overlap_weights(
+VOID impd_generate_overlap_weights(
WORD32 num_drc_bands, WORD32 drc_band_type,
ia_gain_params_struct* gain_params, WORD32 dec_subband_count,
ia_group_overlap_params_struct* pstr_group_overlap_params) {
FLOAT32 fcenter_norm_subband[AUDIO_CODEC_SUBBAND_COUNT_MAX];
FLOAT32 w_norm[AUDIO_CODEC_SUBBAND_COUNT_MAX];
FLOAT32 fcross_norm_lo, fcross_norm_hi;
- WORD32 err, b, s, start_subband_index = 0, stop_sub_band_index = 0;
- err = impd_fcenter_norm_sb_init(dec_subband_count, fcenter_norm_subband);
+ WORD32 b, s, start_subband_index = 0, stop_sub_band_index = 0;
+ impd_fcenter_norm_sb_init(dec_subband_count, fcenter_norm_subband);
if (drc_band_type == 1) {
fcross_norm_lo = 0.0f;
@@ -124,15 +123,15 @@
}
}
- return (0);
+ return;
}
-IA_ERRORCODE impd_init_overlap_weight(
+VOID impd_init_overlap_weight(
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
ia_drc_instructions_struct* str_drc_instruction_str,
WORD32 sub_band_domain_mode,
ia_overlap_params_struct* pstr_overlap_params) {
- WORD32 err = 0, g;
+ WORD32 g;
WORD32 dec_subband_count = 0;
switch (sub_band_domain_mode) {
case SUBBAND_DOMAIN_MODE_QMF64:
@@ -148,7 +147,7 @@
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
if (str_drc_instruction_str->band_count_of_ch_group[g] > 1) {
- err = impd_generate_overlap_weights(
+ impd_generate_overlap_weights(
str_drc_instruction_str->band_count_of_ch_group[g],
str_p_loc_drc_coefficients_uni_drc
->gain_set_params[str_drc_instruction_str
@@ -160,9 +159,8 @@
.gain_params,
dec_subband_count,
&(pstr_overlap_params->str_group_overlap_params[g]));
- if (err) return (err);
}
}
- return (0);
+ return;
}
diff --git a/decoder/drc_src/impd_drc_parametric_dec.c b/decoder/drc_src/impd_drc_parametric_dec.c
index 3b2063c..4a42fd6 100644
--- a/decoder/drc_src/impd_drc_parametric_dec.c
+++ b/decoder/drc_src/impd_drc_parametric_dec.c
@@ -478,9 +478,9 @@
}
}
- impd_init_parametric_drcInstance(pstr_drc_config, instance_idx,
- ch_count_from_dwnmix_id,
- p_parametricdrc_params, mem_ptr);
+ err = impd_init_parametric_drcInstance(pstr_drc_config, instance_idx,
+ ch_count_from_dwnmix_id,
+ p_parametricdrc_params, mem_ptr);
if (err) return (err);
}
@@ -1027,7 +1027,7 @@
return 0;
}
-WORD32 impd_parametric_lim_type_drc_process(
+VOID impd_parametric_lim_type_drc_process(
FLOAT32* samples[], FLOAT32 loudness_normalization_gain_db,
ia_parametric_drc_type_lim_params_struct*
pstr_parametric_lim_type_drc_params,
@@ -1102,5 +1102,5 @@
pstr_parametric_lim_type_drc_params->cor = gain_modified;
pstr_parametric_lim_type_drc_params->smooth_state_0 = pre_smoothed_gain;
- return 0;
+ return;
}
diff --git a/decoder/drc_src/impd_drc_peak_limiter.c b/decoder/drc_src/impd_drc_peak_limiter.c
index 2b013f7..8930279 100644
--- a/decoder/drc_src/impd_drc_peak_limiter.c
+++ b/decoder/drc_src/impd_drc_peak_limiter.c
@@ -62,7 +62,7 @@
return 0;
}
-WORD32 impd_peak_limiter_reinit(ia_drc_peak_limiter_struct *peak_limiter) {
+VOID impd_peak_limiter_reinit(ia_drc_peak_limiter_struct *peak_limiter) {
if (peak_limiter) {
peak_limiter->delayed_input_index = 0;
peak_limiter->pre_smoothed_gain = 1.0f;
@@ -75,11 +75,11 @@
sizeof(FLOAT32));
}
- return 0;
+ return;
}
-WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter,
- FLOAT32 *samples, UWORD32 frame_len) {
+VOID impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter,
+ FLOAT32 *samples, UWORD32 frame_len) {
UWORD32 i, j;
FLOAT32 tmp, gain;
FLOAT32 min_gain = 1;
@@ -177,5 +177,5 @@
peak_limiter->pre_smoothed_gain = pre_smoothed_gain;
peak_limiter->min_gain = min_gain;
- return 0;
+ return;
}
diff --git a/decoder/drc_src/impd_drc_peak_limiter.h b/decoder/drc_src/impd_drc_peak_limiter.h
index d4ba07f..9e3aea1 100644
--- a/decoder/drc_src/impd_drc_peak_limiter.h
+++ b/decoder/drc_src/impd_drc_peak_limiter.h
@@ -47,7 +47,7 @@
FLOAT32 limit_threshold, UWORD32 num_channels,
UWORD32 sample_rate, FLOAT32 *buffer);
-WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter,
- FLOAT32 *samples, UWORD32 frame_len);
+VOID impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter,
+ FLOAT32 *samples, UWORD32 frame_len);
#endif
diff --git a/decoder/drc_src/impd_drc_process.c b/decoder/drc_src/impd_drc_process.c
index 45403ac..e4b5147 100644
--- a/decoder/drc_src/impd_drc_process.c
+++ b/decoder/drc_src/impd_drc_process.c
@@ -31,7 +31,7 @@
#include "impd_drc_gain_dec.h"
#include "impd_drc_process_audio.h"
-WORD32 impd_apply_gains_and_add(
+VOID impd_apply_gains_and_add(
ia_drc_instructions_struct* pstr_drc_instruction_arr,
const WORD32 drc_instructions_index,
ia_drc_params_struct* ia_drc_params_struct,
@@ -176,7 +176,7 @@
}
}
- return (0);
+ return;
}
WORD32
@@ -278,9 +278,8 @@
return (0);
}
-WORD32
-impd_store_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
- ia_audio_in_out_buf* audio_io_buf_internal) {
+VOID impd_store_audio_io_buffer_time(
+ FLOAT32* audio_in_out_buf[], ia_audio_in_out_buf* audio_io_buf_internal) {
WORD32 i, j;
if (audio_io_buf_internal->audio_delay_samples) {
@@ -296,12 +295,11 @@
audio_io_buf_internal->audio_in_out_buf = audio_in_out_buf;
}
- return 0;
+ return;
}
-WORD32
-impd_retrieve_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
- ia_audio_in_out_buf* audio_io_buf_internal) {
+VOID impd_retrieve_audio_io_buffer_time(
+ FLOAT32* audio_in_out_buf[], ia_audio_in_out_buf* audio_io_buf_internal) {
WORD32 i, j;
if (audio_io_buf_internal->audio_delay_samples) {
@@ -313,11 +311,11 @@
}
}
- return 0;
+ return;
}
-WORD32
-impd_advance_audio_io_buffer_time(ia_audio_in_out_buf* audio_io_buf_internal) {
+VOID impd_advance_audio_io_buffer_time(
+ ia_audio_in_out_buf* audio_io_buf_internal) {
WORD32 i;
if (audio_io_buf_internal->audio_delay_samples) {
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
@@ -329,5 +327,5 @@
}
}
- return 0;
+ return;
}
diff --git a/decoder/drc_src/impd_drc_process_audio.h b/decoder/drc_src/impd_drc_process_audio.h
index 2b1f6d5..c7be5b2 100644
--- a/decoder/drc_src/impd_drc_process_audio.h
+++ b/decoder/drc_src/impd_drc_process_audio.h
@@ -54,22 +54,22 @@
ia_filter_banks_struct* ia_filter_banks_struct,
const WORD32 passThru);
-WORD32
-impd_store_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
- ia_audio_in_out_buf* audio_io_buf_internal);
+VOID impd_store_audio_io_buffer_time(
+ FLOAT32* audio_in_out_buf[], ia_audio_in_out_buf* audio_io_buf_internal);
-WORD32
-impd_store_audio_io_buffer_freq(FLOAT32* audio_real_buff[],
- FLOAT32* audio_imag_buff[],
- ia_audio_in_out_buf* audio_io_buf_internal);
+VOID impd_store_audio_io_buffer_freq(
+ FLOAT32* audio_real_buff[], FLOAT32* audio_imag_buff[],
+ ia_audio_in_out_buf* audio_io_buf_internal);
-WORD32
-impd_retrieve_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
- ia_audio_in_out_buf* audio_io_buf_internal);
+VOID impd_retrieve_audio_io_buffer_time(
+ FLOAT32* audio_in_out_buf[], ia_audio_in_out_buf* audio_io_buf_internal);
-WORD32
-impd_advance_audio_io_buffer_time(ia_audio_in_out_buf* audio_io_buf_internal);
+VOID impd_retrieve_audio_buffer_freq(
+ FLOAT32* audio_real_buff[], FLOAT32* audio_imag_buff[],
+ ia_audio_in_out_buf* audio_io_buf_internal);
+VOID impd_advance_audio_io_buffer_time(
+ ia_audio_in_out_buf* audio_io_buf_internal);
#ifdef __cplusplus
}
diff --git a/decoder/drc_src/impd_drc_sel_proc_drc_set_sel.h b/decoder/drc_src/impd_drc_sel_proc_drc_set_sel.h
index 6c96751..0a83b74 100644
--- a/decoder/drc_src/impd_drc_sel_proc_drc_set_sel.h
+++ b/decoder/drc_src/impd_drc_sel_proc_drc_set_sel.h
@@ -167,8 +167,7 @@
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
-WORD32
-impd_drc_sel_proc_init_interface_params(
+VOID impd_drc_sel_proc_init_interface_params(
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
ia_drc_interface_struct* pstr_drc_interface);
diff --git a/decoder/drc_src/impd_drc_selection_process.c b/decoder/drc_src/impd_drc_selection_process.c
index ac24a40..fa84ff1 100644
--- a/decoder/drc_src/impd_drc_selection_process.c
+++ b/decoder/drc_src/impd_drc_selection_process.c
@@ -59,9 +59,8 @@
pstr_drc_uni_sel_proc->eq_set_id_valid_flag[i] = 0;
}
}
- err = impd_drc_sel_proc_init_interface_params(pstr_drc_uni_sel_proc,
- pstr_drc_interface);
- if (err) return (err);
+ impd_drc_sel_proc_init_interface_params(pstr_drc_uni_sel_proc,
+ pstr_drc_interface);
pstr_drc_uni_sel_proc->subband_domain_mode = subband_domain_mode;
@@ -950,9 +949,10 @@
} else {
complexityPerCoeff = 2.0f;
}
- impd_find_downmix(pstr_drc_config,
- uni_drc_sel_proc_output->active_downmix_id,
- &dwnmix_instructions);
+ err = impd_find_downmix(pstr_drc_config,
+ uni_drc_sel_proc_output->active_downmix_id,
+ &dwnmix_instructions);
+ if (err) return (err);
if (dwnmix_instructions->downmix_coefficients_present == 1) {
for (i = 0; i < uni_drc_sel_proc_output->base_channel_count; i++) {
for (j = 0; j < uni_drc_sel_proc_output->target_channel_count; j++) {
diff --git a/decoder/drc_src/impd_drc_selection_process_drcset_selection.c b/decoder/drc_src/impd_drc_selection_process_drcset_selection.c
index 3cd5ad5..b80d71f 100644
--- a/decoder/drc_src/impd_drc_selection_process_drcset_selection.c
+++ b/decoder/drc_src/impd_drc_selection_process_drcset_selection.c
@@ -786,14 +786,13 @@
if (loudness_info_count > MAX_LOUDNESS_INFO_COUNT)
return UNEXPECTED_ERROR;
- err = impd_signal_peak_level_info(
+ impd_signal_peak_level_info(
pstr_drc_config, pstr_loudness_info, str_drc_instruction_str,
requested_dwnmix_id[d],
pstr_drc_sel_proc_params_struct->album_mode,
num_compression_eq_count, num_compression_eq_id,
&peak_info_count, eq_set_id_Peak, signal_peak_level,
explicit_peak_information_present);
- if (err) return (err);
for (l = 0; l < loudness_info_count; l++) {
WORD32 match_found_flag = 0;
@@ -899,14 +898,13 @@
loudness_normalization_gain_db, loudness);
if (err) return (err);
- err = impd_signal_peak_level_info(
+ impd_signal_peak_level_info(
pstr_drc_config, pstr_loudness_info, str_drc_instruction_str,
requested_dwnmix_id[d],
pstr_drc_sel_proc_params_struct->album_mode,
num_compression_eq_count, num_compression_eq_id,
&peak_info_count, eq_set_id_Peak, signal_peak_level,
explicit_peak_information_present);
- if (err) return (err);
for (l = 0; l < loudness_info_count; l++) {
WORD32 match_found_flag = 0;
WORD32 p;
@@ -1127,10 +1125,11 @@
WORD32 eq_purpose_requested =
pstr_drc_sel_proc_params_struct->eq_set_purpose_request;
- impd_match_eq_set_purpose(pstr_drc_config, eq_purpose_requested,
- eq_set_id_valid_flag, selection_candidate_count,
- selection_candidate_info,
- selection_candidate_info_step_2);
+ err = impd_match_eq_set_purpose(
+ pstr_drc_config, eq_purpose_requested, eq_set_id_valid_flag,
+ selection_candidate_count, selection_candidate_info,
+ selection_candidate_info_step_2);
+ if (err) return (err);
}
output_level_min = 10000.0f;
@@ -1528,11 +1527,12 @@
.drc_set_id;
*eq_set_id_selected = selection_candidate_info[0].eq_set_id;
- impd_select_loud_eq(
+ err = impd_select_loud_eq(
pstr_drc_config,
pstr_drc_sel_proc_params_struct->requested_dwnmix_id
[selection_candidate_info[0].downmix_id_request_index],
*drc_set_id_selected, *eq_set_id_selected, loud_eq_id_sel);
+ if (err) return (err);
if (selection_candidate_count > 0) {
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output
.loudness_normalization_gain_db =
diff --git a/decoder/drc_src/impd_drc_selection_process_init.c b/decoder/drc_src/impd_drc_selection_process_init.c
index 1cb234a..4a1ae63 100644
--- a/decoder/drc_src/impd_drc_selection_process_init.c
+++ b/decoder/drc_src/impd_drc_selection_process_init.c
@@ -127,8 +127,7 @@
return 0;
}
-WORD32
-impd_drc_sel_proc_init_interface_params(
+VOID impd_drc_sel_proc_init_interface_params(
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
ia_drc_interface_struct* pstr_drc_interface) {
WORD32 i, j;
@@ -526,5 +525,5 @@
}
}
- return 0;
+ return;
}
diff --git a/decoder/drc_src/impd_drc_shape_filter.c b/decoder/drc_src/impd_drc_shape_filter.c
index ef16658..b8ca037 100644
--- a/decoder/drc_src/impd_drc_shape_filter.c
+++ b/decoder/drc_src/impd_drc_shape_filter.c
@@ -37,8 +37,8 @@
#include "impd_drc_gain_decoder.h"
#include "impd_drc_rom.h"
-WORD32 impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
- shape_filter_block* shape_filter_block) {
+VOID impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
+ shape_filter_block* shape_filter_block) {
// WORD32 err = 0;
WORD32 i;
FLOAT32 warpedGain, x1, y1;
@@ -99,10 +99,10 @@
shape_filter_block->shape_filter[i].a1 = y1;
}
}
- return (0);
+ return;
}
-WORD32 resetshape_flter_block(shape_filter_block* shape_filter_block) {
+VOID resetshape_flter_block(shape_filter_block* shape_filter_block) {
WORD32 i, c;
shape_filter_block->drc_gain_last = -1.0f;
impd_shape_filt_block_adapt(1.0f, shape_filter_block);
@@ -114,10 +114,10 @@
shape_filter_block->shape_filter[i].audio_out_state_2[c] = 0.0f;
}
}
- return (0);
+ return;
}
-WORD32 impd_shape_filt_block_init(
+VOID impd_shape_filt_block_init(
ia_shape_filter_block_params_struct* shape_flter_block_params,
shape_filter_block* shape_filter_block) {
// WORD32 err = 0;
@@ -235,13 +235,14 @@
}
resetshape_flter_block(shape_filter_block);
shape_filter_block->shape_flter_block_flag = 1;
- return (0);
+ return;
}
-WORD32 impd_shape_filt_block_time_process(
- shape_filter_block* shape_filter_block, FLOAT32* drc_gain,
- const WORD32 channel, FLOAT32* audio_in, WORD32 start, WORD32 end) {
- WORD32 i, j, err = 0;
+VOID impd_shape_filt_block_time_process(shape_filter_block* shape_filter_block,
+ FLOAT32* drc_gain, const WORD32 channel,
+ FLOAT32* audio_in, WORD32 start,
+ WORD32 end) {
+ WORD32 i, j;
FLOAT32 audio_out;
if (shape_filter_block->shape_flter_block_flag) {
@@ -303,5 +304,5 @@
}
}
- return err;
+ return;
}
diff --git a/decoder/drc_src/impd_drc_static_payload.c b/decoder/drc_src/impd_drc_static_payload.c
index 890555c..6eb5a23 100644
--- a/decoder/drc_src/impd_drc_static_payload.c
+++ b/decoder/drc_src/impd_drc_static_payload.c
@@ -1719,12 +1719,10 @@
.num_gain_max_values >
(N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX / 2 - 1))
return (UNEXPECTED_ERROR);
- err = impd_init_tbls(
- str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
- .num_gain_max_values,
- &(str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
- .str_tables));
- if (err) return (err);
+ impd_init_tbls(str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
+ .num_gain_max_values,
+ &(str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
+ .str_tables));
}
gain_sequence_count +=
str_p_loc_drc_coefficients_uni_drc->gain_set_params[i].band_count;
@@ -1899,13 +1897,10 @@
.num_gain_max_values >
(N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX / 2 - 1))
return (UNEXPECTED_ERROR);
-
- err = impd_init_tbls(
- str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
- .num_gain_max_values,
- &(str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
- .str_tables));
- if (err) return (err);
+ impd_init_tbls(str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
+ .num_gain_max_values,
+ &(str_p_loc_drc_coefficients_uni_drc->gain_set_params[i]
+ .str_tables));
}
}
diff --git a/decoder/drc_src/impd_parametric_drc_dec.h b/decoder/drc_src/impd_parametric_drc_dec.h
index 6829246..d4ca172 100644
--- a/decoder/drc_src/impd_parametric_drc_dec.h
+++ b/decoder/drc_src/impd_parametric_drc_dec.h
@@ -179,12 +179,11 @@
pstr_parametric_ffwd_type_drc_params,
ia_spline_nodes_struct* str_spline_nodes);
-WORD32
-impd_parametric_lim_type_drc_process(FLOAT32* audio_in_out_buf[],
- FLOAT32 loudness_normalization_gain_db,
- ia_parametric_drc_type_lim_params_struct*
- pstr_parametric_lim_type_drc_params,
- FLOAT32* lpcm_gains);
+VOID impd_parametric_lim_type_drc_process(
+ FLOAT32* audio_in_out_buf[], FLOAT32 loudness_normalization_gain_db,
+ ia_parametric_drc_type_lim_params_struct*
+ pstr_parametric_lim_type_drc_params,
+ FLOAT32* lpcm_gains);
#ifdef __cplusplus
}
diff --git a/decoder/ixheaacd_aacdecoder.c b/decoder/ixheaacd_aacdecoder.c
index 15dc4bb..6c26d2d 100644
--- a/decoder/ixheaacd_aacdecoder.c
+++ b/decoder/ixheaacd_aacdecoder.c
@@ -402,6 +402,7 @@
error_code = ixheaacd_individual_ch_stream(
it_bit_buff, aac_dec_handle, ele_ch, frame_length,
total_channels, object_type, eld_specific_config, ele_type);
+ if (error_code) return error_code;
if (ptr_adts_crc_info->crc_active == 1) {
ixheaacd_adts_crc_end_reg(ptr_adts_crc_info, it_bit_buff,
@@ -425,13 +426,14 @@
num_ch = num_ch + ele_ch;
break;
} else {
- ixheaacd_channel_pair_process(
+ error_code = ixheaacd_channel_pair_process(
aac_dec_handle->pstr_aac_dec_ch_info, ele_ch,
aac_dec_handle->pstr_aac_tables, total_channels, object_type,
aac_spect_data_resil_flag,
eld_specific_config.aac_sf_data_resil_flag,
aac_scratch_ptrs->in_data, aac_scratch_ptrs->out_data,
(void *)aac_dec_handle);
+ if (error_code) return error_code;
num_ch = num_ch + ele_ch;
}
}
@@ -454,16 +456,16 @@
if (error_code) {
aac_dec_handle->frame_status = 0;
-
- break;
+ return error_code;
} else {
- ixheaacd_channel_pair_process(
+ error_code = ixheaacd_channel_pair_process(
aac_dec_handle->pstr_aac_dec_ch_info, 1,
aac_dec_handle->pstr_aac_tables, total_channels, object_type,
aac_spect_data_resil_flag,
eld_specific_config.aac_sf_data_resil_flag,
aac_scratch_ptrs->in_data, aac_scratch_ptrs->out_data,
(void *)aac_dec_handle);
+ if (error_code) return error_code;
}
} else {
error_code =
@@ -648,7 +650,7 @@
{
if (object_type == AOT_ER_AAC_LD) {
- WORD16 temp = ixheaacd_ltp_decode(
+ IA_ERRORCODE temp = ixheaacd_ltp_decode(
it_bit_buff, ptr_ics_info, object_type,
aac_dec_handle->samples_per_frame, LEFT);
@@ -663,6 +665,7 @@
error_code = ixheaacd_individual_ch_stream(
it_bit_buff, aac_dec_handle, ele_ch, frame_length,
total_channels, object_type, eld_specific_config, ele_type);
+ if (error_code) return error_code;
if (ptr_adts_crc_info->crc_active == 1) {
ixheaacd_adts_crc_end_reg(ptr_adts_crc_info, it_bit_buff,
@@ -686,13 +689,14 @@
num_ch = num_ch + ele_ch;
break;
} else {
- ixheaacd_channel_pair_process(
+ error_code = ixheaacd_channel_pair_process(
aac_dec_handle->pstr_aac_dec_ch_info, ele_ch,
aac_dec_handle->pstr_aac_tables, total_channels, object_type,
aac_spect_data_resil_flag,
eld_specific_config.aac_sf_data_resil_flag,
aac_scratch_ptrs->in_data, aac_scratch_ptrs->out_data,
(void *)aac_dec_handle);
+ if (error_code) return error_code;
num_ch = num_ch + ele_ch;
}
}
@@ -707,7 +711,8 @@
cnt_bits = (frame_size * 8 - bits_decoded);
if (cnt_bits >= 8) {
- ixheaacd_extension_payload(it_bit_buff, cnt_bits);
+ error_code = ixheaacd_extension_payload(it_bit_buff, cnt_bits);
+ if (error_code) return error_code;
}
if (((object_type == AOT_ER_AAC_ELD) ||
@@ -783,9 +788,10 @@
scratch[0] = (WORD32 *)aac_scratch_ptrs->extra_scr_4k[2];
scratch[1] = (WORD32 *)aac_scratch_ptrs->extra_scr_4k[1];
- ixheaacd_drc_map_channels(
+ error_code = ixheaacd_drc_map_channels(
pstr_drc_dec, aac_dec_handle->channels,
aac_dec_handle->pstr_aac_dec_ch_info[0]->str_ics_info.frame_length);
+ if (error_code) return error_code;
for (ch = 0; ch < aac_dec_handle->channels; ch++) {
WORD32 *overlap1 = aac_dec_handle->ptr_aac_dec_static_channel_info[ch]
diff --git a/decoder/ixheaacd_aacpluscheck.c b/decoder/ixheaacd_aacpluscheck.c
index 3029335..8c7266e 100644
--- a/decoder/ixheaacd_aacpluscheck.c
+++ b/decoder/ixheaacd_aacpluscheck.c
@@ -160,6 +160,5 @@
it_bit_buff->cnt_bits -= ((count - 1) << 3);
}
}
- if (it_bit_buff->cnt_bits < 0) ret = -1;
return (ret);
}
diff --git a/decoder/ixheaacd_acelp_bitparse.c b/decoder/ixheaacd_acelp_bitparse.c
index aee2ea8..c5afc8c 100644
--- a/decoder/ixheaacd_acelp_bitparse.c
+++ b/decoder/ixheaacd_acelp_bitparse.c
@@ -50,6 +50,7 @@
#include "ixheaacd_constants.h"
#include "ixheaacd_basic_ops32.h"
#include "ixheaacd_basic_ops40.h"
+#include "ixheaacd_error_standards.h"
WORD32 ixheaacd_get_mode_lpc(WORD32 lpc_set, ia_bit_buf_struct *it_bit_buff,
WORD32 *nk_mode) {
@@ -324,12 +325,14 @@
}
}
-VOID ixheaacd_tcx_coding(ia_usac_data_struct *usac_data, pWORD32 quant,
- WORD32 k, WORD32 first_tcx_flag,
- ia_td_frame_data_struct *pstr_td_frame_data,
- ia_bit_buf_struct *it_bit_buff
+IA_ERRORCODE ixheaacd_tcx_coding(ia_usac_data_struct *usac_data, pWORD32 quant,
+ WORD32 k, WORD32 first_tcx_flag,
+ ia_td_frame_data_struct *pstr_td_frame_data,
+ ia_bit_buf_struct *it_bit_buff
- ) {
+ ) {
+ IA_ERRORCODE err = IA_NO_ERROR;
+
pstr_td_frame_data->noise_factor[k] = ixheaacd_read_bits_buf(it_bit_buff, 3);
pstr_td_frame_data->global_gain[k] = ixheaacd_read_bits_buf(it_bit_buff, 7);
@@ -355,8 +358,11 @@
}
}
- ixheaacd_arith_data(pstr_td_frame_data, quant, usac_data, it_bit_buff,
- (first_tcx_flag), k);
+ err = ixheaacd_arith_data(pstr_td_frame_data, quant, usac_data, it_bit_buff,
+ (first_tcx_flag), k);
+ if (err) return err;
+
+ return IA_NO_ERROR;
}
WORD32 ixheaacd_lpd_channel_stream(ia_usac_data_struct *usac_data,
@@ -437,8 +443,9 @@
pstr_td_frame_data->tcx_lg[k] = 0;
k += 1;
} else {
- ixheaacd_tcx_coding(usac_data, quant, k, first_tcx_flag,
- pstr_td_frame_data, it_bit_buff);
+ err = ixheaacd_tcx_coding(usac_data, quant, k, first_tcx_flag,
+ pstr_td_frame_data, it_bit_buff);
+ if (err) return err;
last_lpd_mode = pstr_td_frame_data->mod[k];
quant += pstr_td_frame_data->tcx_lg[k];
diff --git a/decoder/ixheaacd_acelp_mdct.c b/decoder/ixheaacd_acelp_mdct.c
index 777bf15..e6de7e6 100644
--- a/decoder/ixheaacd_acelp_mdct.c
+++ b/decoder/ixheaacd_acelp_mdct.c
@@ -207,7 +207,8 @@
ixheaacd_pre_twid(ptr_in, ptr_data_r, ptr_data_i, length / 2,
ptr_pre_post_twid);
- ixheaacd_complex_fft(ptr_data_r, ptr_data_i, length / 2, -1, preshift);
+ err = ixheaacd_complex_fft(ptr_data_r, ptr_data_i, length / 2, -1, preshift);
+ if (err) return err;
*preshift += 1;
ixheaacd_post_twid(ptr_data_r, ptr_data_i, ptr_out, length / 2,
diff --git a/decoder/ixheaacd_api.c b/decoder/ixheaacd_api.c
index 0cdf6e7..2a03695 100644
--- a/decoder/ixheaacd_api.c
+++ b/decoder/ixheaacd_api.c
@@ -1129,7 +1129,7 @@
return (size_buffers);
}
-IA_ERRORCODE ixheaacd_fill_aac_mem_tables(
+VOID ixheaacd_fill_aac_mem_tables(
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec) {
ia_mem_info_struct *p_mem_info_aac;
@@ -1232,7 +1232,7 @@
p_mem_info_aac->ui_alignment = 8;
p_mem_info_aac->ui_type = IA_MEMTYPE_OUTPUT;
}
- return IA_NO_ERROR;
+ return;
}
IA_ERRORCODE ixheaacd_dec_table_api(
diff --git a/decoder/ixheaacd_bit_extract.h b/decoder/ixheaacd_bit_extract.h
index 4ee2add..44fb4d2 100644
--- a/decoder/ixheaacd_bit_extract.h
+++ b/decoder/ixheaacd_bit_extract.h
@@ -69,10 +69,10 @@
ia_td_frame_data_struct *pstr_td_frame_data,
ia_bit_buf_struct *it_bit_buff, WORD32 chan);
-VOID ixheaacd_tcx_coding(ia_usac_data_struct *usac_data, WORD32 *quant,
- WORD32 k, WORD32 first_tcx_flag,
- ia_td_frame_data_struct *pstr_td_frame_data,
- ia_bit_buf_struct *it_bit_buff);
+IA_ERRORCODE ixheaacd_tcx_coding(ia_usac_data_struct *usac_data, WORD32 *quant,
+ WORD32 k, WORD32 first_tcx_flag,
+ ia_td_frame_data_struct *pstr_td_frame_data,
+ ia_bit_buf_struct *it_bit_buff);
WORD32 ixheaacd_win_seq_select(WORD32 window_sequence_curr,
WORD32 window_sequence_last);
diff --git a/decoder/ixheaacd_bitbuffer.c b/decoder/ixheaacd_bitbuffer.c
index 4e6468f..8b203d4 100644
--- a/decoder/ixheaacd_bitbuffer.c
+++ b/decoder/ixheaacd_bitbuffer.c
@@ -147,8 +147,8 @@
return ret_val;
}
-UWORD32 ixheaacd_aac_read_byte(UWORD8 **ptr_read_next, WORD32 *bit_pos,
- WORD32 *readword) {
+VOID ixheaacd_aac_read_byte(UWORD8 **ptr_read_next, WORD32 *bit_pos,
+ WORD32 *readword) {
UWORD8 *v = *ptr_read_next;
WORD32 bits_consumed = *bit_pos;
@@ -160,12 +160,11 @@
}
*bit_pos = bits_consumed;
*ptr_read_next = v;
- return 1;
+ return;
}
-UWORD32 ixheaacd_aac_read_byte_corr1(UWORD8 **ptr_read_next,
- WORD32 *ptr_bit_pos, WORD32 *readword,
- UWORD8 *p_bit_buf_end) {
+VOID ixheaacd_aac_read_byte_corr1(UWORD8 **ptr_read_next, WORD32 *ptr_bit_pos,
+ WORD32 *readword, UWORD8 *p_bit_buf_end) {
UWORD8 *v = *ptr_read_next;
WORD32 bits_consumed = *ptr_bit_pos;
WORD32 temp_bit_count = 0;
@@ -181,11 +180,11 @@
}
*ptr_bit_pos = bits_consumed + temp_bit_count;
*ptr_read_next = v;
- return 1;
+ return;
}
-UWORD32 ixheaacd_aac_read_byte_corr(UWORD8 **ptr_read_next, WORD32 *ptr_bit_pos,
- WORD32 *readword, UWORD8 *p_bit_buf_end) {
+VOID ixheaacd_aac_read_byte_corr(UWORD8 **ptr_read_next, WORD32 *ptr_bit_pos,
+ WORD32 *readword, UWORD8 *p_bit_buf_end) {
UWORD8 *v = *ptr_read_next;
WORD32 bits_consumed = *ptr_bit_pos;
@@ -201,7 +200,7 @@
}
*ptr_bit_pos = bits_consumed;
*ptr_read_next = v;
- return 1;
+ return;
}
WORD32 ixheaacd_aac_read_bit(ia_bit_buf_struct *it_bit_buff) {
diff --git a/decoder/ixheaacd_bitbuffer.h b/decoder/ixheaacd_bitbuffer.h
index d029971..f3a23b6 100644
--- a/decoder/ixheaacd_bitbuffer.h
+++ b/decoder/ixheaacd_bitbuffer.h
@@ -100,9 +100,9 @@
UWORD8 *ptr_bit_buf_base,
WORD32 bit_buf_size);
-ia_bit_buf_struct *ixheaacd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
- UWORD8 *ptr_bit_buf_base,
- WORD32 bit_buf_size);
+VOID ixheaacd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
+ UWORD8 *ptr_bit_buf_base,
+ WORD32 bit_buf_size);
WORD32 ixheaacd_read_bits_buf(ia_bit_buf_struct *it_bit_buff, WORD no_of_bits);
@@ -116,15 +116,14 @@
UWORD32 ixheaacd_aac_showbits_32(UWORD8 *ptr_read_next, WORD32 cnt_bits,
WORD32 *increment);
-UWORD32 ixheaacd_aac_read_byte(UWORD8 **ptr_read_next, WORD32 *bit_pos,
- WORD32 *readword);
+VOID ixheaacd_aac_read_byte(UWORD8 **ptr_read_next, WORD32 *bit_pos,
+ WORD32 *readword);
-UWORD32 ixheaacd_aac_read_byte_corr(UWORD8 **ptr_read_next, WORD32 *ptr_bit_pos,
- WORD32 *readword, UWORD8 *p_bit_buf_end);
+VOID ixheaacd_aac_read_byte_corr(UWORD8 **ptr_read_next, WORD32 *ptr_bit_pos,
+ WORD32 *readword, UWORD8 *p_bit_buf_end);
-UWORD32 ixheaacd_aac_read_byte_corr1(UWORD8 **ptr_read_next,
- WORD32 *ptr_bit_pos, WORD32 *readword,
- UWORD8 *p_bit_buf_end);
+VOID ixheaacd_aac_read_byte_corr1(UWORD8 **ptr_read_next, WORD32 *ptr_bit_pos,
+ WORD32 *readword, UWORD8 *p_bit_buf_end);
#define get_no_bits_available(it_bit_buff) ((it_bit_buff)->cnt_bits)
#define ixheaacd_no_bits_read(it_bit_buff) \
diff --git a/decoder/ixheaacd_block.h b/decoder/ixheaacd_block.h
index 52f9484..739116c 100644
--- a/decoder/ixheaacd_block.h
+++ b/decoder/ixheaacd_block.h
@@ -65,14 +65,14 @@
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 object_type);
-WORD16 ixheaacd_read_spectral_data(
+IA_ERRORCODE ixheaacd_read_spectral_data(
ia_bit_buf_struct *it_bit_buff,
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels,
WORD32 frame_size, WORD32 object_type, WORD32 aac_spect_data_resil_flag,
WORD32 aac_sf_data_resil_flag);
-WORD16 ixheaacd_read_section_data(
+IA_ERRORCODE ixheaacd_read_section_data(
ia_bit_buf_struct *it_bit_buff,
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
WORD32 aac_spect_data_resil_flag, WORD32 aac_sect_data_resil_flag,
diff --git a/decoder/ixheaacd_channel.c b/decoder/ixheaacd_channel.c
index 73c5185..ddbe43d 100644
--- a/decoder/ixheaacd_channel.c
+++ b/decoder/ixheaacd_channel.c
@@ -198,7 +198,7 @@
return error_code;
}
-static WORD16 ixheaacd_read_block_data(
+static IA_ERRORCODE ixheaacd_read_block_data(
ia_bit_buf_struct *it_bit_buff,
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels,
@@ -308,10 +308,11 @@
return error_code;
}
-WORD16 ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
- ia_ics_info_struct *ptr_ics_info, WORD32 object_type,
- WORD32 frame_size, WORD32 ch) {
- WORD32 retval = AAC_DEC_OK;
+IA_ERRORCODE ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
+ ia_ics_info_struct *ptr_ics_info,
+ WORD32 object_type, WORD32 frame_size,
+ WORD32 ch) {
+ IA_ERRORCODE retval = AAC_DEC_OK;
if (ptr_ics_info->predictor_data_present) {
if (ch == 0) {
@@ -522,7 +523,7 @@
if ((object_type == AOT_ER_AAC_LD) &&
(aac_dec_handle->pstr_aac_dec_ch_info[LEFT]->common_window) &&
(ele_type == ID_CPE)) {
- WORD16 temp =
+ IA_ERRORCODE temp =
ixheaacd_ltp_decode(it_bit_buff, ptr_ics_info, object_type,
aac_dec_handle->samples_per_frame, 1);
@@ -580,19 +581,21 @@
}
}
-VOID ixheaacd_channel_pair_process(
+IA_ERRORCODE ixheaacd_channel_pair_process(
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[], WORD32 num_ch,
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels,
WORD32 object_type, WORD32 aac_spect_data_resil_flag,
WORD32 aac_sf_data_resil_flag, WORD32 *in_data, WORD32 *out_data,
void *self_ptr) {
WORD32 channel;
+ IA_ERRORCODE err = IA_NO_ERROR;
ia_aac_decoder_struct *self = self_ptr;
if (aac_spect_data_resil_flag &&
((object_type == AOT_ER_AAC_LD) || (object_type == AOT_ER_AAC_ELD))) {
for (channel = 0; channel < num_ch; channel++) {
- ixheaacd_cblock_inv_quant_spect_data(ptr_aac_dec_channel_info[channel],
- ptr_aac_tables);
+ err = ixheaacd_cblock_inv_quant_spect_data(
+ ptr_aac_dec_channel_info[channel], ptr_aac_tables);
+ if (err) return err;
ixheaacd_cblock_scale_spect_data(ptr_aac_dec_channel_info[channel],
ptr_aac_tables, num_ch, object_type,
aac_sf_data_resil_flag);
@@ -665,6 +668,7 @@
NULL);
}
}
+ return err;
}
VOID ixheaacd_set_corr_info(
@@ -722,7 +726,7 @@
}
}
-WORD16 ixheaacd_read_spectral_data(
+IA_ERRORCODE ixheaacd_read_spectral_data(
ia_bit_buf_struct *it_bit_buff,
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels,
@@ -1060,6 +1064,7 @@
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
ia_aac_dec_tables_struct *ptr_aac_tables) {
int window, group, grp_win, band;
+ IA_ERRORCODE err = IA_NO_ERROR;
int sf_bands_transmitted = ptr_aac_dec_channel_info->str_ics_info.max_sfb;
WORD8 *ptr_code_book = ptr_aac_dec_channel_info->ptr_code_book;
const WORD16 *band_offsets = (WORD16 *)ixheaacd_getscalefactorbandoffsets(
@@ -1098,14 +1103,16 @@
if (out1 <= 0) {
out1 = sub_d(temp, out1);
if (out1 > 127) {
- ixheaacd_inv_quant(&out1, ptr_pow_table_Q13);
+ err = ixheaacd_inv_quant(&out1, ptr_pow_table_Q13);
+ if (err) return err;
} else
out1 = ptr_pow_table_Q13[out1];
ptr_spec_coef[i] = -out1;
} else {
if (out1 > 127) {
- ixheaacd_inv_quant(&out1, ptr_pow_table_Q13);
+ err = ixheaacd_inv_quant(&out1, ptr_pow_table_Q13);
+ if (err) return err;
} else
out1 = ptr_pow_table_Q13[out1];
diff --git a/decoder/ixheaacd_channel.h b/decoder/ixheaacd_channel.h
index 0bf1b5e..47b740a 100644
--- a/decoder/ixheaacd_channel.h
+++ b/decoder/ixheaacd_channel.h
@@ -40,7 +40,7 @@
#define LEFT 0
#define RIGHT 1
-VOID ixheaacd_channel_pair_process(
+IA_ERRORCODE ixheaacd_channel_pair_process(
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[], WORD32 num_ch,
ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels,
WORD32 object_type, WORD32 aac_spect_data_resil_flag,
diff --git a/decoder/ixheaacd_channelinfo.h b/decoder/ixheaacd_channelinfo.h
index 1e451c9..b582c0e 100644
--- a/decoder/ixheaacd_channelinfo.h
+++ b/decoder/ixheaacd_channelinfo.h
@@ -332,8 +332,9 @@
WORD8 num_swb_window[2], WORD32 object_type,
WORD32 common_window, WORD32 frame_size);
-WORD16 ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
- ia_ics_info_struct *ptr_ics_info, WORD32 object_type,
- WORD32 frame_size, WORD32 ch);
+IA_ERRORCODE ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
+ ia_ics_info_struct *ptr_ics_info,
+ WORD32 object_type, WORD32 frame_size,
+ WORD32 ch);
#endif /* #ifndef IXHEAACD_CHANNELINFO_H */
diff --git a/decoder/ixheaacd_common_initfuncs.c b/decoder/ixheaacd_common_initfuncs.c
index 88fadcc..d315f1c 100644
--- a/decoder/ixheaacd_common_initfuncs.c
+++ b/decoder/ixheaacd_common_initfuncs.c
@@ -146,12 +146,12 @@
return it_bit_buff;
}
-ia_bit_buf_struct *ixheaacd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
- UWORD8 *ptr_bit_buf_base,
- WORD32 bit_buf_size) {
+VOID ixheaacd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
+ UWORD8 *ptr_bit_buf_base,
+ WORD32 bit_buf_size) {
ixheaacd_create_bit_buf(it_bit_buff, ptr_bit_buf_base, bit_buf_size);
it_bit_buff->cnt_bits = (bit_buf_size << 3);
- return (it_bit_buff);
+ return;
}
VOID ixheaacd_read_bidirection(ia_bit_buf_struct *it_bit_buff,
diff --git a/decoder/ixheaacd_env_calc.h b/decoder/ixheaacd_env_calc.h
index dd2e195..139dae1 100644
--- a/decoder/ixheaacd_env_calc.h
+++ b/decoder/ixheaacd_env_calc.h
@@ -45,7 +45,7 @@
VOID ixheaacd_reset_sbrenvelope_calc(ia_sbr_calc_env_struct *ptr_calc_env);
-WORD32 ixheaacd_derive_lim_band_tbl(
+VOID ixheaacd_derive_lim_band_tbl(
ia_sbr_header_data_struct *ptr_header_data,
const ia_patch_param_struct *p_str_patch_param, WORD16 num_patches,
ixheaacd_misc_tables *pstr_common_tables);
diff --git a/decoder/ixheaacd_env_extr.c b/decoder/ixheaacd_env_extr.c
index dca8171..11d5660 100644
--- a/decoder/ixheaacd_env_extr.c
+++ b/decoder/ixheaacd_env_extr.c
@@ -119,6 +119,7 @@
WORD32 sum_length = 0;
WORD32 length_bits = 4;
UWORD8 pvc_id_bits = PVC_ID_BITS;
+ IA_ERRORCODE err = IA_NO_ERROR;
div_mode = (UWORD8)ixheaacd_read_bits_buf(it_bit_buff, PVC_DIV_MODE_BITS);
ns_mode = (UWORD8)ixheaacd_read_bits_buf(it_bit_buff, PVC_NS_MODE_BITS);
@@ -223,7 +224,7 @@
for (i = 0; i < PVC_NUM_TIME_SLOTS; i++) {
ptr_pvc_data->pvc_id[i] = pvc_id[i];
}
- return 0;
+ return err;
}
static VOID ixheaacd_pvc_env_dtdf_data(
@@ -563,9 +564,10 @@
return 1;
}
-static WORD16 ixheaacd_read_extn_data(
- ia_sbr_header_data_struct *ptr_header_data, ia_ps_dec_struct *ptr_ps_dec,
- ia_bit_buf_struct *it_bit_buff, ia_ps_tables_struct *ps_tables_ptr) {
+static VOID ixheaacd_read_extn_data(ia_sbr_header_data_struct *ptr_header_data,
+ ia_ps_dec_struct *ptr_ps_dec,
+ ia_bit_buf_struct *it_bit_buff,
+ ia_ps_tables_struct *ps_tables_ptr) {
WORD i;
WORD extended_data;
WORD no_bits_left;
@@ -595,7 +597,7 @@
case EXTENSION_ID_PS_CODING:
if (ptr_ps_dec == NULL) {
- return 0;
+ return;
}
if (!(ptr_ps_dec->force_mono || ps_read)) {
@@ -604,7 +606,7 @@
(WORD16)no_bits_left,
ps_tables_ptr));
- if (no_bits_left < 0) return 0;
+ if (no_bits_left < 0) return;
ptr_header_data->channel_mode = PS_STEREO;
ps_read = 1;
@@ -619,11 +621,11 @@
}
}
- if (no_bits_left < 0) return 0;
+ if (no_bits_left < 0) return;
ixheaacd_read_bits_buf(it_bit_buff, no_bits_left);
}
- return 1;
+ return;
}
WORD32 ixheaacd_sbr_read_pvc_sce(ia_sbr_frame_info_data_struct *ptr_frame_data,
@@ -670,8 +672,9 @@
ptr_pvc_data->pvc_mode = ptr_header_data->pvc_mode;
- ixheaacd_read_esbr_pvc_envelope(ptr_pvc_data, it_bit_buff,
- usac_independency_flag);
+ err_code = ixheaacd_read_esbr_pvc_envelope(ptr_pvc_data, it_bit_buff,
+ usac_independency_flag);
+ if (err_code) return err_code;
ixheaacd_read_sbr_noise_floor_data(ptr_header_data, ptr_frame_data,
it_bit_buff, env_extr_tables_ptr);
@@ -685,15 +688,14 @@
ptr_frame_data->coupling_mode = COUPLING_OFF;
- return 0;
+ return err_code;
}
-WORD8 ixheaacd_sbr_read_sce(ia_sbr_header_data_struct *ptr_header_data,
- ia_sbr_frame_info_data_struct *ptr_frame_data,
- ia_ps_dec_struct *ptr_ps_dec,
- ia_bit_buf_struct *it_bit_buff,
- ia_sbr_tables_struct *ptr_sbr_tables,
- WORD audio_object_type) {
+IA_ERRORCODE ixheaacd_sbr_read_sce(
+ ia_sbr_header_data_struct *ptr_header_data,
+ ia_sbr_frame_info_data_struct *ptr_frame_data, ia_ps_dec_struct *ptr_ps_dec,
+ ia_bit_buf_struct *it_bit_buff, ia_sbr_tables_struct *ptr_sbr_tables,
+ WORD audio_object_type) {
WORD32 bit;
WORD32 i;
WORD32 hbe_flag = ptr_header_data->hbe_flag;
@@ -701,6 +703,7 @@
WORD32 usac_flag = ptr_header_data->usac_flag;
ia_env_extr_tables_struct *env_extr_tables_ptr =
ptr_sbr_tables->env_extr_tables_ptr;
+ IA_ERRORCODE err = IA_NO_ERROR;
ptr_frame_data->coupling_mode = COUPLING_OFF;
@@ -711,8 +714,8 @@
if (audio_object_type == AOT_ER_AAC_ELD ||
audio_object_type == AOT_ER_AAC_LD) {
if (ptr_frame_data->eld_sbr_flag == 1) {
- if (!ixheaacd_extract_frame_info_ld(it_bit_buff, ptr_frame_data))
- return 0;
+ err = ixheaacd_extract_frame_info_ld(it_bit_buff, ptr_frame_data);
+ if (err) return err;
}
} else {
if (!ixheaacd_sbr_time_freq_grid_info(it_bit_buff, ptr_frame_data,
@@ -796,16 +799,16 @@
return 1;
}
-WORD8 ixheaacd_sbr_read_cpe(ia_sbr_header_data_struct *ptr_header_data,
- ia_sbr_frame_info_data_struct **ptr_frame_data,
- ia_bit_buf_struct *it_bit_buff,
- ia_sbr_tables_struct *ptr_sbr_tables,
- WORD audio_object_type) {
+IA_ERRORCODE ixheaacd_sbr_read_cpe(
+ ia_sbr_header_data_struct *ptr_header_data,
+ ia_sbr_frame_info_data_struct **ptr_frame_data,
+ ia_bit_buf_struct *it_bit_buff, ia_sbr_tables_struct *ptr_sbr_tables,
+ WORD audio_object_type) {
WORD32 i, k, bit, num_ch = 2;
WORD32 num_if_bands = ptr_header_data->pstr_freq_band_data->num_if_bands;
WORD32 hbe_flag = ptr_header_data->hbe_flag;
WORD32 usac_flag = ptr_header_data->usac_flag;
-
+ IA_ERRORCODE err = IA_NO_ERROR;
ia_env_extr_tables_struct *env_extr_tables_ptr =
ptr_sbr_tables->env_extr_tables_ptr;
bit = ixheaacd_read_bits_buf(it_bit_buff, 1);
@@ -898,8 +901,8 @@
if (audio_object_type == AOT_ER_AAC_ELD ||
audio_object_type == AOT_ER_AAC_LD) {
if (ptr_frame_data[i]->eld_sbr_flag == 1) {
- if (!ixheaacd_extract_frame_info_ld(it_bit_buff, ptr_frame_data[i]))
- return 0;
+ err = ixheaacd_extract_frame_info_ld(it_bit_buff, ptr_frame_data[i]);
+ if (err) return err;
}
} else {
if (!ixheaacd_sbr_time_freq_grid_info(it_bit_buff, ptr_frame_data[i],
@@ -941,13 +944,19 @@
ptr_frame_data[1]->sbr_invf_mode[i] = ptr_frame_data[0]->sbr_invf_mode[i];
}
- ixheaacd_read_sbr_env_data(ptr_header_data, ptr_frame_data[0], it_bit_buff,
- env_extr_tables_ptr, audio_object_type);
+ if (!ixheaacd_read_sbr_env_data(ptr_header_data, ptr_frame_data[0],
+ it_bit_buff, env_extr_tables_ptr,
+ audio_object_type)) {
+ return 0;
+ }
ixheaacd_read_sbr_noise_floor_data(ptr_header_data, ptr_frame_data[0],
it_bit_buff, env_extr_tables_ptr);
- ixheaacd_read_sbr_env_data(ptr_header_data, ptr_frame_data[1], it_bit_buff,
- env_extr_tables_ptr, audio_object_type);
+ if (!ixheaacd_read_sbr_env_data(ptr_header_data, ptr_frame_data[1],
+ it_bit_buff, env_extr_tables_ptr,
+ audio_object_type)) {
+ return 0;
+ }
ixheaacd_read_sbr_noise_floor_data(ptr_header_data, ptr_frame_data[1],
it_bit_buff, env_extr_tables_ptr);
@@ -1323,13 +1332,14 @@
return 1;
}
-int ixheaacd_extract_frame_info_ld(
+IA_ERRORCODE ixheaacd_extract_frame_info_ld(
ia_bit_buf_struct *it_bit_buff,
ia_sbr_frame_info_data_struct *h_frame_data) {
int abs_bord_lead = 0, num_rel_lead = 0, num_rel_trail = 0, bs_num_env = 0,
frame_class, temp, env, k, abs_bord_trail = 0, middle_bord = 0,
bs_num_noise, transient_env_temp = 0, bs_transient_position = 0;
+ IA_ERRORCODE err = IA_NO_ERROR;
WORD16 time_border[MAX_ENVELOPES + 1];
WORD16 time_border_noise[2 + 1];
WORD16 f[MAX_ENVELOPES + 1];
@@ -1449,7 +1459,7 @@
memcpy(v_frame_info->noise_border_vec, time_border_noise,
(bs_num_noise + 1) * sizeof(WORD16));
- return 1;
+ return err;
}
WORD32 ixheaacd_pvc_time_freq_grid_info(
diff --git a/decoder/ixheaacd_env_extr.h b/decoder/ixheaacd_env_extr.h
index d699b5e..32b1421 100644
--- a/decoder/ixheaacd_env_extr.h
+++ b/decoder/ixheaacd_env_extr.h
@@ -119,18 +119,17 @@
} ia_sbr_frame_info_data_struct;
-WORD8 ixheaacd_sbr_read_sce(ia_sbr_header_data_struct *ptr_header_data,
- ia_sbr_frame_info_data_struct *ptr_frame_data,
- ia_ps_dec_struct *ptr_ps_dec,
- ia_bit_buf_struct *it_bit_buff,
- ia_sbr_tables_struct *ptr_sbr_tables,
- WORD audio_object_type);
+IA_ERRORCODE ixheaacd_sbr_read_sce(
+ ia_sbr_header_data_struct *ptr_header_data,
+ ia_sbr_frame_info_data_struct *ptr_frame_data, ia_ps_dec_struct *ptr_ps_dec,
+ ia_bit_buf_struct *it_bit_buff, ia_sbr_tables_struct *ptr_sbr_tables,
+ WORD audio_object_type);
-WORD8 ixheaacd_sbr_read_cpe(ia_sbr_header_data_struct *ptr_header_data,
- ia_sbr_frame_info_data_struct **ptr_frame_data,
- ia_bit_buf_struct *itt_bit_buf,
- ia_sbr_tables_struct *ptr_sbr_tables,
- WORD audio_object_type);
+IA_ERRORCODE ixheaacd_sbr_read_cpe(
+ ia_sbr_header_data_struct *ptr_header_data,
+ ia_sbr_frame_info_data_struct **ptr_frame_data,
+ ia_bit_buf_struct *itt_bit_buf, ia_sbr_tables_struct *ptr_sbr_tables,
+ WORD audio_object_type);
WORD32 ixheaacd_sbr_read_header_data(
ia_sbr_header_data_struct *ptr_sbr_header, ia_bit_buf_struct *it_bit_buf,
@@ -139,8 +138,9 @@
WORD32 ixheaacd_ssc_huff_dec(ia_huffman_data_type h,
ia_bit_buf_struct *it_bit_buff);
-int ixheaacd_extract_frame_info_ld(ia_bit_buf_struct *it_bit_buff,
- ia_sbr_frame_info_data_struct *h_frame_data);
+IA_ERRORCODE ixheaacd_extract_frame_info_ld(
+ ia_bit_buf_struct *it_bit_buff,
+ ia_sbr_frame_info_data_struct *h_frame_data);
WORD32 ixheaacd_pvc_time_freq_grid_info(
ia_bit_buf_struct *it_bit_buff,
diff --git a/decoder/ixheaacd_ext_ch_ele.c b/decoder/ixheaacd_ext_ch_ele.c
index 0bb08e4..f72526d 100644
--- a/decoder/ixheaacd_ext_ch_ele.c
+++ b/decoder/ixheaacd_ext_ch_ele.c
@@ -147,7 +147,7 @@
sizeof(WORD32) * info->bins_per_sbk);
}
-static WORD32 ixheaacd_cplx_pred_data(
+static VOID ixheaacd_cplx_pred_data(
ia_usac_data_struct *usac_data,
ia_usac_tmp_core_coder_struct *pstr_core_coder, WORD32 num_window_groups,
ia_bit_buf_struct *it_bit_buff) {
@@ -251,7 +251,7 @@
}
}
- return 1;
+ return;
}
static WORD32 ixheaacd_read_ms_mask(
@@ -409,15 +409,13 @@
*out, ixheaacd_sat64_32((((WORD64)sum * (WORD64)factor_odd) >> 15)));
}
-static WORD32 ixheaacd_estimate_dmx_im(const WORD32 *dmx_re,
- const WORD32 *dmx_re_prev,
- WORD32 *dmx_im,
- ia_sfb_info_struct *pstr_sfb_info,
- WORD32 window, const WORD32 w_shape,
- const WORD32 prev_w_shape) {
+static VOID ixheaacd_estimate_dmx_im(const WORD32 *dmx_re,
+ const WORD32 *dmx_re_prev, WORD32 *dmx_im,
+ ia_sfb_info_struct *pstr_sfb_info,
+ WORD32 window, const WORD32 w_shape,
+ const WORD32 prev_w_shape) {
WORD32 i;
const WORD16 *mdst_fcoeff_curr, *mdst_fcoeff_prev;
- WORD32 err = 0;
switch (window) {
case ONLY_LONG_SEQUENCE:
@@ -461,10 +459,10 @@
dmx_re += pstr_sfb_info->bins_per_sbk;
dmx_im += pstr_sfb_info->bins_per_sbk;
}
- return err;
+ return;
}
-static WORD32 ixheaacd_cplx_pred_upmixing(
+static VOID ixheaacd_cplx_pred_upmixing(
ia_usac_data_struct *usac_data, WORD32 *l_spec, WORD32 *r_spec,
ia_usac_tmp_core_coder_struct *pstr_core_coder, WORD32 chn) {
ia_sfb_info_struct *pstr_sfb_info = usac_data->pstr_sfb_info[chn];
@@ -473,9 +471,8 @@
WORD32 grp, sfb, grp_len, i = 0, k;
WORD32 *dmx_re_prev = usac_data->dmx_re_prev;
- const WORD32(*alpha_q_re)[SFB_NUM_MAX] = usac_data->alpha_q_re;
- const WORD32(*alpha_q_im)[SFB_NUM_MAX] = usac_data->alpha_q_im;
- WORD32 err = 0;
+ WORD32(*alpha_q_re)[SFB_NUM_MAX] = usac_data->alpha_q_re;
+ WORD32(*alpha_q_im)[SFB_NUM_MAX] = usac_data->alpha_q_im;
UWORD8(*cplx_pred_used)[SFB_NUM_MAX] = usac_data->cplx_pred_used;
@@ -510,11 +507,10 @@
if (pstr_core_coder->complex_coef) {
WORD32 *p_dmx_re_prev =
pstr_core_coder->use_prev_frame ? dmx_re_prev : NULL;
- err = ixheaacd_estimate_dmx_im(dmx_re, p_dmx_re_prev, dmx_im, pstr_sfb_info,
- usac_data->window_sequence[chn],
- usac_data->window_shape[chn],
- usac_data->window_shape_prev[chn]);
- if (err == -1) return err;
+ ixheaacd_estimate_dmx_im(dmx_re, p_dmx_re_prev, dmx_im, pstr_sfb_info,
+ usac_data->window_sequence[chn],
+ usac_data->window_shape[chn],
+ usac_data->window_shape_prev[chn]);
for (grp = 0, i = 0; grp < pstr_sfb_info->num_groups; grp++) {
for (grp_len = 0; grp_len < pstr_sfb_info->group_len[grp]; grp_len++) {
@@ -567,7 +563,7 @@
}
}
- return err;
+ return;
}
static VOID ixheaacd_cplx_prev_mdct_dmx(ia_sfb_info_struct *pstr_sfb_info,
@@ -864,10 +860,9 @@
if (nr_core_coder_channels == 2 && pstr_core_coder->core_mode[0] == 0 &&
pstr_core_coder->core_mode[1] == 0) {
if (pstr_core_coder->ms_mask_present[0] == 3) {
- err_code = ixheaacd_cplx_pred_upmixing(
- usac_data, usac_data->coef_fix[left], usac_data->coef_fix[right],
- pstr_core_coder, left);
- if (err_code == -1) return err_code;
+ ixheaacd_cplx_pred_upmixing(usac_data, usac_data->coef_fix[left],
+ usac_data->coef_fix[right], pstr_core_coder,
+ left);
} else if (pstr_core_coder->ms_mask_present[0] > 0) {
ixheaacd_ms_stereo(
diff --git a/decoder/ixheaacd_fft.c b/decoder/ixheaacd_fft.c
index 1a784bc..0932097 100644
--- a/decoder/ixheaacd_fft.c
+++ b/decoder/ixheaacd_fft.c
@@ -1806,17 +1806,17 @@
return;
}
-VOID ixheaacd_complex_fft(WORD32 *data_r, WORD32 *data_i, WORD32 nlength,
- WORD32 fft_mode, WORD32 *preshift) {
+WORD32 ixheaacd_complex_fft(WORD32 *data_r, WORD32 *data_i, WORD32 nlength,
+ WORD32 fft_mode, WORD32 *preshift) {
if (nlength & (nlength - 1)) {
if ((nlength != 24) && (nlength != 48) && (nlength != 96) &&
(nlength != 192) && (nlength != 384)) {
printf("%d point FFT not supported", nlength);
- exit(0);
+ return IA_FATAL_ERROR;
}
ixheaacd_complex_fft_p3(data_r, data_i, nlength, fft_mode, preshift);
} else
(*ixheaacd_complex_fft_p2)(data_r, data_i, nlength, fft_mode, preshift);
- return;
+ return 0;
}
diff --git a/decoder/ixheaacd_freq_sca.c b/decoder/ixheaacd_freq_sca.c
index efef7b8..f24e344 100644
--- a/decoder/ixheaacd_freq_sca.c
+++ b/decoder/ixheaacd_freq_sca.c
@@ -105,38 +105,9 @@
}
WORD32
-ixheaacd_calc_start_band(WORD32 fs, const WORD32 start_freq,
+ixheaacd_calc_start_band(WORD32 fs_mapped, const WORD32 start_freq,
FLOAT32 upsamp_fac) {
WORD32 k0_min;
- WORD32 fs_mapped = 0;
-
- if (upsamp_fac == 4) {
- fs = fs / 2;
- }
-
- if (fs >= 0 && fs < 18783) {
- fs_mapped = 16000;
- } else if (fs >= 18783 && fs < 23004) {
- fs_mapped = 22050;
- } else if (fs >= 23004 && fs < 27713) {
- fs_mapped = 24000;
- } else if (fs >= 27713 && fs < 35777) {
- fs_mapped = 32000;
- } else if (fs >= 35777 && fs < 42000) {
- fs_mapped = 40000;
- } else if (fs >= 42000 && fs < 46009) {
- fs_mapped = 44100;
- } else if (fs >= 46009 && fs < 55426) {
- fs_mapped = 48000;
- } else if (fs >= 55426 && fs < 75132) {
- fs_mapped = 64000;
- } else if (fs >= 75132 && fs < 92017) {
- fs_mapped = 88200;
- } else if (fs >= 92017) {
- fs_mapped = 96000;
- } else {
- return -1;
- }
if (upsamp_fac == 4) {
if (fs_mapped < 32000) {
@@ -258,11 +229,46 @@
return (result);
}
-void ixheaacd_calc_k0_k2_bands(const WORD32 samp_freq, const WORD32 start_freq,
- const WORD32 stop_freq, FLOAT32 upsamp_fac,
- WORD16 *ptr_k0, WORD16 *ptr_k2) {
+IA_ERRORCODE ixheaacd_calc_k0_k2_bands(const WORD32 samp_freq,
+ const WORD32 start_freq,
+ const WORD32 stop_freq,
+ FLOAT32 upsamp_fac, WORD16 *ptr_k0,
+ WORD16 *ptr_k2) {
+ IA_ERRORCODE err_code = IA_NO_ERROR;
+
+ WORD32 fs_mapped = 0;
+ WORD32 fs = samp_freq;
+
+ if (upsamp_fac == 4) {
+ fs = fs / 2;
+ }
+
+ if (fs >= 0 && fs < 18783) {
+ fs_mapped = 16000;
+ } else if (fs >= 18783 && fs < 23004) {
+ fs_mapped = 22050;
+ } else if (fs >= 23004 && fs < 27713) {
+ fs_mapped = 24000;
+ } else if (fs >= 27713 && fs < 35777) {
+ fs_mapped = 32000;
+ } else if (fs >= 35777 && fs < 42000) {
+ fs_mapped = 40000;
+ } else if (fs >= 42000 && fs < 46009) {
+ fs_mapped = 44100;
+ } else if (fs >= 46009 && fs < 55426) {
+ fs_mapped = 48000;
+ } else if (fs >= 55426 && fs < 75132) {
+ fs_mapped = 64000;
+ } else if (fs >= 75132 && fs < 92017) {
+ fs_mapped = 88200;
+ } else if (fs >= 92017) {
+ fs_mapped = 96000;
+ } else {
+ return -1;
+ }
+
/* Update start_freq struct */
- *ptr_k0 = ixheaacd_calc_start_band(samp_freq, start_freq, upsamp_fac);
+ *ptr_k0 = ixheaacd_calc_start_band(fs_mapped, start_freq, upsamp_fac);
/*Update stop_freq struct */
if (stop_freq < 14) {
@@ -277,9 +283,10 @@
if (*ptr_k2 > 64) {
*ptr_k2 = 64;
}
+ return err_code;
}
-WORD16 ixheaacd_calc_master_frq_bnd_tbl(
+IA_ERRORCODE ixheaacd_calc_master_frq_bnd_tbl(
ia_freq_band_data_struct *pstr_freq_band_data,
ia_sbr_header_data_struct *ptr_header_data,
ixheaacd_misc_tables *pstr_common_tables) {
@@ -297,13 +304,16 @@
WORD16 upsamp_fac = ptr_header_data->upsamp_fac;
WORD16 *f_master_tbl = pstr_freq_band_data->f_master_tbl;
WORD16 num_mf_bands;
+ IA_ERRORCODE err_code = IA_NO_ERROR;
k1 = 0;
incr = 0;
dk = 0;
- ixheaacd_calc_k0_k2_bands(fs, ptr_header_data->start_freq,
- ptr_header_data->stop_freq, upsamp_fac, &k0, &k2);
+ err_code = ixheaacd_calc_k0_k2_bands(fs, ptr_header_data->start_freq,
+ ptr_header_data->stop_freq, upsamp_fac,
+ &k0, &k2);
+ if (err_code) return err_code;
if (k2 > NO_SYNTHESIS_CHANNELS) {
k2 = NO_SYNTHESIS_CHANNELS;
diff --git a/decoder/ixheaacd_func_def.h b/decoder/ixheaacd_func_def.h
index d914cb1..07591f1 100644
--- a/decoder/ixheaacd_func_def.h
+++ b/decoder/ixheaacd_func_def.h
@@ -41,8 +41,8 @@
FLOAT32 fsynth[], WORD32 first_lpd_flag,
WORD32 short_fac_flag, WORD32 bpf_control_info);
-WORD32 ixheaacd_lpd_dec_update(ia_usac_lpd_decoder_handle tddec,
- ia_usac_data_struct *usac_data, WORD32 i_ch);
+VOID ixheaacd_lpd_dec_update(ia_usac_lpd_decoder_handle tddec,
+ ia_usac_data_struct *usac_data, WORD32 i_ch);
VOID ixheaacd_acelp_update(ia_usac_data_struct *usac_data, FLOAT32 signal_out[],
ia_usac_lpd_decoder_handle st);
@@ -72,8 +72,8 @@
VOID ixheaacd_fac_decoding(WORD32 fac_len, WORD32 k, WORD32 *fac_prm,
ia_bit_buf_struct *it_bit_buff);
-VOID ixheaacd_lpc_to_td(FLOAT32 *lpc_coeffs, WORD32 lpc_order,
- FLOAT32 *mdct_gains, WORD32 lg);
+WORD32 ixheaacd_lpc_to_td(FLOAT32 *lpc_coeffs, WORD32 lpc_order,
+ FLOAT32 *mdct_gains, WORD32 lg);
VOID ixheaacd_noise_shaping(FLOAT32 x[], WORD32 lg, WORD32 fdns_npts,
FLOAT32 old_gains[], FLOAT32 new_gains[]);
diff --git a/decoder/ixheaacd_hbe_trans.c b/decoder/ixheaacd_hbe_trans.c
index a79942a..26965ca 100644
--- a/decoder/ixheaacd_hbe_trans.c
+++ b/decoder/ixheaacd_hbe_trans.c
@@ -235,8 +235,9 @@
ptr_hbe_txposer->no_bins * ptr_hbe_txposer->synth_size,
ptr_hbe_txposer->synth_size * sizeof(FLOAT32));
- ixheaacd_real_synth_filt(ptr_hbe_txposer, num_columns, qmf_buf_real,
- qmf_buf_imag);
+ err_code = ixheaacd_real_synth_filt(ptr_hbe_txposer, num_columns,
+ qmf_buf_real, qmf_buf_imag);
+ if (err_code) return err_code;
for (i = 0; i < HBE_OPER_WIN_LEN - 1; i++) {
memcpy(ptr_hbe_txposer->qmf_in_buf[i],
diff --git a/decoder/ixheaacd_headerdecode.c b/decoder/ixheaacd_headerdecode.c
index 2ee7201..425d851 100644
--- a/decoder/ixheaacd_headerdecode.c
+++ b/decoder/ixheaacd_headerdecode.c
@@ -316,7 +316,7 @@
WORD32 ixheaacd_adtsframe(ia_adts_header_struct *adts,
struct ia_bit_buf_struct *it_bit_buff) {
WORD32 tmp;
-
+ IA_ERRORCODE err = IA_NO_ERROR;
WORD32 crc_reg;
ia_adts_crc_info_struct *ptr_adts_crc_info = it_bit_buff->pstr_adts_crc_info;
ptr_adts_crc_info->crc_active = 1;
@@ -324,7 +324,8 @@
ixheaacd_read_bidirection(it_bit_buff, -12);
crc_reg = ixheaacd_adts_crc_start_reg(ptr_adts_crc_info, it_bit_buff,
CRC_ADTS_HEADER_LEN);
- ixheaacd_find_syncword(adts, it_bit_buff);
+ err = ixheaacd_find_syncword(adts, it_bit_buff);
+ if (err) return err;
tmp = ixheaacd_read_bits_buf(it_bit_buff, 10);
@@ -1003,10 +1004,12 @@
(header_len - bytes_taken)) {
ia_adts_header_struct adts_loc = {0};
- handle_bit_buff = ixheaacd_create_init_bit_buf(
+ ixheaacd_create_init_bit_buf(
&it_bit_buff, (UWORD8 *)(buffer + adts.aac_frame_length),
(WORD16)(header_len - bytes_taken - adts.aac_frame_length));
+ handle_bit_buff = &it_bit_buff;
+
adts_loc.sync_word =
(WORD16)ixheaacd_read_bits_buf(handle_bit_buff, 12);
diff --git a/decoder/ixheaacd_imdct.c b/decoder/ixheaacd_imdct.c
index d162cea..08a89fc 100644
--- a/decoder/ixheaacd_imdct.c
+++ b/decoder/ixheaacd_imdct.c
@@ -135,11 +135,12 @@
}
}
-static void ixheaacd_fft_based_imdct(WORD32 *data, WORD32 npoints,
- WORD32 *preshift, WORD32 *tmp_data) {
+static WORD32 ixheaacd_fft_based_imdct(WORD32 *data, WORD32 npoints,
+ WORD32 *preshift, WORD32 *tmp_data) {
WORD32 *data_r;
WORD32 *data_i;
WORD32 nlength = npoints >> 1;
+ WORD32 err = 0;
const WORD32 *cos_ptr;
const WORD32 *sin_ptr;
@@ -164,17 +165,20 @@
}
(*ixheaacd_calc_pre_twid)(data, data_r, data_i, nlength, cos_ptr, sin_ptr);
- ixheaacd_complex_fft(data_r, data_i, nlength, 1, preshift);
+ err = ixheaacd_complex_fft(data_r, data_i, nlength, 1, preshift);
+ if (err) return err;
(*ixheaacd_calc_post_twid)(data, data_r, data_i, nlength, cos_ptr, sin_ptr);
+ return err;
}
#define N_LONG_LEN_MAX 1024
-void ixheaacd_acelp_imdct(WORD32 *imdct_in, WORD32 npoints, WORD8 *qshift,
- WORD32 *tmp_data) {
+WORD32 ixheaacd_acelp_imdct(WORD32 *imdct_in, WORD32 npoints, WORD8 *qshift,
+ WORD32 *tmp_data) {
WORD32 preshift = 0;
WORD32 i;
WORD32 k = (npoints / 2);
+ WORD32 err = 0;
while (((k & 1) == 0) & (k != 1)) {
k = k >> 1;
@@ -188,13 +192,16 @@
preshift++;
}
- ixheaacd_fft_based_imdct(imdct_in, npoints / 2, &preshift, tmp_data);
+ err = ixheaacd_fft_based_imdct(imdct_in, npoints / 2, &preshift, tmp_data);
+ if (err) return err;
preshift += 2;
*qshift -= preshift;
+ return err;
}
-WORD8 ixheaacd_cal_fac_data(ia_usac_data_struct *usac_data, WORD32 i_ch,
- WORD32 n_long, WORD32 lfac, WORD32 *fac_idata) {
+IA_ERRORCODE ixheaacd_cal_fac_data(ia_usac_data_struct *usac_data, WORD32 i_ch,
+ WORD32 n_long, WORD32 lfac,
+ WORD32 *fac_idata, WORD8 *q_fac) {
WORD32 gain_fac, scale, k, *i_aq, itemp = 0, *izir;
WORD32 int_aq[ORDER + 1] = {0};
WORD32 intzir[2 * LEN_FRAME] = {0};
@@ -205,6 +212,7 @@
WORD8 qshift2 = 0;
WORD8 qshift3 = 0;
WORD32 preshift = 0;
+ IA_ERRORCODE err = IA_NO_ERROR;
FLOAT32 *last_lpc = usac_data->lpc_prev[i_ch];
FLOAT32 *acelp_in = usac_data->acelp_in[i_ch];
@@ -273,9 +281,12 @@
x_in[lfac / 2 + k] = fac_data[lfac - 2 * k];
}
- ixheaacd_fr_alias_cnx_fix(x_in, n_long / 4, lfac, i_aq, izir, fac_idata + 16,
- &qshift1, qshift2, qshift3, &preshift, ptr_scratch);
+ err = ixheaacd_fr_alias_cnx_fix(x_in, n_long / 4, lfac, i_aq, izir,
+ fac_idata + 16, &qshift1, qshift2, qshift3,
+ &preshift, ptr_scratch);
+ if (err) return err;
preshift += 4;
+ *q_fac = (qshift1 - preshift);
if (acelp_in != NULL) {
for (k = 0; k < 2 * lfac; k++) {
@@ -283,13 +294,13 @@
ixheaacd_mul32_sh(fac_idata[k + 16], gain_fac, (WORD8)(scale));
}
}
- return (qshift1 - preshift);
+ return IA_NO_ERROR;
}
-static WORD32 ixheaacd_fd_imdct_short(ia_usac_data_struct *usac_data,
- WORD32 i_ch, WORD32 *fac_data_out,
- offset_lengths *ixheaacd_drc_offset,
- WORD8 fac_q) {
+static IA_ERRORCODE ixheaacd_fd_imdct_short(ia_usac_data_struct *usac_data,
+ WORD32 i_ch, WORD32 *fac_data_out,
+ offset_lengths *ixheaacd_drc_offset,
+ WORD8 fac_q) {
FLOAT32 qfac;
WORD32 overlap_data_buf[2 * N_LONG_LEN_MAX] = {0};
WORD32 *window_short, k, *window_short_prev_ptr;
@@ -324,9 +335,10 @@
for (k = 0; k < 8; k++) {
shiftp = input_q;
- ixheaacd_acelp_imdct(p_in_ibuffer + (k * ixheaacd_drc_offset->n_short),
- 2 * ixheaacd_drc_offset->n_short, &shiftp,
- scratch_mem);
+ err_code = ixheaacd_acelp_imdct(
+ p_in_ibuffer + (k * ixheaacd_drc_offset->n_short),
+ 2 * ixheaacd_drc_offset->n_short, &shiftp, scratch_mem);
+ if (err_code) return err_code;
}
max_shift =
@@ -414,10 +426,10 @@
return 0;
}
-static WORD32 ixheaacd_fd_imdct_long(ia_usac_data_struct *usac_data,
- WORD32 i_ch, WORD32 *fac_idata,
- offset_lengths *ixheaacd_drc_offset,
- WORD8 fac_q) {
+static IA_ERRORCODE ixheaacd_fd_imdct_long(ia_usac_data_struct *usac_data,
+ WORD32 i_ch, WORD32 *fac_idata,
+ offset_lengths *ixheaacd_drc_offset,
+ WORD8 fac_q) {
FLOAT32 qfac;
WORD32 *window_long_prev, k, i, *window_short_prev_ptr;
@@ -443,8 +455,9 @@
ixheaacd_normalize(p_in_ibuffer, max_shift, ixheaacd_drc_offset->n_long);
shiftp = max_shift + 6;
- ixheaacd_acelp_imdct(p_in_ibuffer, 2 * ixheaacd_drc_offset->n_long, &shiftp,
- scratch_mem);
+ err_code = ixheaacd_acelp_imdct(p_in_ibuffer, 2 * ixheaacd_drc_offset->n_long,
+ &shiftp, scratch_mem);
+ if (err_code) return err_code;
max_shift =
ixheaacd_calc_max_spectralline(p_in_ibuffer, ixheaacd_drc_offset->n_long);
@@ -518,6 +531,7 @@
WORD32 td_frame_prev = usac_data->td_frame_prev[i_ch];
WORD32 fac_apply = usac_data->fac_data_present[i_ch];
WORD32 window_sequence = usac_data->window_sequence[i_ch];
+ IA_ERRORCODE err = IA_NO_ERROR;
ixheaacd_drc_offset.n_long = usac_data->ccfl;
ixheaacd_drc_offset.n_short = ixheaacd_drc_offset.n_long >> 3;
@@ -540,17 +554,21 @@
ixheaacd_drc_offset.n_trans_ls = ixheaacd_drc_offset.n_short;
}
- if (fac_apply)
- fac_q = ixheaacd_cal_fac_data(usac_data, i_ch, ixheaacd_drc_offset.n_long,
- ixheaacd_drc_offset.lfac, fac_idata);
+ if (fac_apply) {
+ err = ixheaacd_cal_fac_data(usac_data, i_ch, ixheaacd_drc_offset.n_long,
+ ixheaacd_drc_offset.lfac, fac_idata, &fac_q);
+ if (err) return err;
+ }
- if (window_sequence != EIGHT_SHORT_SEQUENCE)
- ixheaacd_fd_imdct_long(usac_data, i_ch, fac_idata, &ixheaacd_drc_offset,
- fac_q);
+ if (window_sequence != EIGHT_SHORT_SEQUENCE) {
+ err = ixheaacd_fd_imdct_long(usac_data, i_ch, fac_idata,
+ &ixheaacd_drc_offset, fac_q);
+ if (err) return err;
+ } else {
+ err = ixheaacd_fd_imdct_short(usac_data, i_ch, fac_idata,
+ &ixheaacd_drc_offset, fac_q);
+ if (err) return err;
+ }
- else
- ixheaacd_fd_imdct_short(usac_data, i_ch, fac_idata, &ixheaacd_drc_offset,
- fac_q);
-
- return 0;
+ return err;
}
diff --git a/decoder/ixheaacd_longblock.c b/decoder/ixheaacd_longblock.c
index 432e3db..1f41387 100644
--- a/decoder/ixheaacd_longblock.c
+++ b/decoder/ixheaacd_longblock.c
@@ -58,7 +58,7 @@
#define LONG_BLOCK_SECT_LEN 5
#define SHORT_BLOCK_SECT_LEN 3
-WORD16 ixheaacd_read_section_data(
+IA_ERRORCODE ixheaacd_read_section_data(
ia_bit_buf_struct *it_bit_buff,
ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
WORD32 aac_spect_data_resil_flag, WORD32 aac_sect_data_resil_flag,
diff --git a/decoder/ixheaacd_lpc.c b/decoder/ixheaacd_lpc.c
index 0dec734..6bbb902 100644
--- a/decoder/ixheaacd_lpc.c
+++ b/decoder/ixheaacd_lpc.c
@@ -517,8 +517,9 @@
ixheaacd_interpolation_lsp_params(st->lspold, lsp_curr, lp_flt_coff_a,
num_subfr);
- ixheaacd_acelp_alias_cnx(usac_data, pstr_td_frame_data, k, lp_flt_coff_a,
- stability_factor, st);
+ err = ixheaacd_acelp_alias_cnx(usac_data, pstr_td_frame_data, k,
+ lp_flt_coff_a, stability_factor, st);
+ if (err) return err;
if ((st->mode_prev != 0) && bpf_control_info) {
i = (k * num_subfr) + num_subfr_by2;
@@ -545,8 +546,9 @@
ixheaacd_lpc_coef_gen(st->lspold, lsp_curr, lp_flt_coff_a, n_subfr,
ORDER);
- ixheaacd_tcx_mdct(usac_data, pstr_td_frame_data, k, lp_flt_coff_a,
- subfr_len, st);
+ err = ixheaacd_tcx_mdct(usac_data, pstr_td_frame_data, k, lp_flt_coff_a,
+ subfr_len, st);
+ if (err) return err;
k += (1 << (mode - 1));
}
@@ -608,9 +610,9 @@
return err;
}
-WORD32 ixheaacd_lpd_dec_update(ia_usac_lpd_decoder_handle tddec,
- ia_usac_data_struct *usac_data, WORD32 i_ch) {
- WORD32 err = 0, i, k;
+VOID ixheaacd_lpd_dec_update(ia_usac_lpd_decoder_handle tddec,
+ ia_usac_data_struct *usac_data, WORD32 i_ch) {
+ WORD32 i, k;
WORD32 *ptr_overlap = &usac_data->overlap_data_ptr[i_ch][0];
WORD32 len_fr, lpd_sbf_len, lpd_delay, num_subfr_by2, synth_delay, fac_length;
@@ -649,7 +651,7 @@
(1 + (2 * FAC_LENGTH)) * sizeof(FLOAT32));
}
- return err;
+ return;
}
WORD32 ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data,
diff --git a/decoder/ixheaacd_mps_dec.c b/decoder/ixheaacd_mps_dec.c
index 407abef..98f6646 100644
--- a/decoder/ixheaacd_mps_dec.c
+++ b/decoder/ixheaacd_mps_dec.c
@@ -333,10 +333,10 @@
#define min(a, b) (((a) < (b)) ? (a) : (b))
-static WORD32 ixheaacd_mps_pcm_decode(ia_handle_bit_buf_struct it_bit_buff,
- WORD32* out_data_1, WORD32* out_data_2,
- WORD32 ixheaacd_drc_offset,
- WORD32 num_val, WORD32 num_levels) {
+static VOID ixheaacd_mps_pcm_decode(ia_handle_bit_buf_struct it_bit_buff,
+ WORD32* out_data_1, WORD32* out_data_2,
+ WORD32 ixheaacd_drc_offset, WORD32 num_val,
+ WORD32 num_levels) {
WORD32 i = 0, j = 0, idx = 0;
WORD32 max_grp_len = 0, grp_len = 0, next_val = 0, grp_val = 0;
UWORD32 data = 0;
@@ -411,12 +411,12 @@
}
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_read(ia_handle_bit_buf_struct it_bit_buff,
- const WORD32 (*node_tab)[][2],
- WORD32* out_data) {
+static VOID ixheaacd_mps_huff_read(ia_handle_bit_buf_struct it_bit_buff,
+ const WORD32 (*node_tab)[][2],
+ WORD32* out_data) {
WORD32 node = 0;
UWORD32 next_bit = 0;
@@ -427,18 +427,18 @@
*out_data = node;
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_read_2d(ia_handle_bit_buf_struct it_bit_buff,
- const WORD32 (*node_tab)[][2],
- WORD32 out_data[2], WORD32* escape)
+static VOID ixheaacd_mps_huff_read_2d(ia_handle_bit_buf_struct it_bit_buff,
+ const WORD32 (*node_tab)[][2],
+ WORD32 out_data[2], WORD32* escape)
{
WORD32 huff_2d_8bit = 0;
WORD32 node = 0;
- if (!ixheaacd_mps_huff_read(it_bit_buff, node_tab, &node)) return 0;
+ ixheaacd_mps_huff_read(it_bit_buff, node_tab, &node);
*escape = (node == 0);
if (*escape) {
@@ -450,11 +450,11 @@
out_data[1] = huff_2d_8bit & 0xf;
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_sym_restore(ia_handle_bit_buf_struct it_bit_buff,
- WORD32 lav, WORD32 data[2]) {
+static VOID ixheaacd_mps_sym_restore(ia_handle_bit_buf_struct it_bit_buff,
+ WORD32 lav, WORD32 data[2]) {
WORD32 tmp = 0;
UWORD32 sym_bit = 0;
@@ -486,11 +486,11 @@
}
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_sym_restoreipd(ia_handle_bit_buf_struct it_bit_buff,
- WORD32 lav, WORD32 data[2]) {
+static VOID ixheaacd_mps_sym_restoreipd(ia_handle_bit_buf_struct it_bit_buff,
+ WORD32 lav, WORD32 data[2]) {
WORD32 tmp = 0;
UWORD32 sym_bit = 0;
@@ -514,21 +514,21 @@
}
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_pilot(ia_handle_bit_buf_struct it_bit_buff,
- const WORD32 (*node_tab)[][2],
- WORD32* pilot_data) {
+static VOID ixheaacd_mps_huff_dec_pilot(ia_handle_bit_buf_struct it_bit_buff,
+ const WORD32 (*node_tab)[][2],
+ WORD32* pilot_data) {
WORD32 node = 0;
- if (!ixheaacd_mps_huff_read(it_bit_buff, node_tab, &node)) return 0;
+ ixheaacd_mps_huff_read(it_bit_buff, node_tab, &node);
*pilot_data = -(node + 1);
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_cld_1d(
+static VOID ixheaacd_mps_huff_dec_cld_1d(
ia_handle_bit_buf_struct it_bit_buff,
const ia_huff_cld_node_1d_struct* huff_nodes, WORD32* out_data,
WORD32 num_val, WORD32 p0_flag) {
@@ -537,18 +537,16 @@
UWORD32 data = 0;
if (p0_flag) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.cld,
- &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.cld,
+ &node);
out_data[0] = -(node + 1);
ixheaacd_drc_offset = 1;
}
for (i = ixheaacd_drc_offset; i < num_val; i++) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&huff_nodes->node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->node_tab, &node);
od = -(node + 1);
if (od != 0) {
@@ -561,10 +559,10 @@
out_data[i] = od;
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_ipd_1d(
+static VOID ixheaacd_mps_huff_dec_ipd_1d(
ia_handle_bit_buf_struct it_bit_buff,
const ia_huff_ipd_node_1d_struct* huff_nodes, WORD32* out_data,
WORD32 num_val, WORD32 p0_flag) {
@@ -572,26 +570,24 @@
WORD32 od = 0;
if (p0_flag) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_ipd_nodes.hp0.node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_ipd_nodes.hp0.node_tab,
+ &node);
out_data[0] = -(node + 1);
ixheaacd_drc_offset = 1;
}
for (i = ixheaacd_drc_offset; i < num_val; i++) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&huff_nodes->node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->node_tab, &node);
od = -(node + 1);
out_data[i] = od;
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_icc_1d(
+static VOID ixheaacd_mps_huff_dec_icc_1d(
ia_handle_bit_buf_struct it_bit_buff,
const ia_huff_icc_node_1d_struct* huff_nodes, WORD32* out_data,
WORD32 num_val, WORD32 p0_flag) {
@@ -600,18 +596,16 @@
UWORD32 data = 0;
if (p0_flag) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.icc,
- &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.icc,
+ &node);
out_data[0] = -(node + 1);
ixheaacd_drc_offset = 1;
}
for (i = ixheaacd_drc_offset; i < num_val; i++) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&huff_nodes->node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->node_tab, &node);
od = -(node + 1);
if (od != 0) {
@@ -624,10 +618,10 @@
out_data[i] = od;
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_cld_2d(
+static VOID ixheaacd_mps_huff_dec_cld_2d(
ia_handle_bit_buf_struct it_bit_buff,
const ia_huff_cld_node_2d_struct* huff_nodes, WORD32 out_data[][2],
WORD32 num_val, WORD32 ch_fac, WORD32* p0_data[2]) {
@@ -638,54 +632,47 @@
WORD32 esc_data[MAXBANDS][2] = {{0}};
WORD32 esc_idx[MAXBANDS] = {0};
- if (!ixheaacd_mps_huff_read(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_lav_idx_nodes.node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_lav_idx_nodes.node_tab,
+ &node);
data = -(node + 1);
lav = 2 * data + 3;
if (p0_data[0] != NULL) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.cld,
- &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.cld,
+ &node);
*p0_data[0] = -(node + 1);
}
if (p0_data[1] != NULL) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.cld,
- &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.cld,
+ &node);
*p0_data[1] = -(node + 1);
}
for (i = 0; i < num_val; i += ch_fac) {
switch (lav) {
case 3:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav3,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav3,
+ out_data[i], &escape);
break;
case 5:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav5,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav5,
+ out_data[i], &escape);
break;
case 7:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav7,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav7,
+ out_data[i], &escape);
break;
case 9:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav9,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav9,
+ out_data[i], &escape);
break;
default:
break;
@@ -694,14 +681,13 @@
if (escape) {
esc_idx[esc_contrl++] = i;
} else {
- if (!ixheaacd_mps_sym_restore(it_bit_buff, lav, out_data[i])) return 0;
+ ixheaacd_mps_sym_restore(it_bit_buff, lav, out_data[i]);
}
}
if (esc_contrl > 0) {
- if (!ixheaacd_mps_pcm_decode(it_bit_buff, esc_data[0], esc_data[1], 0,
- 2 * esc_contrl, (2 * lav + 1)))
- return 0;
+ ixheaacd_mps_pcm_decode(it_bit_buff, esc_data[0], esc_data[1], 0,
+ 2 * esc_contrl, (2 * lav + 1));
for (i = 0; i < esc_contrl; i++) {
out_data[esc_idx[i]][0] = esc_data[0][i] - lav;
@@ -709,10 +695,10 @@
}
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_icc_2d(
+static VOID ixheaacd_mps_huff_dec_icc_2d(
ia_handle_bit_buf_struct it_bit_buff,
const ia_huff_icc_node_2d_struct* huff_nodes, WORD32 out_data[][2],
WORD32 num_val, WORD32 ch_fac, WORD32* p0_data[2]) {
@@ -723,68 +709,60 @@
WORD32 esc_data[2][MAXBANDS] = {{0}};
WORD32 esc_idx[MAXBANDS] = {0};
- if (!ixheaacd_mps_huff_read(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_lav_idx_nodes.node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_lav_idx_nodes.node_tab,
+ &node);
data = -(node + 1);
lav = 2 * data + 1;
if (p0_data[0] != NULL) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.icc,
- &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.icc,
+ &node);
*p0_data[0] = -(node + 1);
}
if (p0_data[1] != NULL) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.icc,
- &node))
- return 0;
+ ixheaacd_mps_huff_read(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_part0_nodes.icc,
+ &node);
*p0_data[1] = -(node + 1);
}
for (i = 0; i < num_val; i += ch_fac) {
switch (lav) {
case 1:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav1,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav1,
+ out_data[i], &escape);
break;
case 3:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav3,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav3,
+ out_data[i], &escape);
break;
case 5:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav5,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav5,
+ out_data[i], &escape);
break;
case 7:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav7,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav7,
+ out_data[i], &escape);
break;
}
if (escape) {
esc_idx[esc_contrl++] = i;
} else {
- if (!ixheaacd_mps_sym_restore(it_bit_buff, lav, out_data[i])) return 0;
+ ixheaacd_mps_sym_restore(it_bit_buff, lav, out_data[i]);
}
}
if (esc_contrl > 0) {
- if (!ixheaacd_mps_pcm_decode(it_bit_buff, esc_data[0], esc_data[1], 0,
- 2 * esc_contrl, (2 * lav + 1)))
- return 0;
+ ixheaacd_mps_pcm_decode(it_bit_buff, esc_data[0], esc_data[1], 0,
+ 2 * esc_contrl, (2 * lav + 1));
for (i = 0; i < esc_contrl; i++) {
out_data[esc_idx[i]][0] = esc_data[0][i] - lav;
@@ -792,10 +770,10 @@
}
}
- return 1;
+ return;
}
-static WORD32 ixheaacd_mps_huff_dec_ipd_2d(
+static VOID ixheaacd_mps_huff_dec_ipd_2d(
ia_handle_bit_buf_struct it_bit_buff,
const ia_huff_ipd_node_2d_struct* huff_nodes, WORD32 out_data[][2],
WORD32 num_val, WORD32 ch_fac, WORD32* p0_data[2]) {
@@ -806,10 +784,9 @@
WORD32 esc_data[2][MAXBANDS] = {{0}};
WORD32 esc_idx[MAXBANDS] = {0};
- if (!ixheaacd_mps_huff_read(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_lav_idx_nodes.node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_lav_idx_nodes.node_tab,
+ &node);
data = -(node + 1);
if (data == 0)
@@ -820,59 +797,52 @@
lav = 2 * data + 1;
if (p0_data[0] != NULL) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_ipd_nodes.hp0.node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_ipd_nodes.hp0.node_tab,
+ &node);
*p0_data[0] = -(node + 1);
}
if (p0_data[1] != NULL) {
- if (!ixheaacd_mps_huff_read(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_ipd_nodes.hp0.node_tab, &node))
- return 0;
+ ixheaacd_mps_huff_read(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_ipd_nodes.hp0.node_tab,
+ &node);
*p0_data[1] = -(node + 1);
}
for (i = 0; i < num_val; i += ch_fac) {
switch (lav) {
case 1:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav1,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav1,
+ out_data[i], &escape);
break;
case 3:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav3,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav3,
+ out_data[i], &escape);
break;
case 5:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav5,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav5,
+ out_data[i], &escape);
break;
case 7:
- if (!ixheaacd_mps_huff_read_2d(it_bit_buff,
- (ia_huff_node_struct)&huff_nodes->lav7,
- out_data[i], &escape))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&huff_nodes->lav7,
+ out_data[i], &escape);
break;
}
if (escape) {
esc_idx[esc_contrl++] = i;
} else {
- if (!ixheaacd_mps_sym_restoreipd(it_bit_buff, lav, out_data[i])) return 0;
+ ixheaacd_mps_sym_restoreipd(it_bit_buff, lav, out_data[i]);
}
}
if (esc_contrl > 0) {
- if (!ixheaacd_mps_pcm_decode(it_bit_buff, esc_data[0], esc_data[1], 0,
- 2 * esc_contrl, (2 * lav + 1)))
- return 0;
+ ixheaacd_mps_pcm_decode(it_bit_buff, esc_data[0], esc_data[1], 0,
+ 2 * esc_contrl, (2 * lav + 1));
for (i = 0; i < esc_contrl; i++) {
out_data[esc_idx[i]][0] = esc_data[0][i] - lav;
@@ -880,7 +850,7 @@
}
}
- return 1;
+ return;
}
static WORD32 ixheaacd_huff_decode(ia_handle_bit_buf_struct it_bit_buff,
@@ -918,21 +888,17 @@
switch (data_type) {
case CLD:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_pilot(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_pilot_nodes.cld,
- pilot_data))
- return 0;
+ ixheaacd_mps_huff_dec_pilot(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_pilot_nodes.cld,
+ pilot_data);
}
break;
case ICC:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_pilot(
- it_bit_buff,
- (ia_huff_node_struct)&ixheaacd_huff_pilot_nodes.icc,
- pilot_data))
- return 0;
+ ixheaacd_mps_huff_dec_pilot(
+ it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_pilot_nodes.icc,
+ pilot_data);
}
break;
@@ -973,48 +939,42 @@
switch (data_type) {
case CLD:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_cld_1d(
- it_bit_buff, &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_1],
- out_data_1, num_val_1_int, p0_flag[0]))
- return 0;
+ ixheaacd_mps_huff_dec_cld_1d(
+ it_bit_buff, &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_1],
+ out_data_1, num_val_1_int, p0_flag[0]);
}
if (out_data_2 != NULL) {
- if (!ixheaacd_mps_huff_dec_cld_1d(
- it_bit_buff, &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_2],
- out_data_2, num_val_2_int, p0_flag[1]))
- return 0;
+ ixheaacd_mps_huff_dec_cld_1d(
+ it_bit_buff, &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_2],
+ out_data_2, num_val_2_int, p0_flag[1]);
}
break;
case ICC:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_icc_1d(
- it_bit_buff, &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_1],
- out_data_1, num_val_1_int, p0_flag[0]))
- return 0;
+ ixheaacd_mps_huff_dec_icc_1d(
+ it_bit_buff, &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_1],
+ out_data_1, num_val_1_int, p0_flag[0]);
}
if (out_data_2 != NULL) {
- if (!ixheaacd_mps_huff_dec_icc_1d(
- it_bit_buff, &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_2],
- out_data_2, num_val_2_int, p0_flag[1]))
- return 0;
+ ixheaacd_mps_huff_dec_icc_1d(
+ it_bit_buff, &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_2],
+ out_data_2, num_val_2_int, p0_flag[1]);
}
break;
case IPD:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_ipd_1d(
- it_bit_buff, &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_1],
- out_data_1, num_val_1_int, p0_flag[0]))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_1d(
+ it_bit_buff, &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_1],
+ out_data_1, num_val_1_int, p0_flag[0]);
}
if (out_data_2 != NULL) {
- if (!ixheaacd_mps_huff_dec_ipd_1d(
- it_bit_buff, &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_2],
- out_data_2, num_val_2_int, p0_flag[1]))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_1d(
+ it_bit_buff, &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_2],
+ out_data_2, num_val_2_int, p0_flag[1]);
}
break;
@@ -1057,93 +1017,75 @@
case CLD:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_cld_2d(
- it_bit_buff,
- &ixheaacd_huff_cld_nodes.h_2_dim[huff_yy_1][FREQ_PAIR],
- pair_vec, num_val_1_int, 2, p0_data_1))
- return 0;
+ ixheaacd_mps_huff_dec_cld_2d(
+ it_bit_buff,
+ &ixheaacd_huff_cld_nodes.h_2_dim[huff_yy_1][FREQ_PAIR],
+ pair_vec, num_val_1_int, 2, p0_data_1);
if (df_rest_flag_1) {
- if (!ixheaacd_mps_huff_dec_cld_1d(
- it_bit_buff,
- &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_1],
- out_data_1_int + num_val_1_int, 1, 0))
- return 0;
+ ixheaacd_mps_huff_dec_cld_1d(
+ it_bit_buff, &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_1],
+ out_data_1_int + num_val_1_int, 1, 0);
}
}
if (out_data_2 != NULL) {
- if (!ixheaacd_mps_huff_dec_cld_2d(
- it_bit_buff,
- &ixheaacd_huff_cld_nodes.h_2_dim[huff_yy_2][FREQ_PAIR],
- pair_vec + 1, num_val_2_int, 2, p0_data_2))
- return 0;
+ ixheaacd_mps_huff_dec_cld_2d(
+ it_bit_buff,
+ &ixheaacd_huff_cld_nodes.h_2_dim[huff_yy_2][FREQ_PAIR],
+ pair_vec + 1, num_val_2_int, 2, p0_data_2);
if (df_rest_flag_2) {
- if (!ixheaacd_mps_huff_dec_cld_1d(
- it_bit_buff,
- &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_2],
- out_data_2_int + num_val_2_int, 1, 0))
- return 0;
+ ixheaacd_mps_huff_dec_cld_1d(
+ it_bit_buff, &ixheaacd_huff_cld_nodes.h_1_dim[huff_yy_2],
+ out_data_2_int + num_val_2_int, 1, 0);
}
}
break;
case ICC:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_icc_2d(
- it_bit_buff,
- &ixheaacd_huff_icc_nodes.h_2_dim[huff_yy_1][FREQ_PAIR],
- pair_vec, num_val_1_int, 2, p0_data_1))
- return 0;
+ ixheaacd_mps_huff_dec_icc_2d(
+ it_bit_buff,
+ &ixheaacd_huff_icc_nodes.h_2_dim[huff_yy_1][FREQ_PAIR],
+ pair_vec, num_val_1_int, 2, p0_data_1);
if (df_rest_flag_1) {
- if (!ixheaacd_mps_huff_dec_icc_1d(
- it_bit_buff,
- &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_1],
- out_data_1_int + num_val_1_int, 1, 0))
- return 0;
+ ixheaacd_mps_huff_dec_icc_1d(
+ it_bit_buff, &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_1],
+ out_data_1_int + num_val_1_int, 1, 0);
}
}
if (out_data_2 != NULL) {
- if (!ixheaacd_mps_huff_dec_icc_2d(
- it_bit_buff,
- &ixheaacd_huff_icc_nodes.h_2_dim[huff_yy_2][FREQ_PAIR],
- pair_vec + 1, num_val_2_int, 2, p0_data_2))
- return 0;
+ ixheaacd_mps_huff_dec_icc_2d(
+ it_bit_buff,
+ &ixheaacd_huff_icc_nodes.h_2_dim[huff_yy_2][FREQ_PAIR],
+ pair_vec + 1, num_val_2_int, 2, p0_data_2);
if (df_rest_flag_2) {
- if (!ixheaacd_mps_huff_dec_icc_1d(
- it_bit_buff,
- &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_2],
- out_data_2_int + num_val_2_int, 1, 0))
- return 0;
+ ixheaacd_mps_huff_dec_icc_1d(
+ it_bit_buff, &ixheaacd_huff_icc_nodes.h_1_dim[huff_yy_2],
+ out_data_2_int + num_val_2_int, 1, 0);
}
}
break;
case IPD:
if (out_data_1 != NULL) {
- if (!ixheaacd_mps_huff_dec_ipd_2d(
- it_bit_buff,
- &ixheaacd_huff_ipd_nodes.h_2_dim[huff_yy_1][FREQ_PAIR],
- pair_vec, num_val_1_int, 2, p0_data_1))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_2d(
+ it_bit_buff,
+ &ixheaacd_huff_ipd_nodes.h_2_dim[huff_yy_1][FREQ_PAIR],
+ pair_vec, num_val_1_int, 2, p0_data_1);
if (df_rest_flag_1) {
- if (!ixheaacd_mps_huff_dec_ipd_1d(
- it_bit_buff,
- &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_1],
- out_data_1_int + num_val_1_int, 1, 0))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_1d(
+ it_bit_buff, &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_1],
+ out_data_1_int + num_val_1_int, 1, 0);
}
}
if (out_data_2 != NULL) {
- if (!ixheaacd_mps_huff_dec_ipd_2d(
- it_bit_buff,
- &ixheaacd_huff_ipd_nodes.h_2_dim[huff_yy_2][FREQ_PAIR],
- pair_vec + 1, num_val_2_int, 2, p0_data_2))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_2d(
+ it_bit_buff,
+ &ixheaacd_huff_ipd_nodes.h_2_dim[huff_yy_2][FREQ_PAIR],
+ pair_vec + 1, num_val_2_int, 2, p0_data_2);
if (df_rest_flag_2) {
- if (!ixheaacd_mps_huff_dec_ipd_1d(
- it_bit_buff,
- &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_2],
- out_data_2_int + num_val_2_int, 1, 0))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_1d(
+ it_bit_buff, &ixheaacd_huff_ipd_nodes.h_1_dim[huff_yy_2],
+ out_data_2_int + num_val_2_int, 1, 0);
}
}
break;
@@ -1193,27 +1135,24 @@
switch (data_type) {
case CLD:
- if (!ixheaacd_mps_huff_dec_cld_2d(
- it_bit_buff,
- &ixheaacd_huff_cld_nodes.h_2_dim[huff_yy][TIME_PAIR],
- pair_vec, num_val_1_int, 1, p0_data_1))
- return 0;
+ ixheaacd_mps_huff_dec_cld_2d(
+ it_bit_buff,
+ &ixheaacd_huff_cld_nodes.h_2_dim[huff_yy][TIME_PAIR],
+ pair_vec, num_val_1_int, 1, p0_data_1);
break;
case ICC:
- if (!ixheaacd_mps_huff_dec_icc_2d(
- it_bit_buff,
- &ixheaacd_huff_icc_nodes.h_2_dim[huff_yy][TIME_PAIR],
- pair_vec, num_val_1_int, 1, p0_data_1))
- return 0;
+ ixheaacd_mps_huff_dec_icc_2d(
+ it_bit_buff,
+ &ixheaacd_huff_icc_nodes.h_2_dim[huff_yy][TIME_PAIR],
+ pair_vec, num_val_1_int, 1, p0_data_1);
break;
case IPD:
- if (!ixheaacd_mps_huff_dec_ipd_2d(
- it_bit_buff,
- &ixheaacd_huff_ipd_nodes.h_2_dim[huff_yy][TIME_PAIR],
- pair_vec, num_val_1_int, 1, p0_data_1))
- return 0;
+ ixheaacd_mps_huff_dec_ipd_2d(
+ it_bit_buff,
+ &ixheaacd_huff_ipd_nodes.h_2_dim[huff_yy][TIME_PAIR],
+ pair_vec, num_val_1_int, 1, p0_data_1);
break;
default:
@@ -1287,10 +1226,10 @@
}
}
-static WORD32 ixheaacd_attach_lsb(ia_handle_bit_buf_struct it_bit_buff,
- WORD32* in_data_msb,
- WORD32 ixheaacd_drc_offset, WORD32 num_lsb,
- WORD32 num_val, WORD32* out_data) {
+static VOID ixheaacd_attach_lsb(ia_handle_bit_buf_struct it_bit_buff,
+ WORD32* in_data_msb, WORD32 ixheaacd_drc_offset,
+ WORD32 num_lsb, WORD32 num_val,
+ WORD32* out_data) {
WORD32 i = 0, lsb = 0, msb = 0;
UWORD32 data = 0;
@@ -1306,7 +1245,7 @@
out_data[i] = msb - ixheaacd_drc_offset;
}
- return 0;
+ return;
}
WORD32 ixheaacd_mps_ecdatapairdec(ia_handle_bit_buf_struct it_bit_buff,
@@ -1379,7 +1318,7 @@
default:
fprintf(stderr, "Unknown type of data!\n");
- return 0;
+ return -1;
}
data = ixheaacd_read_bits_buf(it_bit_buff, 1);
@@ -1398,9 +1337,8 @@
pcm_val = data_bands;
}
- if (!ixheaacd_mps_pcm_decode(it_bit_buff, data_array[0], data_array[1],
- quant_offset, pcm_val, quant_levels))
- return 0;
+ ixheaacd_mps_pcm_decode(it_bit_buff, data_array[0], data_array[1],
+ quant_offset, pcm_val, quant_levels);
} else {
if (pair_flag) {
@@ -1501,19 +1439,18 @@
sizeof(WORD32) * data_bands);
}
- return 1;
+ return IA_NO_ERROR;
}
-WORD32 ixheaacd_mps_huff_decode(ia_handle_bit_buf_struct it_bit_buff,
- WORD32* out_data, WORD32 num_val) {
+VOID ixheaacd_mps_huff_decode(ia_handle_bit_buf_struct it_bit_buff,
+ WORD32* out_data, WORD32 num_val) {
WORD32 val_rcvd = 0, dummy = 0, i = 0, val = 0, len = 0;
WORD32 rl_data[2] = {0};
while (val_rcvd < num_val) {
- if (!ixheaacd_mps_huff_read_2d(
- it_bit_buff, (ia_huff_node_struct)&ixheaacd_huff_reshape_nodes,
- rl_data, &dummy))
- return 0;
+ ixheaacd_mps_huff_read_2d(it_bit_buff,
+ (ia_huff_node_struct)&ixheaacd_huff_reshape_nodes,
+ rl_data, &dummy);
val = rl_data[0];
len = rl_data[1] + 1;
for (i = val_rcvd; i < val_rcvd + len; i++) {
@@ -1522,5 +1459,5 @@
val_rcvd += len;
}
- return 1;
+ return;
}
diff --git a/decoder/ixheaacd_mps_interface.h b/decoder/ixheaacd_mps_interface.h
index a488aef..0ca9892 100644
--- a/decoder/ixheaacd_mps_interface.h
+++ b/decoder/ixheaacd_mps_interface.h
@@ -24,9 +24,9 @@
WORD32 residual_coding,
ia_usac_dec_mps_config_struct* usac_mps_config);
-VOID ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct* self,
- WORD32 independency_flag,
- ia_handle_bit_buf_struct it_bit_buff);
+IA_ERRORCODE ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct* self,
+ WORD32 independency_flag,
+ ia_handle_bit_buf_struct it_bit_buff);
WORD32 ixheaacd_mps_apply(ia_mps_dec_state_struct* self, FLOAT32** pointers[4],
FLOAT32 (*out_samples)[4096]);
diff --git a/decoder/ixheaacd_mps_nlc_dec.h b/decoder/ixheaacd_mps_nlc_dec.h
index bbb2e94..e210f6c 100644
--- a/decoder/ixheaacd_mps_nlc_dec.h
+++ b/decoder/ixheaacd_mps_nlc_dec.h
@@ -54,7 +54,7 @@
WORD32 pair_flag, WORD32 coarse_flag,
WORD32 independency_flag);
-WORD32 ixheaacd_mps_huff_decode(ia_handle_bit_buf_struct strm, WORD32 *out_data,
- WORD32 num_val);
+VOID ixheaacd_mps_huff_decode(ia_handle_bit_buf_struct strm, WORD32 *out_data,
+ WORD32 num_val);
#endif
diff --git a/decoder/ixheaacd_mps_parse.c b/decoder/ixheaacd_mps_parse.c
index 1d47890..81a8592 100644
--- a/decoder/ixheaacd_mps_parse.c
+++ b/decoder/ixheaacd_mps_parse.c
@@ -23,13 +23,12 @@
#include "ixheaacd_type_def.h"
#include "ixheaacd_bitbuffer.h"
#include "ixheaacd_config.h"
-
#include "ixheaacd_mps_polyphase.h"
-
#include "ixheaacd_mps_dec.h"
#include "ixheaacd_mps_interface.h"
#include "ixheaacd_mps_nlc_dec.h"
#include "ixheaacd_mps_hybfilter.h"
+#include "ixheaacd_error_standards.h"
#define min(a, b) ((a) < (b) ? (a) : (b))
@@ -241,7 +240,7 @@
return data_bands;
}
-static VOID ixheaacd_mps_ecdata_decoding(
+static IA_ERRORCODE ixheaacd_mps_ecdata_decoding(
ia_mps_dec_state_struct *self, ia_handle_bit_buf_struct bitstream,
int data[MAX_PARAMETER_SETS_MPS][MAX_PARAMETER_BANDS], int datatype) {
int i, j, pb, set_index, bs_data_pair, data_bands, old_quant_coarse_xxx;
@@ -251,6 +250,7 @@
int *lastdata = NULL;
ia_mps_data_struct *frame_xxx_data = NULL;
int default_val = 0;
+ IA_ERRORCODE err = IA_NO_ERROR;
ia_mps_bs_frame *frame = &(self->bs_frame);
@@ -316,10 +316,11 @@
lastdata[pb] = lastdata[strides[pb]];
}
- ixheaacd_mps_ecdatapairdec(
+ err = ixheaacd_mps_ecdatapairdec(
bitstream, data, lastdata, datatype, set_index, data_bands,
bs_data_pair, frame_xxx_data->bs_quant_coarse_xxx[set_index],
frame->independency_flag && (i == 0));
+ if (err) return err;
for (pb = 0; pb < data_bands; pb++) {
for (j = strides[pb]; j < strides[pb + 1]; j++) {
@@ -347,11 +348,12 @@
}
}
}
+ return err;
}
-VOID ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct *self,
- int usac_independency_flag,
- ia_handle_bit_buf_struct bitstream) {
+IA_ERRORCODE ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct *self,
+ int usac_independency_flag,
+ ia_handle_bit_buf_struct bitstream) {
int i, bs_frame_type, data_bands, bs_temp_shape_enable, num_of_temp_shape_ch;
int ps, pg, ts, pb;
int env_shape_data[MAX_TIME_SLOTS];
@@ -359,8 +361,9 @@
int bits_param_slot = 0;
ia_mps_bs_frame *frame = &(self->bs_frame);
+ IA_ERRORCODE err = IA_NO_ERROR;
- if (self->parse_nxt_frame == 0) return;
+ if (self->parse_nxt_frame == 0) return IA_NO_ERROR;
self->num_parameter_sets_prev = self->num_parameter_sets;
@@ -391,8 +394,11 @@
frame->independency_flag = 1;
}
- ixheaacd_mps_ecdata_decoding(self, bitstream, frame->cmp_cld_idx, CLD);
- ixheaacd_mps_ecdata_decoding(self, bitstream, frame->cmp_icc_idx, ICC);
+ err = ixheaacd_mps_ecdata_decoding(self, bitstream, frame->cmp_cld_idx, CLD);
+ if (err) return err;
+
+ err = ixheaacd_mps_ecdata_decoding(self, bitstream, frame->cmp_icc_idx, ICC);
+ if (err) return err;
if (self->config->bs_phase_coding) {
self->bs_phase_mode = ixheaacd_read_bits_buf(bitstream, 1);
@@ -409,7 +415,9 @@
self->opd_smoothing_mode = 0;
} else {
self->opd_smoothing_mode = ixheaacd_read_bits_buf(bitstream, 1);
- ixheaacd_mps_ecdata_decoding(self, bitstream, frame->ipd_idx_data, IPD);
+ err = ixheaacd_mps_ecdata_decoding(self, bitstream, frame->ipd_idx_data,
+ IPD);
+ if (err) return err;
}
}
@@ -599,6 +607,7 @@
}
self->parse_nxt_frame = 0;
+ return err;
}
static VOID ixheaacd_mps_createmapping(int map[MAX_PARAMETER_BANDS + 1],
@@ -1086,4 +1095,4 @@
self->bs_high_rate_mode = self->config->bs_high_rate_mode;
return 0;
-}
\ No newline at end of file
+}
diff --git a/decoder/ixheaacd_process.c b/decoder/ixheaacd_process.c
index 1aae894..f1c7202 100644
--- a/decoder/ixheaacd_process.c
+++ b/decoder/ixheaacd_process.c
@@ -376,9 +376,10 @@
*num_out_channels = p_state_aac_dec->mps_dec_handle.out_ch_count;
- ixheaacd_mps_frame_parsing(&p_state_aac_dec->mps_dec_handle,
- pstr_usac_data->usac_independency_flg,
- it_bit_buff);
+ err = ixheaacd_mps_frame_parsing(
+ &p_state_aac_dec->mps_dec_handle,
+ pstr_usac_data->usac_independency_flg, it_bit_buff);
+ if (err) return err;
for (ch = 0; ch < nr_core_coder_channels; ch++) {
ptr_inp[2 * ch] =
diff --git a/decoder/ixheaacd_ps_dec.h b/decoder/ixheaacd_ps_dec.h
index c4f957d..f441d35 100644
--- a/decoder/ixheaacd_ps_dec.h
+++ b/decoder/ixheaacd_ps_dec.h
@@ -110,8 +110,8 @@
ia_hybrid_struct str_hybrid;
} ia_ps_dec_struct;
-WORD32 ixheaacd_create_psdec(ia_ps_dec_struct *ptr_ps_dec,
- VOID *sbr_persistent_mem, WORD32 *ptr_overlap_buf);
+VOID ixheaacd_create_psdec(ia_ps_dec_struct *ptr_ps_dec,
+ VOID *sbr_persistent_mem, WORD32 *ptr_overlap_buf);
VOID ixheaacd_decorr_filter1_dec(ia_ps_dec_struct *ptr_ps_dec,
ia_ps_tables_struct *ps_tables_ptr,
diff --git a/decoder/ixheaacd_sbr_dec.c b/decoder/ixheaacd_sbr_dec.c
index a8ac0b6..671f4d6 100644
--- a/decoder/ixheaacd_sbr_dec.c
+++ b/decoder/ixheaacd_sbr_dec.c
@@ -752,10 +752,13 @@
ptr_pvc_data->pvc_rate = ptr_header_data->upsamp_fac;
if (sbr_mode == PVC_SBR) {
- ixheaacd_pvc_process(
+ err_code = ixheaacd_pvc_process(
ptr_pvc_data, ptr_header_data->pstr_freq_band_data->sub_band_start,
ptr_frame_data->str_pvc_frame_info.border_vec[0],
&pvc_qmf_enrg_arr[0], &pvc_dec_out_buf[0]);
+
+ if (err_code) return err_code;
+
ptr_pvc_data->prev_pvc_flg = 1;
} else {
memset(pvc_dec_out_buf, 0, 1024 * sizeof(FLOAT32));
diff --git a/decoder/ixheaacd_sbrdec_initfuncs.c b/decoder/ixheaacd_sbrdec_initfuncs.c
index a5a2181..f779c84 100644
--- a/decoder/ixheaacd_sbrdec_initfuncs.c
+++ b/decoder/ixheaacd_sbrdec_initfuncs.c
@@ -77,7 +77,7 @@
return (ALIGN_SIZE64(sizeof(ia_sbr_pers_struct)));
}
-WORD32 ixheaacd_esbr_hbe_data_init(
+VOID ixheaacd_esbr_hbe_data_init(
ia_esbr_hbe_txposer_struct *pstr_esbr_hbe_txposer,
const WORD32 num_aac_samples, WORD32 samp_fac_4_flag,
const WORD32 num_out_samples, VOID *persistent_hbe_mem) {
@@ -126,7 +126,7 @@
pstr_esbr_hbe_txposer->upsamp_4_flag = samp_fac_4_flag;
}
- return 0;
+ return;
}
VOID ixheaacd_set_sbr_persistent_table_pointer(
@@ -552,16 +552,13 @@
if (channel != 1) {
if (ps_enable) {
if (audio_object_type == AOT_ER_AAC_ELD)
- err = (WORD16)ixheaacd_create_psdec(
+ ixheaacd_create_psdec(
sbr_persistent_mem->str_sbr_dec_inst.pstr_ps_stereo_dec,
sbr_persistent_mem, &ptr_overlap_buf[512 * 4]);
else
- err = (WORD16)ixheaacd_create_psdec(
+ ixheaacd_create_psdec(
sbr_persistent_mem->str_sbr_dec_inst.pstr_ps_stereo_dec,
sbr_persistent_mem, ptr_overlap_buf);
- if (err) {
- return NULL;
- }
}
}
@@ -791,7 +788,7 @@
ptr_prev_data->max_qmf_subband_aac = 0;
}
-static PLATFORM_INLINE WORD32
+static PLATFORM_INLINE VOID
ixheaacd_create_hyb_filterbank(ia_hybrid_struct *ptr_hybrid, WORD32 **p_ptr,
ia_sbr_tables_struct *sbr_tables_ptr) {
WORD16 i, ptr_step;
@@ -827,10 +824,10 @@
*p_ptr = ptr;
- return 0;
+ return;
}
-static PLATFORM_INLINE WORD16 ixheaacd_create_hf_generator(
+static PLATFORM_INLINE VOID ixheaacd_create_hf_generator(
ia_sbr_hf_generator_struct *ptr_hf_gen_str, WORD16 num_columns, WORD16 chan,
VOID *sbr_persistent_mem_v, WORD32 ps_enable) {
WORD16 i;
@@ -863,12 +860,12 @@
if (chan == 0) {
ptr_hf_gen_str->pstr_settings->num_columns = num_columns;
}
- return 0;
+ return;
}
-WORD32 ixheaacd_create_psdec(ia_ps_dec_struct *ptr_ps_dec,
- VOID *sbr_persistent_mem_v,
- WORD32 *ptr_overlap_buf) {
+VOID ixheaacd_create_psdec(ia_ps_dec_struct *ptr_ps_dec,
+ VOID *sbr_persistent_mem_v,
+ WORD32 *ptr_overlap_buf) {
ia_sbr_pers_struct *sbr_persistent_mem =
(ia_sbr_pers_struct *)sbr_persistent_mem_v;
@@ -952,10 +949,10 @@
(NO_IID_GROUPS + 2) * 2 * sizeof(WORD16));
memset(ptr_ps_dec->h21_h22_vec, 0, sizeof(ptr_ps_dec->h21_h22_vec));
- return 0;
+ return;
}
-static PLATFORM_INLINE WORD32 ixheaacd_create_cplx_anal_qmfbank(
+static PLATFORM_INLINE VOID ixheaacd_create_cplx_anal_qmfbank(
ia_sbr_qmf_filter_bank_struct *ptr_sbr_qmf,
ia_sbr_scale_fact_struct *sbr_scale_factor, WORD16 no_bins, WORD16 usb,
WORD16 chan, WORD16 *sbr_qmf_analy_states, WORD32 *sbr_qmf_analy_states_32,
@@ -1014,10 +1011,10 @@
ptr_sbr_qmf->anal_filter_states + NO_ANALYSIS_CHANNELS;
}
- return 0;
+ return;
}
-static PLATFORM_INLINE WORD32 ixheaacd_create_cplx_synt_qmfbank(
+static PLATFORM_INLINE VOID ixheaacd_create_cplx_synt_qmfbank(
ia_sbr_qmf_filter_bank_struct *ptr_sbr_qmf, WORD16 no_bins, WORD16 lsb,
WORD16 usb, WORD16 chan, FLAG down_sample_flag,
WORD16 *sbr_qmf_synth_states, WORD32 *sbr_qmf_synth_states_32,
@@ -1074,7 +1071,7 @@
ptr_sbr_qmf->sixty4 = NO_SYNTHESIS_CHANNELS;
}
- return 0;
+ return;
}
WORD16 ixheaacd_create_sbrdec(ixheaacd_misc_tables *pstr_common_table,
@@ -1132,13 +1129,9 @@
ixheaacd_init_sbr_prev_framedata(ptr_sbr_channel->pstr_prev_frame_data,
time_slots);
- err = ixheaacd_create_hf_generator(&hs->str_hf_generator,
- hs->str_codec_qmf_bank.num_time_slots,
- chan, sbr_persistent_mem, ps_enable);
-
- if (err) {
- return (-1);
- }
+ ixheaacd_create_hf_generator(&hs->str_hf_generator,
+ hs->str_codec_qmf_bank.num_time_slots, chan,
+ sbr_persistent_mem, ps_enable);
hs->ptr_sbr_overlap_buf = sbr_persistent_mem->ptr_sbr_overlap_buf[chan];
diff --git a/decoder/ixheaacd_sbrdec_lpfuncs.c b/decoder/ixheaacd_sbrdec_lpfuncs.c
index 77e7ed6..5e535dc 100644
--- a/decoder/ixheaacd_sbrdec_lpfuncs.c
+++ b/decoder/ixheaacd_sbrdec_lpfuncs.c
@@ -90,7 +90,7 @@
h_cal_env->start_up = 1;
}
-WORD32 ixheaacd_derive_lim_band_tbl(
+VOID ixheaacd_derive_lim_band_tbl(
ia_sbr_header_data_struct *ptr_header_data,
const ia_patch_param_struct *p_str_patch_param, WORD16 num_patches,
ixheaacd_misc_tables *pstr_common_tables) {
@@ -186,7 +186,7 @@
}
*num_lf_bands = nr_lim;
- return 0;
+ return;
}
VOID ixheaacd_lean_sbrconcealment(
diff --git a/decoder/ixheaacd_sbrdecoder.c b/decoder/ixheaacd_sbrdecoder.c
index 53275f6..06452b3 100644
--- a/decoder/ixheaacd_sbrdecoder.c
+++ b/decoder/ixheaacd_sbrdecoder.c
@@ -203,7 +203,7 @@
err |= ixheaacd_reset_hf_generator(&ptr_sbr_dec->str_hf_generator,
ptr_header_data, audio_object_type);
- err |= ixheaacd_derive_lim_band_tbl(
+ ixheaacd_derive_lim_band_tbl(
ptr_header_data,
ptr_sbr_dec->str_hf_generator.pstr_settings->str_patch_param,
ptr_sbr_dec->str_hf_generator.pstr_settings->num_patches,
@@ -213,10 +213,9 @@
return err;
}
-WORD32 ixheaacd_prepare_upsamp(ia_sbr_header_data_struct **ptr_header_data,
- ia_sbr_channel_struct *pstr_sbr_channel[2],
- WORD32 num_channels) {
- WORD16 err = 0;
+VOID ixheaacd_prepare_upsamp(ia_sbr_header_data_struct **ptr_header_data,
+ ia_sbr_channel_struct *pstr_sbr_channel[2],
+ WORD32 num_channels) {
WORD32 lr;
ia_sbr_qmf_filter_bank_struct *sbr_qmf_bank;
@@ -235,7 +234,7 @@
sbr_qmf_bank->usb = NO_ANALYSIS_CHANNELS;
ptr_header_data[lr]->sync_state = UPSAMPLING;
}
- return err;
+ return;
}
IA_ERRORCODE ixheaacd_applysbr(
@@ -522,6 +521,7 @@
frame_status = ixheaacd_sbr_read_sce(
ptr_header_data[k], ptr_frame_data[k], self->pstr_ps_stereo_dec,
it_bit_buff, self->pstr_sbr_tables, audio_object_type);
+ if (frame_status < 0) return frame_status;
} else if (ptr_frame_data[k]->sbr_mode == PVC_SBR) {
frame_status = ixheaacd_sbr_read_pvc_sce(
ptr_frame_data[k], it_bit_buff, 0, self->ptr_pvc_data_str,
diff --git a/decoder/ixheaacd_struct_def.h b/decoder/ixheaacd_struct_def.h
index 57d2e00..d348d99 100644
--- a/decoder/ixheaacd_struct_def.h
+++ b/decoder/ixheaacd_struct_def.h
@@ -276,7 +276,7 @@
WORD32 ixheaacd_dec_mem_api(ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec,
WORD32 i_cmd, WORD32 i_idx, VOID *pv_value);
-WORD32 ixheaacd_fill_aac_mem_tables(
+VOID ixheaacd_fill_aac_mem_tables(
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec);
WORD32 ixheaacd_decoder_2_ga_hdr(
diff --git a/decoder/ixheaacd_tcx_fwd_alcnx.c b/decoder/ixheaacd_tcx_fwd_alcnx.c
index 617f20e..411bf35 100644
--- a/decoder/ixheaacd_tcx_fwd_alcnx.c
+++ b/decoder/ixheaacd_tcx_fwd_alcnx.c
@@ -235,10 +235,12 @@
ixheaacd_low_fq_deemphasis(x, lg, alfd_gains);
ixheaacd_lpc_coeff_wt_apply(lp_flt_coff_a + (ORDER + 1), i_ap);
- ixheaacd_lpc_to_td(i_ap, ORDER, gain1, usac_data->len_subfrm / 4);
+ err = ixheaacd_lpc_to_td(i_ap, ORDER, gain1, usac_data->len_subfrm / 4);
+ if (err) return err;
ixheaacd_lpc_coeff_wt_apply(lp_flt_coff_a + (2 * (ORDER + 1)), i_ap);
- ixheaacd_lpc_to_td(i_ap, ORDER, gain2, usac_data->len_subfrm / 4);
+ err = ixheaacd_lpc_to_td(i_ap, ORDER, gain2, usac_data->len_subfrm / 4);
+ if (err) return err;
energy = 0.01f;
for (i = 0; i < lg; i++) energy += x[i] * x[i];
diff --git a/decoder/ixheaacd_tcx_fwd_mdct.c b/decoder/ixheaacd_tcx_fwd_mdct.c
index af46596..de153bb 100644
--- a/decoder/ixheaacd_tcx_fwd_mdct.c
+++ b/decoder/ixheaacd_tcx_fwd_mdct.c
@@ -113,7 +113,7 @@
return;
}
-VOID ixheaacd_lpc_to_td(float *coeff, WORD32 order, float *gains, WORD32 lg) {
+WORD32 ixheaacd_lpc_to_td(float *coeff, WORD32 order, float *gains, WORD32 lg) {
FLOAT32 data_r[LEN_SUPERFRAME * 2];
FLOAT32 data_i[LEN_SUPERFRAME * 2];
FLOAT64 avg_fac;
@@ -125,6 +125,7 @@
FLOAT32 ftemp = 0;
FLOAT32 tmp, qfac;
WORD32 i, size_n;
+ WORD32 err = 0;
size_n = 2 * lg;
avg_fac = PI / (FLOAT32)(size_n);
@@ -152,7 +153,8 @@
idata_i[i] = (WORD32)(data_i[i] * ((WORD64)1 << qshift));
}
- ixheaacd_complex_fft(idata_r, idata_i, size_n, -1, &preshift);
+ err = ixheaacd_complex_fft(idata_r, idata_i, size_n, -1, &preshift);
+ if (err) return err;
qfac = 1.0f / ((FLOAT32)((WORD64)1 << (qshift - preshift)));
@@ -166,7 +168,7 @@
(FLOAT32)(1.0f / sqrt(data_r[i] * data_r[i] + data_i[i] * data_i[i]));
}
- return;
+ return err;
}
VOID ixheaacd_noise_shaping(FLOAT32 r[], WORD32 lg, WORD32 M, FLOAT32 g1[],
diff --git a/decoder/ixheaacd_td_mdct.h b/decoder/ixheaacd_td_mdct.h
index 934d969..ed8f13c 100644
--- a/decoder/ixheaacd_td_mdct.h
+++ b/decoder/ixheaacd_td_mdct.h
@@ -25,7 +25,7 @@
VOID ixheaacd_fix2float(WORD32 *int_xn1, FLOAT32 *xn1, WORD32 length,
WORD8 *shiftp, WORD32 *preshift);
-VOID ixheaacd_complex_fft(WORD32 *data_r, WORD32 *data_i, WORD32 len,
- WORD32 fft_mode, WORD32 *preshift);
+WORD32 ixheaacd_complex_fft(WORD32 *data_r, WORD32 *data_i, WORD32 len,
+ WORD32 fft_mode, WORD32 *preshift);
#endif
diff --git a/decoder/ixheaacd_windows.h b/decoder/ixheaacd_windows.h
index 05fc0f5..7d3a614 100644
--- a/decoder/ixheaacd_windows.h
+++ b/decoder/ixheaacd_windows.h
@@ -47,8 +47,8 @@
WORD32 ixheaacd_calc_window(WORD32 **win, WORD32 len, WORD32 wfun_select);
-void ixheaacd_acelp_imdct(WORD32 *imdct_in, WORD32 npoints, WORD8 *qshift,
- WORD32 *scratch);
+WORD32 ixheaacd_acelp_imdct(WORD32 *imdct_in, WORD32 npoints, WORD8 *qshift,
+ WORD32 *scratch);
typedef struct {
WORD32 lfac;