diff options
| author | Ray Essick <essick@google.com> | 2019-01-03 03:26:10 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-01-03 03:26:10 +0000 |
| commit | c9062c1c4de3d6f0177cf9ea02431f766db42ae7 (patch) | |
| tree | 6df74d8a511b18e87097b61cd987f57cb6896e01 | |
| parent | e0c41aae881685701b6c63aae86d09683f57aae8 (diff) | |
| parent | b0c549e5d8b348697cd25a3135cf7c95b98717e3 (diff) | |
| download | platform_external_libxaac-pie-b4s4-dev.tar.gz platform_external_libxaac-pie-b4s4-dev.tar.bz2 platform_external_libxaac-pie-b4s4-dev.zip | |
Merge "Fix for crash in ixheaacd_esbr_synthesis_regrp" into pi-devpie-b4s4-dev
| -rw-r--r-- | decoder/ixheaacd_env_extr.h | 13 | ||||
| -rw-r--r-- | decoder/ixheaacd_esbr_envcal.c | 36 |
2 files changed, 25 insertions, 24 deletions
diff --git a/decoder/ixheaacd_env_extr.h b/decoder/ixheaacd_env_extr.h index 5078d98..109dfe2 100644 --- a/decoder/ixheaacd_env_extr.h +++ b/decoder/ixheaacd_env_extr.h @@ -19,7 +19,7 @@ */ #ifndef IXHEAACD_ENV_EXTR_H #define IXHEAACD_ENV_EXTR_H - +#include "ixheaacd_error_standards.h" #define ENV_EXP_FRACT 0 #define EXP_BITS 6 @@ -170,12 +170,11 @@ VOID ixheaacd_huffman_decode(WORD32 it_bit_buff, WORD16 *h_index, WORD16 *len, const UWORD16 *input_table, const UWORD32 *idx_table); -VOID ixheaacd_createlimiterbands(WORD32 lim_table[4][12 + 1], - WORD32 gate_mode[4], WORD16 *freq_band_tbl, - WORD32 ixheaacd_num_bands, - WORD32 x_over_qmf[MAX_NUM_PATCHES], - WORD32 b_patching_mode, WORD32 upsamp_4_flag, - struct ixheaacd_lpp_trans_patch *patch_param); +IA_ERRORCODE ixheaacd_createlimiterbands( + WORD32 lim_table[4][12 + 1], WORD32 gate_mode[4], WORD16 *freq_band_tbl, + WORD32 ixheaacd_num_bands, WORD32 x_over_qmf[MAX_NUM_PATCHES], + WORD32 b_patching_mode, WORD32 upsamp_4_flag, + struct ixheaacd_lpp_trans_patch *patch_param); VOID ixheaacd_apply_inter_tes(FLOAT32 *qmf_real1, FLOAT32 *qmf_imag1, FLOAT32 *qmf_real, FLOAT32 *qmf_imag, diff --git a/decoder/ixheaacd_esbr_envcal.c b/decoder/ixheaacd_esbr_envcal.c index b90df22..e1bb1c7 100644 --- a/decoder/ixheaacd_esbr_envcal.c +++ b/decoder/ixheaacd_esbr_envcal.c @@ -167,19 +167,21 @@ WORD32 ixheaacd_sbr_env_calc(ia_sbr_frame_info_data_struct *frame_data, esbr_start_up = 1; esbr_start_up_pvc = 1; phase_index = 0; - ixheaacd_createlimiterbands( - (*lim_table), (*gate_mode), - frame_data->pstr_sbr_header->pstr_freq_band_data->freq_band_tbl_lo, - num_sf_bands[LOW], x_over_qmf, frame_data->sbr_patching_mode, - upsamp_4_flag, &frame_data->patch_param); + if (ixheaacd_createlimiterbands( + (*lim_table), (*gate_mode), + frame_data->pstr_sbr_header->pstr_freq_band_data->freq_band_tbl_lo, + num_sf_bands[LOW], x_over_qmf, frame_data->sbr_patching_mode, + upsamp_4_flag, &frame_data->patch_param)) + return IA_FATAL_ERROR; } if (frame_data->sbr_patching_mode != frame_data->prev_sbr_patching_mode) { - ixheaacd_createlimiterbands( - (*lim_table), (*gate_mode), - frame_data->pstr_sbr_header->pstr_freq_band_data->freq_band_tbl_lo, - num_sf_bands[LOW], x_over_qmf, frame_data->sbr_patching_mode, - upsamp_4_flag, &frame_data->patch_param); + if (ixheaacd_createlimiterbands( + (*lim_table), (*gate_mode), + frame_data->pstr_sbr_header->pstr_freq_band_data->freq_band_tbl_lo, + num_sf_bands[LOW], x_over_qmf, frame_data->sbr_patching_mode, + upsamp_4_flag, &frame_data->patch_param)) + return IA_FATAL_ERROR; frame_data->prev_sbr_patching_mode = frame_data->sbr_patching_mode; } @@ -789,12 +791,11 @@ WORD32 ixheaacd_sbr_env_calc(ia_sbr_frame_info_data_struct *frame_data, return 0; } -VOID ixheaacd_createlimiterbands(WORD32 lim_table[4][12 + 1], - WORD32 gate_mode[4], WORD16 *freq_band_tbl, - WORD32 ixheaacd_num_bands, - WORD32 x_over_qmf[MAX_NUM_PATCHES], - WORD32 b_patching_mode, WORD32 upsamp_4_flag, - struct ixheaacd_lpp_trans_patch *patch_param) { +IA_ERRORCODE ixheaacd_createlimiterbands( + WORD32 lim_table[4][12 + 1], WORD32 gate_mode[4], WORD16 *freq_band_tbl, + WORD32 ixheaacd_num_bands, WORD32 x_over_qmf[MAX_NUM_PATCHES], + WORD32 b_patching_mode, WORD32 upsamp_4_flag, + struct ixheaacd_lpp_trans_patch *patch_param) { WORD32 i, j, k, is_patch_border[2]; WORD32 patch_borders[MAX_NUM_PATCHES + 1]; WORD32 temp_limiter_band_calc[32 + MAX_NUM_PATCHES + 1]; @@ -887,11 +888,12 @@ VOID ixheaacd_createlimiterbands(WORD32 lim_table[4][12 + 1], } } } - + if (gate_mode[i] > 12) return IA_FATAL_ERROR; for (k = 0; k <= gate_mode[i]; k++) { lim_table[i][k] = temp_limiter_band_calc[k]; } } + return IA_NO_ERROR; } VOID ixheaacd_apply_inter_tes(FLOAT32 *qmf_real1, FLOAT32 *qmf_imag1, |
