Skip to content
Commits on Source (102)
...@@ -406,6 +406,7 @@ int main( ...@@ -406,6 +406,7 @@ int main(
} }
} }
#ifndef FIX_1158_FASTCONV_REVERB_HRTF
/*------------------------------------------------------------------------------------------* /*------------------------------------------------------------------------------------------*
* Open renderer configuration reader file * Open renderer configuration reader file
*------------------------------------------------------------------------------------------*/ *------------------------------------------------------------------------------------------*/
...@@ -426,6 +427,7 @@ int main( ...@@ -426,6 +427,7 @@ int main(
goto cleanup; goto cleanup;
} }
} }
#endif
/*------------------------------------------------------------------------------------------* /*------------------------------------------------------------------------------------------*
* Configure the decoder * Configure the decoder
...@@ -619,6 +621,14 @@ int main( ...@@ -619,6 +621,14 @@ int main(
goto cleanup; goto cleanup;
} }
#ifdef FIX_1158_FASTCONV_REVERB_HRTF
if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
goto cleanup;
}
#endif
if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
...@@ -3503,14 +3513,10 @@ static ivas_error decodeVoIP( ...@@ -3503,14 +3513,10 @@ static ivas_error decodeVoIP(
} }
vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
frame++; frame++;
#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE
if ( vec_pos_update == 0 ) if ( vec_pos_update == 0 )
{ {
systemTime_ms += vec_pos_len * systemTimeInc_ms; systemTime_ms += vec_pos_len * systemTimeInc_ms;
} }
#else
systemTime_ms += systemTimeInc_ms;
#endif
#ifdef WMOPS #ifdef WMOPS
update_mem(); update_mem();
...@@ -3519,7 +3525,6 @@ static ivas_error decodeVoIP( ...@@ -3519,7 +3525,6 @@ static ivas_error decodeVoIP(
} }
#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE
int16_t nSamplesFlushed = 0; int16_t nSamplesFlushed = 0;
/* decode and get samples */ /* decode and get samples */
...@@ -3599,7 +3604,6 @@ static ivas_error decodeVoIP( ...@@ -3599,7 +3604,6 @@ static ivas_error decodeVoIP(
} }
} }
} }
#endif
/*------------------------------------------------------------------------------------------* /*------------------------------------------------------------------------------------------*
......
...@@ -1586,6 +1586,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1586,6 +1586,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" ); fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
else else
{ {
...@@ -1597,6 +1598,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1597,6 +1598,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too high number of ISM channels!\n\n" ); fprintf( stderr, "Error: Too high number of ISM channels!\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
} }
...@@ -1604,6 +1606,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1604,6 +1606,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" ); fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
if ( i < argc - 4 ) if ( i < argc - 4 )
{ {
...@@ -1623,7 +1626,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1623,7 +1626,7 @@ static bool parseCmdlIVAS_enc(
default: default:
fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" ); fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" );
usage_enc(); usage_enc();
break; return false;
} }
} }
...@@ -1648,6 +1651,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1648,6 +1651,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: not enough arguments\n\n" ); fprintf( stderr, "Error: not enough arguments\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
...@@ -1660,6 +1664,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1660,6 +1664,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: not enough MASA arguments\n\n" ); fprintf( stderr, "Error: not enough MASA arguments\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 ) else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 )
...@@ -1678,6 +1683,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1678,6 +1683,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" ); fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
else else
{ {
...@@ -1689,6 +1695,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1689,6 +1695,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too high number of ISM channels!\n\n" ); fprintf( stderr, "Error: Too high number of ISM channels!\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
} }
...@@ -1696,6 +1703,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1696,6 +1703,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" ); fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
if ( i < argc - 4 ) if ( i < argc - 4 )
...@@ -1747,6 +1755,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1747,6 +1755,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: not enough arguments\n\n" ); fprintf( stderr, "Error: not enough arguments\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
} }
......
...@@ -183,7 +183,9 @@ typedef enum ...@@ -183,7 +183,9 @@ typedef enum
typedef enum typedef enum
{ {
#ifndef FIX_1101_CLEANING_JBM_CALL
TC_BUFFER_MODE_NONE = 0, TC_BUFFER_MODE_NONE = 0,
#endif
TC_BUFFER_MODE_RENDERER, TC_BUFFER_MODE_RENDERER,
TC_BUFFER_MODE_BUFFER TC_BUFFER_MODE_BUFFER
} TC_BUFFER_MODE; } TC_BUFFER_MODE;
......
...@@ -3085,7 +3085,11 @@ void mctStereoIGF_enc( ...@@ -3085,7 +3085,11 @@ void mctStereoIGF_enc(
MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */
Encoder_State **sts, /* i/o: encoder state structure */ Encoder_State **sts, /* i/o: encoder state structure */
float *orig_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : MDCT spectrum for ITF */ float *orig_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : MDCT spectrum for ITF */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */
#else
float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */
#endif
float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect. */ float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect. */
float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */
const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */
......
...@@ -2473,6 +2473,13 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_ ...@@ -2473,6 +2473,13 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_
* MASA ROM tables * MASA ROM tables
*----------------------------------------------------------------------------------*/ *----------------------------------------------------------------------------------*/
   
#ifdef FIX_1121_MASA_DESCRIPTOR
const uint8_t ivasmasaFormatDescriptor[8] =
{
0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */
};
#endif
const float diffuseness_reconstructions_hr[HR_MASA_ER_LEVELS] = const float diffuseness_reconstructions_hr[HR_MASA_ER_LEVELS] =
{ {
0.00f, 0.00f,
......
...@@ -264,6 +264,10 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PA ...@@ -264,6 +264,10 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PA
* MASA ROM tables * MASA ROM tables
*----------------------------------------------------------------------------------*/ *----------------------------------------------------------------------------------*/
#ifdef FIX_1121_MASA_DESCRIPTOR
extern const uint8_t ivasmasaFormatDescriptor[8]; /* "IVASMASA" */
#endif
extern const int16_t bits_direction_masa[DIRAC_DIFFUSE_LEVELS]; extern const int16_t bits_direction_masa[DIRAC_DIFFUSE_LEVELS];
extern const int16_t no_theta_masa[NO_SPHERICAL_GRIDS - 2]; extern const int16_t no_theta_masa[NO_SPHERICAL_GRIDS - 2];
extern const int16_t no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; extern const int16_t no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA];
......
...@@ -147,30 +147,8 @@ ...@@ -147,30 +147,8 @@
/* ################### Start FIXES switches ########################### */ /* ################### Start FIXES switches ########################### */
#define NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */
#define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold */
#define FIX_828_PORT_1152_FROM_FLT_REPO /* FhG: fix for issue 828 - fix uninitialized value used in BASOP */
#define NONE_BE_FIX_816_LFE_PLC_FLOAT /* DLB: issue 816: reduce required precision to float for LFE-PLC*/
#define FIX_835_PARAMMC_BUFFER_VALUES /* FhG: issue 835: wide range of buffer values for cx in ParamMC */
#define NONBE_FIX_943_PORT_1208_DFT_STEREO_PLC_BURST /* Ericsson: BASOP Issue 943, Float Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */
#define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */
#define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */
#define NONBE_FIX_1205_TD_STEREO_MOD_CT /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */
#define NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3 /*Dolby: issue 1213: fix for inverse of det < 0*/
#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */
#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */
#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/
#define NONBE_1211_DTX_BR_SWITCHING /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */
#define NONBE_FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
#define NONBE_1273_ISM_METADATA_COUNTER /* VA: FLP issue 1273: fix counter overflow in ISM metadata encoder */
#define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */
#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */
#define NONBE_1319_M2R_PRECISION_ALIGN /* Nokia: bring updates from PC code related to OMASA masa2total ratios */
#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */
#define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */
/* #################### End FIXES switches ############################ */ /* #################### End FIXES switches ############################ */
...@@ -204,13 +182,27 @@ ...@@ -204,13 +182,27 @@
#define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ #define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/
#define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ #define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */
#define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */
#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/
#define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */
#define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */
#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */
#define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */
#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */
#define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */
#define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */
#define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ #define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */
#define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */
#define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/
#define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */
#define NONBE_SVD_OPTIMIZATION
#define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */
#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */
#define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */
#define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */
/* #################### End BASOP porting switches ############################ */ /* #################### End BASOP porting switches ############################ */
......
...@@ -712,7 +712,11 @@ ivas_error acelp_core_dec( ...@@ -712,7 +712,11 @@ ivas_error acelp_core_dec(
old_exc_s = st->old_exc + L_EXC_MEM_DEC - st->L_frame; old_exc_s = st->old_exc + L_EXC_MEM_DEC - st->L_frame;
tmpF = *old_exc_s; tmpF = *old_exc_s;
st->mem_deemph = old_exc_s[st->L_frame - 1]; st->mem_deemph = old_exc_s[st->L_frame - 1];
#ifdef NONBE_1131_ACELP_OOB
preemph( old_exc_s, st->preemph_fac, st->L_frame, &tmpF );
#else
preemph( old_exc_s, st->preemph_fac, L_FRAME16k, &tmpF ); preemph( old_exc_s, st->preemph_fac, L_FRAME16k, &tmpF );
#endif
mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M ); mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M );
residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame ); residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame );
} }
......
...@@ -1505,11 +1505,7 @@ void decoder_tcx_tns( ...@@ -1505,11 +1505,7 @@ void decoder_tcx_tns(
hTcxCfg->tcx_last_overlap_mode = hTcxCfg->tcx_curr_overlap_mode; hTcxCfg->tcx_last_overlap_mode = hTcxCfg->tcx_curr_overlap_mode;
} }
#ifdef NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT
if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 && whitenedDomain ) || ( L_spec > L_frameTCX ) ) if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 && whitenedDomain ) || ( L_spec > L_frameTCX ) )
#else
if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 ) || ( L_spec > L_frameTCX ) )
#endif
{ {
L = L_spec; L = L_spec;
} }
...@@ -1552,11 +1548,7 @@ void decoder_tcx_tns( ...@@ -1552,11 +1548,7 @@ void decoder_tcx_tns(
if ( ( L_frame == st->L_frame >> 1 ) && st->tcxonly && isTCX5 ) if ( ( L_frame == st->L_frame >> 1 ) && st->tcxonly && isTCX5 )
{ {
#ifdef NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT
if ( st->element_mode == EVS_MONO || ( L_spec < L_frameTCX && !whitenedDomain ) ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */ if ( st->element_mode == EVS_MONO || ( L_spec < L_frameTCX && !whitenedDomain ) ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
#else
if ( st->element_mode == EVS_MONO || L_spec < L_frameTCX ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
#endif
{ {
tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC ); tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC );
} }
......
...@@ -2241,27 +2241,40 @@ void ivas_dirac_dec_render_sf( ...@@ -2241,27 +2241,40 @@ void ivas_dirac_dec_render_sf(
/* render objects in combined format onto the CICP19 channels for BINAURAL_ROOM_IR */ /* render objects in combined format onto the CICP19 channels for BINAURAL_ROOM_IR */
if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
{ {
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
int16_t in_ch; int16_t in_ch;
for ( in_ch = 0; in_ch < st_ivas->nchan_ism; in_ch++ ) for ( in_ch = 0; in_ch < st_ivas->nchan_ism; in_ch++ )
{ {
int16_t j, k, j2, l; #endif
int16_t num_objects, nchan_out_woLFE, lfe_index; int16_t j, k, l;
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
int16_t j2, lfe_index;
#endif
int16_t num_objects, nchan_out_woLFE;
int16_t az1, el1; int16_t az1, el1;
int16_t n_slots_to_render; int16_t n_slots_to_render;
int16_t n_samples_to_render; int16_t n_samples_to_render;
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
int16_t interp_offset; int16_t interp_offset;
#endif
float gain, prev_gain; float gain, prev_gain;
num_objects = st_ivas->nchan_ism; num_objects = st_ivas->nchan_ism;
nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE;
n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered];
n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render; n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render;
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
interp_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered;
#endif
if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] )
{ {
ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
st_ivas->hIsmRendererData->interp_offset = 0;
#else
interp_offset = 0; interp_offset = 0;
#endif
} }
for ( i = 0; i < num_objects; i++ ) for ( i = 0; i < num_objects; i++ )
...@@ -2276,14 +2289,19 @@ void ivas_dirac_dec_render_sf( ...@@ -2276,14 +2289,19 @@ void ivas_dirac_dec_render_sf(
} }
} }
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
for ( j = 0; j < nchan_out_woLFE; j++ )
#else
lfe_index = 0; lfe_index = 0;
for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ )
#endif
{ {
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) )
{ {
( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++;
} }
#endif
gain = st_ivas->hIsmRendererData->gains[i][j]; gain = st_ivas->hIsmRendererData->gains[i][j];
prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j];
if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f )
...@@ -2291,7 +2309,12 @@ void ivas_dirac_dec_render_sf( ...@@ -2291,7 +2309,12 @@ void ivas_dirac_dec_render_sf(
float *tc_re, *tc_im; float *tc_re, *tc_im;
float *w1, w2; float *w1, w2;
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset];
#else
w1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; w1 = &st_ivas->hIsmRendererData->interpolator[interp_offset];
#endif
tc_re = pppQMfFrame_ts_re[nchan_transport + i][0]; tc_re = pppQMfFrame_ts_re[nchan_transport + i][0];
tc_im = pppQMfFrame_ts_im[nchan_transport + i][0]; tc_im = pppQMfFrame_ts_im[nchan_transport + i][0];
...@@ -2304,8 +2327,13 @@ void ivas_dirac_dec_render_sf( ...@@ -2304,8 +2327,13 @@ void ivas_dirac_dec_render_sf(
for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ )
{ {
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ );
Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ );
#else
Cldfb_RealBuffer[j2][k][l] += g * *( tc_re++ ); Cldfb_RealBuffer[j2][k][l] += g * *( tc_re++ );
Cldfb_ImagBuffer[j2][k][l] += g * *( tc_im++ ); Cldfb_ImagBuffer[j2][k][l] += g * *( tc_im++ );
#endif
} }
w1 += hSpatParamRendCom->num_freq_bands; w1 += hSpatParamRendCom->num_freq_bands;
} }
...@@ -2318,7 +2346,12 @@ void ivas_dirac_dec_render_sf( ...@@ -2318,7 +2346,12 @@ void ivas_dirac_dec_render_sf(
} }
} }
} }
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
} }
#endif
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
st_ivas->hIsmRendererData->interp_offset += hSpatParamRendCom->num_freq_bands * st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered];
#endif
} }
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
......
...@@ -2219,7 +2219,6 @@ ivas_error ivas_init_decoder( ...@@ -2219,7 +2219,6 @@ ivas_error ivas_init_decoder(
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
if ( st_ivas->hTcBuffer == NULL ) if ( st_ivas->hTcBuffer == NULL )
{ {
/* no module has yet open the TC buffer, open a default one */ /* no module has yet open the TC buffer, open a default one */
n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );
...@@ -2230,6 +2229,7 @@ ivas_error ivas_init_decoder( ...@@ -2230,6 +2229,7 @@ ivas_error ivas_init_decoder(
} }
} }
#ifndef FIX_1101_CLEANING_JBM_CALL
if ( st_ivas->hTcBuffer == NULL ) if ( st_ivas->hTcBuffer == NULL )
{ {
/* we need the handle anyway, but without the buffer*/ /* we need the handle anyway, but without the buffer*/
...@@ -2239,8 +2239,12 @@ ivas_error ivas_init_decoder( ...@@ -2239,8 +2239,12 @@ ivas_error ivas_init_decoder(
} }
} }
#endif
#ifdef FIX_1099_JBM_MD_HANDLE_ALLOC
if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->Opt_tsm )
#else
if ( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm ) if ( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm )
#endif
{ {
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{ {
......
...@@ -711,7 +711,11 @@ void ivas_ism_dec_digest_tc( ...@@ -711,7 +711,11 @@ void ivas_ism_dec_digest_tc(
if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ||
st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_AMBI ||
st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
|| ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
#endif
)
{ {
st_ivas->hIsmRendererData->interpolator[0] = 0.0f; st_ivas->hIsmRendererData->interpolator[0] = 0.0f;
for ( i = 1; i < interpolator_length; i++ ) for ( i = 1; i < interpolator_length; i++ )
...@@ -731,6 +735,9 @@ void ivas_ism_dec_digest_tc( ...@@ -731,6 +735,9 @@ void ivas_ism_dec_digest_tc(
{ {
ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator );
} }
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
st_ivas->hIsmRendererData->interp_offset = 0;
#endif
/* also get the gains here */ /* also get the gains here */
for ( i = 0; i < st_ivas->nchan_ism; i++ ) for ( i = 0; i < st_ivas->nchan_ism; i++ )
...@@ -749,7 +756,11 @@ void ivas_ism_dec_digest_tc( ...@@ -749,7 +756,11 @@ void ivas_ism_dec_digest_tc(
if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_OSBA_LS ||
st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) && st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
|| ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
#endif
) &&
st_ivas->hCombinedOrientationData == NULL ) st_ivas->hCombinedOrientationData == NULL )
{ {
if ( st_ivas->hIntSetup.is_planar_setup ) if ( st_ivas->hIntSetup.is_planar_setup )
......
...@@ -103,6 +103,7 @@ ivas_error ivas_jbm_dec_tc( ...@@ -103,6 +103,7 @@ ivas_error ivas_jbm_dec_tc(
} }
} }
#ifndef FIX_1101_CLEANING_JBM_CALL
if ( !st_ivas->hDecoderConfig->Opt_tsm ) if ( !st_ivas->hDecoderConfig->Opt_tsm )
{ {
for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
...@@ -110,7 +111,7 @@ ivas_error ivas_jbm_dec_tc( ...@@ -110,7 +111,7 @@ ivas_error ivas_jbm_dec_tc(
st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n]; st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n];
} }
} }
#endif
/*----------------------------------------------------------------* /*----------------------------------------------------------------*
* Decoding + pre-rendering * Decoding + pre-rendering
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
...@@ -814,7 +815,16 @@ void ivas_jbm_dec_feed_tc_to_renderer( ...@@ -814,7 +815,16 @@ void ivas_jbm_dec_feed_tc_to_renderer(
p_data_f[n] = &data_f[n][0]; p_data_f[n] = &data_f[n][0];
} }
#ifdef FIX_1101_CLEANING_JBM_CALL
if ( !st_ivas->hDecoderConfig->Opt_tsm )
{
for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
{
st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */
}
}
#endif
if ( st_ivas->hDecoderConfig->Opt_tsm ) if ( st_ivas->hDecoderConfig->Opt_tsm )
{ {
ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f );
...@@ -2320,6 +2330,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open( ...@@ -2320,6 +2330,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open(
set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS );
set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES );
#ifndef FIX_1101_CLEANING_JBM_CALL
if ( hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_NONE ) if ( hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_NONE )
{ {
hTcBuffer->tc_buffer = NULL; hTcBuffer->tc_buffer = NULL;
...@@ -2330,6 +2341,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open( ...@@ -2330,6 +2341,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open(
} }
} }
else else
#endif
{ {
int16_t n_samp_full, n_samp_residual; int16_t n_samp_full, n_samp_residual;
int32_t offset; int32_t offset;
...@@ -2758,7 +2770,9 @@ void ivas_jbm_dec_copy_tc_no_tsm( ...@@ -2758,7 +2770,9 @@ void ivas_jbm_dec_copy_tc_no_tsm(
const int16_t output_frame /* i : output frame size */ const int16_t output_frame /* i : output frame size */
) )
{ {
#ifndef FIX_1101_CLEANING_JBM_CALL
int16_t n_ch_full_copy; int16_t n_ch_full_copy;
#endif
int16_t n_ch_cldfb; int16_t n_ch_cldfb;
int16_t ch_idx; int16_t ch_idx;
DECODER_TC_BUFFER_HANDLE hTcBuffer; DECODER_TC_BUFFER_HANDLE hTcBuffer;
...@@ -2766,9 +2780,16 @@ void ivas_jbm_dec_copy_tc_no_tsm( ...@@ -2766,9 +2780,16 @@ void ivas_jbm_dec_copy_tc_no_tsm(
hTcBuffer = st_ivas->hTcBuffer; hTcBuffer = st_ivas->hTcBuffer;
hTcBuffer->n_samples_buffered = output_frame; hTcBuffer->n_samples_buffered = output_frame;
hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered;
#ifndef FIX_1101_CLEANING_JBM_CALL
n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );
#endif
n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full;
#ifdef FIX_1101_CLEANING_JBM_CALL
#ifdef DEBUGGING
assert( st_ivas->hDecoderConfig->Opt_tsm == 0 );
#endif
#else
/* copy full tcs*/ /* copy full tcs*/
if ( st_ivas->hDecoderConfig->Opt_tsm ) if ( st_ivas->hDecoderConfig->Opt_tsm )
{ {
...@@ -2778,7 +2799,7 @@ void ivas_jbm_dec_copy_tc_no_tsm( ...@@ -2778,7 +2799,7 @@ void ivas_jbm_dec_copy_tc_no_tsm(
} }
} }
ch_idx = 0; ch_idx = 0;
#endif
/* CLDFB ana for ParamMC/ParamISM */ /* CLDFB ana for ParamMC/ParamISM */
if ( n_ch_cldfb > 0 ) if ( n_ch_cldfb > 0 )
{ {
...@@ -2810,8 +2831,11 @@ void ivas_jbm_dec_copy_tc_no_tsm( ...@@ -2810,8 +2831,11 @@ void ivas_jbm_dec_copy_tc_no_tsm(
} }
#endif #endif
/* CLDFB Analysis*/ /* CLDFB Analysis*/
#ifdef FIX_1101_CLEANING_JBM_CALL
for ( ch_idx = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ )
#else
for ( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) for ( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ )
#endif
{ {
for ( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) for ( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ )
{ {
......
...@@ -1891,7 +1891,9 @@ static void create_masa_ext_out_meta( ...@@ -1891,7 +1891,9 @@ static void create_masa_ext_out_meta(
IVAS_QMETADATA_HANDLE hQMetaData, IVAS_QMETADATA_HANDLE hQMetaData,
const int16_t nchan_transport ) const int16_t nchan_transport )
{ {
#ifndef FIX_1121_MASA_DESCRIPTOR
const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */
#endif
int16_t i, sf, b_old, b_new, dir; int16_t i, sf, b_old, b_new, dir;
MASA_DECRIPTIVE_META *descMeta; MASA_DECRIPTIVE_META *descMeta;
int16_t *bandMap; int16_t *bandMap;
......
...@@ -204,7 +204,12 @@ ivas_error ivas_td_binaural_renderer_sf( ...@@ -204,7 +204,12 @@ ivas_error ivas_td_binaural_renderer_sf(
/* Render subframe */ /* Render subframe */
/* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx,
where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK )
#else
if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK )
#endif
{ {
return error; return error;
} }
......
...@@ -141,7 +141,11 @@ void ivas_renderer_select( ...@@ -141,7 +141,11 @@ void ivas_renderer_select(
{ {
*internal_config = IVAS_AUDIO_CONFIG_HOA3; *internal_config = IVAS_AUDIO_CONFIG_HOA3;
#ifdef FIX_1158_FASTCONV_REVERB_HRTF
if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#else
if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#endif
{ {
*renderer_type = RENDERER_BINAURAL_FASTCONV; *renderer_type = RENDERER_BINAURAL_FASTCONV;
} }
......
...@@ -811,6 +811,9 @@ typedef struct renderer_struct ...@@ -811,6 +811,9 @@ typedef struct renderer_struct
float prev_gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; float prev_gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS];
float *interpolator; float *interpolator;
int16_t interpolator_length; int16_t interpolator_length;
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
int16_t interp_offset;
#endif
float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS];
} ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE;
......
...@@ -923,6 +923,10 @@ void stereo_cna_update_params( ...@@ -923,6 +923,10 @@ void stereo_cna_update_params(
} }
else else
{ {
#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING
hFdCngDec->first_cna_noise_updated = 0;
#endif
return; return;
} }
......
...@@ -1551,6 +1551,11 @@ void stereo_switching_dec( ...@@ -1551,6 +1551,11 @@ void stereo_switching_dec(
mvr2r( sts[0]->old_exc, sts[1]->old_exc, L_EXC_MEM_DEC ); mvr2r( sts[0]->old_exc, sts[1]->old_exc, L_EXC_MEM_DEC );
mvr2r( sts[0]->lsf_old, sts[1]->lsf_old, M ); mvr2r( sts[0]->lsf_old, sts[1]->lsf_old, M );
mvr2r( sts[0]->lsp_old, sts[1]->lsp_old, M ); mvr2r( sts[0]->lsp_old, sts[1]->lsp_old, M );
#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING
sts[1]->last_core_brate = sts[0]->last_core_brate;
#endif
if ( hCPE->element_mode == IVAS_CPE_MDCT ) if ( hCPE->element_mode == IVAS_CPE_MDCT )
{ {
sts[1]->last_core = sts[0]->last_core; sts[1]->last_core = sts[0]->last_core;
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#endif #endif
#include "wmc_auto.h" #include "wmc_auto.h"
/*-----------------------------------------------------------------------* /*-----------------------------------------------------------------------*
* Local constants * Local constants
*-----------------------------------------------------------------------*/ *-----------------------------------------------------------------------*/
...@@ -58,10 +57,14 @@ ...@@ -58,10 +57,14 @@
*-----------------------------------------------------------------------*/ *-----------------------------------------------------------------------*/
static float GivensRotation( const float x, const float z ); static float GivensRotation( const float x, const float z );
#ifdef NONBE_SVD_OPTIMIZATION
static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g );
static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g );
#else
static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g );
static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g );
#endif
static void singularVectorsAccumulationLeft( float singularVectors_Left[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC ); static void singularVectorsAccumulationLeft( float singularVectors_Left[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC );
...@@ -488,16 +491,30 @@ static void HouseholderReduction( ...@@ -488,16 +491,30 @@ static void HouseholderReduction(
float *eps_x ) float *eps_x )
{ {
int16_t nCh; int16_t nCh;
float g = 0.0f, sig_x = 0.0f; #ifdef NONBE_SVD_OPTIMIZATION
float g_left = 0.0f;
float g_right = 0.0f;
#else
float sig_x = 0.0f;
float g = 0.0f;
#endif
/* Bidiagonal Reduction for every channel */ /* Bidiagonal Reduction for every channel */
for ( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */ for ( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */
{ {
#ifdef NONBE_SVD_OPTIMIZATION
secDiag[nCh] = g_right; /* from the previous channel */
biDiagonalReductionLeft( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_left );
singularValues[nCh] = g_left;
biDiagonalReductionRight( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_right );
#else
biDiagonalReductionLeft( singularVectors_Left, singularValues, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); biDiagonalReductionLeft( singularVectors_Left, singularValues, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g );
biDiagonalReductionRight( singularVectors_Left, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); biDiagonalReductionRight( singularVectors_Left, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g );
#endif
*eps_x = max( *eps_x, ( fabsf( singularValues[nCh] ) + fabsf( secDiag[nCh] ) ) ); *eps_x = max( *eps_x, ( fabsf( singularValues[nCh] ) + fabsf( secDiag[nCh] ) ) );
} }
/* SingularVecotr Accumulation */ /* SingularVecotr Accumulation */
singularVectorsAccumulationRight( singularVectors_Left, singularVectors_Right, secDiag, nChannelsC ); singularVectorsAccumulationRight( singularVectors_Left, singularVectors_Right, secDiag, nChannelsC );
singularVectorsAccumulationLeft( singularVectors_Left, singularValues, nChannelsL, nChannelsC ); singularVectorsAccumulationLeft( singularVectors_Left, singularValues, nChannelsL, nChannelsC );
...@@ -506,12 +523,123 @@ static void HouseholderReduction( ...@@ -506,12 +523,123 @@ static void HouseholderReduction(
} }
#ifdef NONBE_SVD_OPTIMIZATION
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* biDiagonalReductionLeft() * biDiagonalReductionLeft()
* *
* *
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
static void biDiagonalReductionLeft(
float singularVectors[][MAX_OUTPUT_CHANNELS],
const int16_t nChannelsL,
const int16_t nChannelsC,
const int16_t currChannel,
float *g )
{
int16_t iCh, jCh;
float norm_x, f, r;
/* Setting values to 0 */
( *g ) = 0.0f;
if ( currChannel < nChannelsL ) /* i <= m */
{
norm_x = 0.0f;
for ( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */
{
norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][currChannel] );
}
if ( ( norm_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
{
( *g ) = -( singularVectors[currChannel][currChannel] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x );
r = ( *g ) * singularVectors[currChannel][currChannel] - norm_x;
singularVectors[currChannel][currChannel] = ( singularVectors[currChannel][currChannel] - ( *g ) );
for ( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */
{
norm_x = 0.0f;
for ( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */
{
norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][iCh] );
}
f = norm_x / maxWithSign( r );
for ( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */
{
singularVectors[jCh][iCh] += ( f * singularVectors[jCh][currChannel] );
}
}
}
}
return;
}
/*-------------------------------------------------------------------------
* biDiagonalReductionRight()
*
*
*-------------------------------------------------------------------------*/
static void biDiagonalReductionRight(
float singularVectors[][MAX_OUTPUT_CHANNELS],
const int16_t nChannelsL,
const int16_t nChannelsC,
const int16_t currChannel,
float *g )
{
int16_t iCh, jCh, idx;
float norm_x, r;
/* Setting values to 0 */
( *g ) = 0.0f;
if ( currChannel < nChannelsL && currChannel != ( nChannelsC - 1 ) ) /* i <=m && i !=n */
{
idx = currChannel + 1;
norm_x = 0.0f;
for ( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */
{
norm_x += ( singularVectors[currChannel][jCh] * singularVectors[currChannel][jCh] );
}
if ( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
{
( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x );
r = ( *g ) * singularVectors[currChannel][idx] - norm_x;
singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) );
for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */
{
norm_x = 0.0f;
for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */
{
norm_x += ( singularVectors[iCh][jCh] * singularVectors[currChannel][jCh] );
}
norm_x /= r;
for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */
{
singularVectors[iCh][jCh] += ( norm_x * singularVectors[currChannel][jCh] );
}
}
}
}
return;
}
#else
/*-------------------------------------------------------------------------
* biDiagonalReductionLeft()
*
*
*-------------------------------------------------------------------------*/
static void biDiagonalReductionLeft( static void biDiagonalReductionLeft(
float singularVectors[][MAX_OUTPUT_CHANNELS], float singularVectors[][MAX_OUTPUT_CHANNELS],
float singularValues[MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS],
...@@ -582,14 +710,16 @@ static void biDiagonalReductionLeft( ...@@ -582,14 +710,16 @@ static void biDiagonalReductionLeft(
return; return;
} }
#endif
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* biDiagonalReductionRight() * biDiagonalReductionRight()
* *
* *
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
#ifdef NONBE_SVD_OPTIMIZATION
#else
static void biDiagonalReductionRight( static void biDiagonalReductionRight(
float singularVectors[][MAX_OUTPUT_CHANNELS], float singularVectors[][MAX_OUTPUT_CHANNELS],
float secDiag[MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS],
...@@ -632,7 +762,6 @@ static void biDiagonalReductionRight( ...@@ -632,7 +762,6 @@ static void biDiagonalReductionRight(
{ {
secDiag[jCh] = singularVectors[currChannel][jCh] / maxWithSign( r ); secDiag[jCh] = singularVectors[currChannel][jCh] / maxWithSign( r );
} }
for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */ for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */
{ {
norm_x = 0.0f; norm_x = 0.0f;
...@@ -657,7 +786,7 @@ static void biDiagonalReductionRight( ...@@ -657,7 +786,7 @@ static void biDiagonalReductionRight(
return; return;
} }
#endif
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* singularVectorsAccumulationLeft() * singularVectorsAccumulationLeft()
* *
......