Loading lib_com/ivas_fb_mixer.c +14 −0 Original line number Diff line number Diff line Loading @@ -219,7 +219,11 @@ ivas_error ivas_FB_mixer_open( } else { #ifdef SBA_TD_RESIDUAL num_chs_alloc = 1; /* only W channel processed for predicting YZX */ #else num_chs_alloc = fb_cfg->num_out_chans; #endif } for ( i = 0; i < num_chs_alloc; i++ ) Loading Loading @@ -382,7 +386,11 @@ void ivas_FB_mixer_close( } else { #ifdef SBA_TD_RESIDUAL num_chs_alloc = 1; /* only W channel processed for predicting YZX */ #else num_chs_alloc = fb_cfg->num_out_chans; #endif } if ( hFbMixer != NULL ) Loading Loading @@ -498,7 +506,11 @@ void ivas_fb_mixer_pcm_ingest( } else { #ifdef SBA_TD_RESIDUAL num_chs_ingest = 1; /* forward Filterbank MDFT only on W */ #else num_chs_ingest = fb_cfg->num_out_chans; #endif } for ( i = 0; i < fb_cfg->num_in_chans; i++ ) Loading Loading @@ -764,7 +776,9 @@ void ivas_fb_mixer_get_in_out_mapping( for ( i = 1; i < fb_cfg->num_out_chans; i++ ) { in_out_mixer_map[i][0] = 1; #ifndef SBA_TD_RESIDUAL in_out_mixer_map[i][order[i]] = 1; #endif } } } Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ #define FIX_401_DIRAC_RENDERER_META_READ_INDICES /* Nokia: Issue 401: Fix metadata reading indices in DirAC renderer. */ #define FIX_406_IVAS_POSITION /* Eri: Issue 406: Unify IVAS_POSITION to use IVAS_VECTOR3 instead */ #define SBA_TD_RESIDUAL /* DLB : SBA ancoder complexity optimization. Avoid forward MDFTs. */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif lib_enc/ivas_spar_encoder.c +56 −1 Original line number Diff line number Diff line Loading @@ -405,7 +405,11 @@ static ivas_error ivas_spar_enc_process( IVAS_QMETADATA_HANDLE hQMetaData = st_ivas->hQMetaData; int16_t ts, l_ts, orig_dirac_bands, num_del_samples; float *ppIn_FR_real[IVAS_SPAR_MAX_CH], *ppIn_FR_imag[IVAS_SPAR_MAX_CH]; #ifdef SBA_TD_RESIDUAL float wyzx_del_buf[FOA_CHANNELS][IVAS_FB_1MS_48K_SAMP]; #else float w_del_buf[IVAS_FB_1MS_48K_SAMP]; #endif float dir[3], avg_dir[3]; float energySum, vecLen; Loading Loading @@ -443,7 +447,19 @@ static ivas_error ivas_spar_enc_process( /* store previous input samples for W in local buffer */ assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); #ifdef SBA_TD_RESIDUAL if (hSpar->hFbMixer->fb_cfg->active_w_mixing == 0) { /* fill delay (1 ms) buffer for all Transport channels */ for ( i = 0; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++ ) { int idx = hSpar->hFbMixer->fb_cfg->remix_order[i]; mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[idx][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], wyzx_del_buf[idx], num_del_samples ); } } #else mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[0][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], w_del_buf, num_del_samples ); #endif /*-----------------------------------------------------------------------------------------* * FB mixer ingest Loading Loading @@ -718,14 +734,53 @@ static ivas_error ivas_spar_enc_process( #ifdef DEBUG_SBA_AUDIO_DUMP ivas_spar_dump_signal_wav( input_frame, p_pcm_tmp, NULL, nchan_transport, spar_foa_enc_wav[1], "ivas_fb_mixer_process()" ); #endif #ifdef SBA_TD_RESIDUAL if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { /* delayed W */ mvr2r( wyzx_del_buf[0], p_pcm_tmp[0], num_del_samples); mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples); for ( i = 1; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++ ) { int idx = hSpar->hFbMixer->fb_cfg->remix_order[i]; /* delayed, reorderd and accumulated with (negative) prediction from W */ v_add( wyzx_del_buf[idx], p_pcm_tmp[i], p_pcm_tmp[i], num_del_samples ); v_add( data_f[idx], p_pcm_tmp[i] + num_del_samples, p_pcm_tmp[i] + num_del_samples, input_frame - num_del_samples); } } #else /* move delayed W into output buffer unless activeW operation*/ if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { mvr2r( w_del_buf, p_pcm_tmp[0], num_del_samples ); mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples ); } #endif #if 0 /* SBA_TD_RESIDUAL */ { static FILE *fid = 0; static int samplesWritten = 0; int s; if (!fid) { fid = fopen("enc_pcm.txt", "wt"); } if (samplesWritten < 8 * 48000) { for (s = 0; s < input_frame; s++) { for (i = 0; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++) { fprintf(fid, "%.8f ", p_pcm_tmp[i][s]); } fprintf(fid, "\n"); } samplesWritten += input_frame; } } #endif /*-----------------------------------------------------------------------------------------* * PCA encoder *-----------------------------------------------------------------------------------------*/ Loading Loading
lib_com/ivas_fb_mixer.c +14 −0 Original line number Diff line number Diff line Loading @@ -219,7 +219,11 @@ ivas_error ivas_FB_mixer_open( } else { #ifdef SBA_TD_RESIDUAL num_chs_alloc = 1; /* only W channel processed for predicting YZX */ #else num_chs_alloc = fb_cfg->num_out_chans; #endif } for ( i = 0; i < num_chs_alloc; i++ ) Loading Loading @@ -382,7 +386,11 @@ void ivas_FB_mixer_close( } else { #ifdef SBA_TD_RESIDUAL num_chs_alloc = 1; /* only W channel processed for predicting YZX */ #else num_chs_alloc = fb_cfg->num_out_chans; #endif } if ( hFbMixer != NULL ) Loading Loading @@ -498,7 +506,11 @@ void ivas_fb_mixer_pcm_ingest( } else { #ifdef SBA_TD_RESIDUAL num_chs_ingest = 1; /* forward Filterbank MDFT only on W */ #else num_chs_ingest = fb_cfg->num_out_chans; #endif } for ( i = 0; i < fb_cfg->num_in_chans; i++ ) Loading Loading @@ -764,7 +776,9 @@ void ivas_fb_mixer_get_in_out_mapping( for ( i = 1; i < fb_cfg->num_out_chans; i++ ) { in_out_mixer_map[i][0] = 1; #ifndef SBA_TD_RESIDUAL in_out_mixer_map[i][order[i]] = 1; #endif } } } Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ #define FIX_401_DIRAC_RENDERER_META_READ_INDICES /* Nokia: Issue 401: Fix metadata reading indices in DirAC renderer. */ #define FIX_406_IVAS_POSITION /* Eri: Issue 406: Unify IVAS_POSITION to use IVAS_VECTOR3 instead */ #define SBA_TD_RESIDUAL /* DLB : SBA ancoder complexity optimization. Avoid forward MDFTs. */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif
lib_enc/ivas_spar_encoder.c +56 −1 Original line number Diff line number Diff line Loading @@ -405,7 +405,11 @@ static ivas_error ivas_spar_enc_process( IVAS_QMETADATA_HANDLE hQMetaData = st_ivas->hQMetaData; int16_t ts, l_ts, orig_dirac_bands, num_del_samples; float *ppIn_FR_real[IVAS_SPAR_MAX_CH], *ppIn_FR_imag[IVAS_SPAR_MAX_CH]; #ifdef SBA_TD_RESIDUAL float wyzx_del_buf[FOA_CHANNELS][IVAS_FB_1MS_48K_SAMP]; #else float w_del_buf[IVAS_FB_1MS_48K_SAMP]; #endif float dir[3], avg_dir[3]; float energySum, vecLen; Loading Loading @@ -443,7 +447,19 @@ static ivas_error ivas_spar_enc_process( /* store previous input samples for W in local buffer */ assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); #ifdef SBA_TD_RESIDUAL if (hSpar->hFbMixer->fb_cfg->active_w_mixing == 0) { /* fill delay (1 ms) buffer for all Transport channels */ for ( i = 0; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++ ) { int idx = hSpar->hFbMixer->fb_cfg->remix_order[i]; mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[idx][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], wyzx_del_buf[idx], num_del_samples ); } } #else mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[0][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], w_del_buf, num_del_samples ); #endif /*-----------------------------------------------------------------------------------------* * FB mixer ingest Loading Loading @@ -718,14 +734,53 @@ static ivas_error ivas_spar_enc_process( #ifdef DEBUG_SBA_AUDIO_DUMP ivas_spar_dump_signal_wav( input_frame, p_pcm_tmp, NULL, nchan_transport, spar_foa_enc_wav[1], "ivas_fb_mixer_process()" ); #endif #ifdef SBA_TD_RESIDUAL if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { /* delayed W */ mvr2r( wyzx_del_buf[0], p_pcm_tmp[0], num_del_samples); mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples); for ( i = 1; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++ ) { int idx = hSpar->hFbMixer->fb_cfg->remix_order[i]; /* delayed, reorderd and accumulated with (negative) prediction from W */ v_add( wyzx_del_buf[idx], p_pcm_tmp[i], p_pcm_tmp[i], num_del_samples ); v_add( data_f[idx], p_pcm_tmp[i] + num_del_samples, p_pcm_tmp[i] + num_del_samples, input_frame - num_del_samples); } } #else /* move delayed W into output buffer unless activeW operation*/ if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { mvr2r( w_del_buf, p_pcm_tmp[0], num_del_samples ); mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples ); } #endif #if 0 /* SBA_TD_RESIDUAL */ { static FILE *fid = 0; static int samplesWritten = 0; int s; if (!fid) { fid = fopen("enc_pcm.txt", "wt"); } if (samplesWritten < 8 * 48000) { for (s = 0; s < input_frame; s++) { for (i = 0; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++) { fprintf(fid, "%.8f ", p_pcm_tmp[i][s]); } fprintf(fid, "\n"); } samplesWritten += input_frame; } } #endif /*-----------------------------------------------------------------------------------------* * PCA encoder *-----------------------------------------------------------------------------------------*/ Loading