Loading lib_com/ivas_prot.h +4 −4 Original line number Diff line number Diff line Loading @@ -4833,7 +4833,7 @@ void ivas_lfe_enc( ivas_error ivas_create_lfe_dec( LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ const int32_t output_Fs, /* i : output sampling rate */ const float add_delay_s /* i : additional delay in seconds to lfe to sync with binaural filter*/ const float add_delay_s /* i : additional LFE delay to sync with binaural filter */ ); void ivas_lfe_dec_close( Loading @@ -4856,9 +4856,9 @@ void LFE_tdplc( ); void lfe_window_init( LFE_WINDOW_HANDLE hLFEWindow, const int32_t sampling_rate, const int16_t frame_len LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle */ const int32_t sampling_rate, /* i : sampling rate */ const int16_t frame_len /* i : frame length in samples */ ); void ivas_lfe_lpf_select_filt_coeff( Loading lib_com/ivas_spar_com.c +6 −3 Original line number Diff line number Diff line Loading @@ -266,9 +266,10 @@ int16_t ivas_get_bw_idx_from_sample_rate( *-----------------------------------------------------------------------------------------*/ void lfe_window_init( LFE_WINDOW_HANDLE hLFEWindow, const int32_t sampling_rate, const int16_t frame_len ) LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle */ const int32_t sampling_rate, /* i : sampling rate */ const int16_t frame_len /* i : frame length in samples */ ) { /* Set window coefficients */ if ( sampling_rate == 48000 ) Loading Loading @@ -1419,6 +1420,7 @@ static void ivas_calc_mat_inv( { double det_re; double re; ivas_calc_mat_det( dbl_in_re, dim, &det_re ); det = ( det_re * det_re ); /* assert to catch cases when input is singular matrix*/ Loading @@ -1445,6 +1447,7 @@ static void ivas_calc_mat_inv( ivas_calc_mat_det( dbl_in_re, dim, &det_re ); det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : min( det_re, -IVAS_DBL_EPS ); for ( i = 0; i < dim; i++ ) { for ( j = 0; j < dim; j++ ) Loading lib_dec/ivas_crend.c +8 −10 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ static ivas_error ivas_hrtf_init( hHrtf->pOut_to_bin_im[i][j] = NULL; } } for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { hHrtf->num_iterations_diffuse[j] = 0; Loading @@ -90,6 +91,7 @@ static ivas_error ivas_hrtf_init( return IVAS_ERR_OK; } /*------------------------------------------------------------------------- * ivas_hrtf_open() * Loading @@ -106,7 +108,7 @@ static ivas_error ivas_hrtf_open( { if ( ( pState = (HRTFS_HANDLE) count_malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for SPAR decoder\n" ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR decoder\n" ); } ivas_hrtf_init( pState ); Loading Loading @@ -813,7 +815,6 @@ ivas_error ivas_crend_open( st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtf->latency_s * 1000000000.f ); } st_ivas->hCrend = hCrend; return error; Loading Loading @@ -915,16 +916,13 @@ static ivas_error ivas_crend_convolver( float *pFreq_buf_im; float *pFreq_filt_re; float *pFreq_filt_im; int16_t i, j, m, nchan_out, subframe_length, nchan_intern, idx_in; int16_t i, j, k, m, nchan_out, subframe_length, nchan_intern, idx_in; float pOut[L_FRAME48k * 2]; float tmp_out_re[L_FRAME48k]; float tmp_out_im[L_FRAME48k]; int32_t offset, offset_in, offset_diffuse; int32_t output_Fs, k; AUDIO_CONFIG intern_config; float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; int16_t offset, offset_in, offset_diffuse; int32_t output_Fs; intern_config = st_ivas->intern_config; nchan_intern = audioCfg2channels( intern_config ); nchan_intern = audioCfg2channels( st_ivas->intern_config ); nchan_out = st_ivas->hDecoderConfig->nchan_out; output_Fs = st_ivas->hDecoderConfig->output_Fs; subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; Loading lib_dec/ivas_dec.c +7 −9 Original line number Diff line number Diff line Loading @@ -221,8 +221,7 @@ ivas_error ivas_dec( set_s( nb_bits_metadata, 0, MAX_SCE ); /* read parameters from the bitstream */ if ( ( st_ivas->hQMetaData != NULL ) && ( st_ivas->sba_mode != SBA_MODE_SPAR ) ) if ( st_ivas->hQMetaData != NULL && st_ivas->sba_mode != SBA_MODE_SPAR ) { st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; Loading @@ -240,12 +239,12 @@ ivas_error ivas_dec( } else if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { if ( ( st_ivas->hQMetaData != NULL ) && ( SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ) ) if ( st_ivas->hQMetaData != NULL ) { st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, st_ivas->hSpar->hSparFoa->dirac_to_spar_md_bands ); ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, st_ivas->hSpar->hSparFoa->dirac_to_spar_md_bands ); } if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; Loading Loading @@ -329,7 +328,7 @@ ivas_error ivas_dec( { ivas_sba_linear_renderer( output, output_frame, nchan_remapped, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); } else if ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->sba_mode != SBA_MODE_SPAR ) ) else if ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->sba_mode != SBA_MODE_SPAR ) { ivas_dirac_dec( st_ivas, output, nchan_remapped, NULL, NULL, -1 ); } Loading Loading @@ -472,8 +471,7 @@ ivas_error ivas_dec( /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, output, output_frame, n, LFE_CHANNEL ); } Loading Loading @@ -567,7 +565,7 @@ ivas_error ivas_dec( { st_ivas->ini_frame++; } if ( st_ivas->ini_active_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) && ivas_total_brate > IVAS_SID_4k4 ) if ( st_ivas->ini_active_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) && ivas_total_brate > IVAS_SID_4k4 ) // VE: looks starnge: ini_frame -> ini_frame_active ? { st_ivas->ini_active_frame++; } Loading lib_dec/ivas_dirac_dec.c +0 −1 Original line number Diff line number Diff line Loading @@ -1342,7 +1342,6 @@ void ivas_dirac_dec_read_BS( *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT, sba_mode ); for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0]; Loading Loading
lib_com/ivas_prot.h +4 −4 Original line number Diff line number Diff line Loading @@ -4833,7 +4833,7 @@ void ivas_lfe_enc( ivas_error ivas_create_lfe_dec( LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ const int32_t output_Fs, /* i : output sampling rate */ const float add_delay_s /* i : additional delay in seconds to lfe to sync with binaural filter*/ const float add_delay_s /* i : additional LFE delay to sync with binaural filter */ ); void ivas_lfe_dec_close( Loading @@ -4856,9 +4856,9 @@ void LFE_tdplc( ); void lfe_window_init( LFE_WINDOW_HANDLE hLFEWindow, const int32_t sampling_rate, const int16_t frame_len LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle */ const int32_t sampling_rate, /* i : sampling rate */ const int16_t frame_len /* i : frame length in samples */ ); void ivas_lfe_lpf_select_filt_coeff( Loading
lib_com/ivas_spar_com.c +6 −3 Original line number Diff line number Diff line Loading @@ -266,9 +266,10 @@ int16_t ivas_get_bw_idx_from_sample_rate( *-----------------------------------------------------------------------------------------*/ void lfe_window_init( LFE_WINDOW_HANDLE hLFEWindow, const int32_t sampling_rate, const int16_t frame_len ) LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle */ const int32_t sampling_rate, /* i : sampling rate */ const int16_t frame_len /* i : frame length in samples */ ) { /* Set window coefficients */ if ( sampling_rate == 48000 ) Loading Loading @@ -1419,6 +1420,7 @@ static void ivas_calc_mat_inv( { double det_re; double re; ivas_calc_mat_det( dbl_in_re, dim, &det_re ); det = ( det_re * det_re ); /* assert to catch cases when input is singular matrix*/ Loading @@ -1445,6 +1447,7 @@ static void ivas_calc_mat_inv( ivas_calc_mat_det( dbl_in_re, dim, &det_re ); det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : min( det_re, -IVAS_DBL_EPS ); for ( i = 0; i < dim; i++ ) { for ( j = 0; j < dim; j++ ) Loading
lib_dec/ivas_crend.c +8 −10 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ static ivas_error ivas_hrtf_init( hHrtf->pOut_to_bin_im[i][j] = NULL; } } for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { hHrtf->num_iterations_diffuse[j] = 0; Loading @@ -90,6 +91,7 @@ static ivas_error ivas_hrtf_init( return IVAS_ERR_OK; } /*------------------------------------------------------------------------- * ivas_hrtf_open() * Loading @@ -106,7 +108,7 @@ static ivas_error ivas_hrtf_open( { if ( ( pState = (HRTFS_HANDLE) count_malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for SPAR decoder\n" ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR decoder\n" ); } ivas_hrtf_init( pState ); Loading Loading @@ -813,7 +815,6 @@ ivas_error ivas_crend_open( st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtf->latency_s * 1000000000.f ); } st_ivas->hCrend = hCrend; return error; Loading Loading @@ -915,16 +916,13 @@ static ivas_error ivas_crend_convolver( float *pFreq_buf_im; float *pFreq_filt_re; float *pFreq_filt_im; int16_t i, j, m, nchan_out, subframe_length, nchan_intern, idx_in; int16_t i, j, k, m, nchan_out, subframe_length, nchan_intern, idx_in; float pOut[L_FRAME48k * 2]; float tmp_out_re[L_FRAME48k]; float tmp_out_im[L_FRAME48k]; int32_t offset, offset_in, offset_diffuse; int32_t output_Fs, k; AUDIO_CONFIG intern_config; float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; int16_t offset, offset_in, offset_diffuse; int32_t output_Fs; intern_config = st_ivas->intern_config; nchan_intern = audioCfg2channels( intern_config ); nchan_intern = audioCfg2channels( st_ivas->intern_config ); nchan_out = st_ivas->hDecoderConfig->nchan_out; output_Fs = st_ivas->hDecoderConfig->output_Fs; subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; Loading
lib_dec/ivas_dec.c +7 −9 Original line number Diff line number Diff line Loading @@ -221,8 +221,7 @@ ivas_error ivas_dec( set_s( nb_bits_metadata, 0, MAX_SCE ); /* read parameters from the bitstream */ if ( ( st_ivas->hQMetaData != NULL ) && ( st_ivas->sba_mode != SBA_MODE_SPAR ) ) if ( st_ivas->hQMetaData != NULL && st_ivas->sba_mode != SBA_MODE_SPAR ) { st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; Loading @@ -240,12 +239,12 @@ ivas_error ivas_dec( } else if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { if ( ( st_ivas->hQMetaData != NULL ) && ( SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ) ) if ( st_ivas->hQMetaData != NULL ) { st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, st_ivas->hSpar->hSparFoa->dirac_to_spar_md_bands ); ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, st_ivas->hSpar->hSparFoa->dirac_to_spar_md_bands ); } if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; Loading Loading @@ -329,7 +328,7 @@ ivas_error ivas_dec( { ivas_sba_linear_renderer( output, output_frame, nchan_remapped, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); } else if ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->sba_mode != SBA_MODE_SPAR ) ) else if ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->sba_mode != SBA_MODE_SPAR ) { ivas_dirac_dec( st_ivas, output, nchan_remapped, NULL, NULL, -1 ); } Loading Loading @@ -472,8 +471,7 @@ ivas_error ivas_dec( /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, output, output_frame, n, LFE_CHANNEL ); } Loading Loading @@ -567,7 +565,7 @@ ivas_error ivas_dec( { st_ivas->ini_frame++; } if ( st_ivas->ini_active_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) && ivas_total_brate > IVAS_SID_4k4 ) if ( st_ivas->ini_active_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) && ivas_total_brate > IVAS_SID_4k4 ) // VE: looks starnge: ini_frame -> ini_frame_active ? { st_ivas->ini_active_frame++; } Loading
lib_dec/ivas_dirac_dec.c +0 −1 Original line number Diff line number Diff line Loading @@ -1342,7 +1342,6 @@ void ivas_dirac_dec_read_BS( *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT, sba_mode ); for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0]; Loading