Skip to content
Commits on Source (30)
......@@ -134,9 +134,7 @@ typedef enum
IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT,
IVAS_ERR_NO_FILE_OPEN,
IVAS_ERR_SAMPLING_RATE_UNKNOWN,
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT,
#endif
/*----------------------------------------*
* renderer (lib_rend only) *
......@@ -274,10 +272,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
return "Invalid input format";
case IVAS_ERR_INVALID_INDEX:
return "Invalid index";
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT:
return "Euler angles were detected in the input but only Quaternions are supported";
#endif
default:
break;
}
......
......@@ -308,14 +308,9 @@ ivas_error ivas_init_decoder(
ivas_error ivas_output_buff_dec(
float *p_output_f[], /* i/o: output audio buffers */
#ifdef FIX_1330_JBM_MEMORY
const int16_t nchan_out_buff, /* i : number of output channels */
const int16_t Opt_tsm, /* i : TSM option flag */
DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */
#else
const int16_t nchan_out_buff_old, /* i : previous frame number of output channels*/
const int16_t nchan_out_buff /* i : number of output channels */
#endif
);
ivas_error stereo_dmx_evs_init_encoder(
......@@ -5829,12 +5824,7 @@ void ivas_omasa_separate_object_render_jbm(
const uint16_t nSamplesRendered, /* i : number of samples rendered */
float input_f[][L_FRAME48k], /* i : separated object signal */
float *output_f[], /* o : rendered time signal */
#ifdef FIX_1330_JBM_MEMORY
const int16_t subframes_rendered /* i : number of subframes rendered */
#else
const int16_t subframes_rendered, /* i : number of subframes rendered */
const int16_t slots_rendered /* i : number of CLDFB slots rendered */
#endif
);
void ivas_omasa_encode_masa_to_total(
......
......@@ -198,24 +198,18 @@ void ivas_buffer_deinterleaved_to_interleaved(
)
{
int16_t ch, m;
#ifdef FIX_1330_JBM_MEMORY
float buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio[]" and "*audio_out[]" are the same */
for ( ch = 0; ch < n_channels; ch++ )
{
mvr2r( audio[ch], buffer[ch], frame_length );
}
#endif
for ( ch = 0; ch < n_channels; ch++ )
{
for ( m = 0; m < frame_length; m++ )
{
#ifdef FIX_1330_JBM_MEMORY
audio_out[m * n_channels + ch] = buffer[ch][m];
#else
audio_out[m * n_channels + ch] = audio[ch][m];
#endif
}
}
......
......@@ -164,9 +164,7 @@
/*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */
#define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */
#define FIX_1371_EARLY_PART_INIT_FASTCONV /* Nokia: fix uninitialized variable in FASTCONV path of binaural reverb init */
#define FIX_1995_REVERB_INIT /* issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */
/* #################### End BE switches ################################## */
......@@ -178,6 +176,7 @@
#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_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */
#define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */
#define NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* FhG: Fix assert being hit in JBM code during rate switching */
/* ##################### End NON-BE switches ########################### */
......
......@@ -999,6 +999,7 @@ ivas_error ivas_binRenderer_open(
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
{
pRoomAcoustics = ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ? &( st_ivas->hRenderConfig->roomAcoustics ) : NULL;
if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ),
st_ivas->hHrtfStatistics,
hBinRenderer->conv_band,
......@@ -1007,12 +1008,7 @@ ivas_error ivas_binRenderer_open(
st_ivas->hDecoderConfig->output_Fs,
st_ivas->hHrtfFastConv->fastconvReverberationTimes,
st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections,
#ifdef FIX_1371_EARLY_PART_INIT_FASTCONV
NULL
#else
hBinRenderer->earlyPartEneCorrection
#endif
) ) != IVAS_ERR_OK )
NULL ) ) != IVAS_ERR_OK )
{
return error;
......
......@@ -1256,9 +1256,7 @@ ivas_error ivas_init_decoder(
int16_t sce_id, cpe_id;
int16_t numCldfbAnalyses, numCldfbSyntheses;
int16_t granularity, n_channels_transport_jbm;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#endif
int32_t output_Fs, ivas_total_brate;
int32_t delay_ns;
AUDIO_CONFIG output_config;
......@@ -2393,28 +2391,11 @@ ivas_error ivas_init_decoder(
* Allocate floating-point output audio buffers
*-----------------------------------------------------------------*/
#ifdef FIX_1330_JBM_MEMORY
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
{
return error;
}
#else
k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
for ( n = 0; n < k; n++ )
{
/* note: these are intra-frame heap memories */
if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL )
{
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) );
}
}
for ( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ )
{
st_ivas->p_output_f[n] = NULL;
}
#endif
return IVAS_ERR_OK;
}
......@@ -2890,16 +2871,8 @@ void ivas_destroy_dec(
/* floating-point output audio buffers */
for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
{
#ifdef FIX_1330_JBM_MEMORY
st_ivas->p_output_f[i] = NULL;
#else
if ( st_ivas->p_output_f[i] != NULL )
{
free( st_ivas->p_output_f[i] );
st_ivas->p_output_f[i] = NULL;
}
#endif
}
/* main IVAS handle */
free( st_ivas );
......
......@@ -60,11 +60,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
int16_t tc_nchan_tc_new;
int16_t tc_nchan_allocate_new;
int16_t tc_granularity_new;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff, nchan_out_buff_old;
#endif
nCPE_old = st_ivas->nCPE;
nSCE_old = st_ivas->nSCE;
......@@ -74,9 +70,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
st_ivas->ism_mode = last_ism_mode;
ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
st_ivas->ism_mode = ism_mode;
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif
if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK )
{
......@@ -128,6 +121,25 @@ static ivas_error ivas_ism_bitrate_switching_dec(
mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
}
#ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
/* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv
render what still fits in the new granularity */
tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs );
if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
{
/* flush already done in IVAS_DEC_ReadFormat() */
}
/* JBM: when granularity goes up set samples to discard at the beginning of the frame */
else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity )
{
if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK )
{
return error;
}
}
#endif
if ( st_ivas->ism_mode != last_ism_mode )
{
/* EFAP handle */
......@@ -272,17 +284,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
return error;
}
#ifndef FIX_1330_JBM_MEMORY
/*-----------------------------------------------------------------*
* floating-point output audio buffers
*-----------------------------------------------------------------*/
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
{
return error;
}
#endif
/*-----------------------------------------------------------------*
* JBM TC buffers
*-----------------------------------------------------------------*/
......@@ -295,7 +296,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(
tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas );
tc_nchan_allocate_new = tc_nchan_tc_new;
tc_nchan_full_new = tc_nchan_tc_new;
#ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs );
#endif
if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) )
{
......@@ -322,7 +325,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
}
#ifdef FIX_1330_JBM_MEMORY
/*-----------------------------------------------------------------*
* floating-point output audio buffers
......@@ -333,7 +335,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
{
return error;
}
#endif
return IVAS_ERR_OK;
}
......
......@@ -193,25 +193,11 @@ void ivas_ism_render_sf(
ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2;
}
#ifndef FIX_1330_JBM_MEMORY
if ( st_ivas->hDecoderConfig->Opt_tsm )
{
for ( i = 0; i < num_objects; i++ )
{
p_tc[i] = &st_ivas->hTcBuffer->tc[i][tc_offset];
}
}
else
{
#endif
for ( i = 0; i < num_objects; i++ )
{
mvr2r( &output_f[i][tc_offset], tc_local[i], n_samples_to_render );
p_tc[i] = tc_local[i];
}
#ifndef FIX_1330_JBM_MEMORY
}
#endif
for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ )
{
......@@ -436,12 +422,7 @@ void ivas_omasa_separate_object_render_jbm(
const uint16_t nSamplesRendered, /* i : number of samples rendered */
float input_f_in[][L_FRAME48k], /* i : separated object signal */
float *output_f[], /* o : rendered time signal */
#ifdef FIX_1330_JBM_MEMORY
const int16_t subframes_rendered /* i : number of subframes rendered */
#else
const int16_t subframes_rendered, /* i : number of subframes rendered */
const int16_t slots_rendered /* i : number of CLDFB slots rendered */
#endif
)
{
VBAP_HANDLE hVBAPdata;
......@@ -482,33 +463,15 @@ void ivas_omasa_separate_object_render_jbm(
num_objects = st_ivas->nchan_ism;
}
#ifndef FIX_1330_JBM_MEMORY
offsetSamples = slots_rendered * hSpatParamRendCom->slot_size;
#endif
for ( j = 0; j < nchan_out_woLFE + num_lfe; j++ )
{
output_f_local[j] = output_f[j];
}
#ifndef FIX_1330_JBM_MEMORY
if ( st_ivas->hDecoderConfig->Opt_tsm )
{
for ( obj = 0; obj < num_objects; obj++ )
{
input_f[obj] = &st_ivas->hTcBuffer->tc[obj + 2][offsetSamples];
}
}
else
{
#endif
for ( obj = 0; obj < num_objects; obj++ )
{
input_f[obj] = input_f_in[obj];
}
#ifndef FIX_1330_JBM_MEMORY
}
#endif
slots_to_render = nSamplesRendered / hSpatParamRendCom->slot_size;
first_sf = subframes_rendered;
......
......@@ -763,11 +763,7 @@ void ivas_jbm_dec_feed_tc_to_renderer(
float tmp_buf[MAX_JBM_L_FRAME48k];
float *p_data_f[FOA_CHANNELS + MAX_NUM_OBJECTS];
int16_t n, n_render_timeslots, n_ch_cldfb;
#ifdef FIX_1330_JBM_MEMORY
int16_t ch, offset, len_offset;
#else
int16_t ch;
#endif
DECODER_TC_BUFFER_HANDLE hTcBuffer;
hTcBuffer = st_ivas->hTcBuffer;
......@@ -785,7 +781,6 @@ void ivas_jbm_dec_feed_tc_to_renderer(
n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );
n_ch_res_copy = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full;
#ifdef FIX_1330_JBM_MEMORY
/* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]':
in case of 'length(hTcBuffer->tc[]) < length(p_output_f[])', reset of TC buffers
pointers is needed after ivas_buffer_interleaved_to_deinterleaved() */
......@@ -800,7 +795,6 @@ void ivas_jbm_dec_feed_tc_to_renderer(
}
}
#endif
for ( ch = 0; ch < n_ch_full_copy; ch++ )
{
mvr2r( hTcBuffer->tc[ch], tmp_buf, nSamplesForRendering );
......@@ -2112,9 +2106,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate(
if ( Opt_tsm )
{
n_samp_full = ( NS2SA( output_Fs, MAX_JBM_L_FRAME_NS ) );
#ifdef FIX_1330_JBM_MEMORY
n_samp_full = max( n_samp_full, L_FRAME48k ); /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': ensure minimal length */
#endif
n_samp_residual = hTcBuffer->n_samples_granularity - 1;
}
else
......@@ -2174,10 +2166,8 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate(
}
}
#ifdef FIX_1330_JBM_MEMORY
hTcBuffer->tc_buffer2 = NULL;
#endif
return IVAS_ERR_OK;
}
......@@ -2215,14 +2205,12 @@ static void ivas_jbm_dec_tc_audio_deallocate(
hTcBuffer->tc_buffer_old[ch_idx] = NULL;
}
}
#ifdef FIX_1330_JBM_MEMORY
if ( hTcBuffer->tc_buffer2 != NULL )
{
free( hTcBuffer->tc_buffer2 );
hTcBuffer->tc_buffer2 = NULL;
}
#endif
}
return;
......@@ -2419,11 +2407,7 @@ static void ivas_jbm_dec_tc_buffer_playout(
for ( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ )
{
#ifdef FIX_1330_JBM_MEMORY
output[ch_idx] = st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered;
#else
mvr2r( st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered, output[ch_idx], *nSamplesRendered );
#endif
}
st_ivas->hTcBuffer->subframes_rendered = last_sf;
......
......@@ -1320,11 +1320,7 @@ ivas_error ivas_masa_dec_reconfigure(
Decoder_State **sts;
int32_t ivas_total_brate, last_ivas_total_brate;
int16_t numCldfbAnalyses_old, numCldfbSyntheses_old;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff_old, nchan_out_buff;
#endif
ivas_error error;
int16_t pos_idx;
int32_t ism_total_brate;
......@@ -1332,10 +1328,6 @@ ivas_error ivas_masa_dec_reconfigure(
ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate;
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif
/* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */
if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
{
......@@ -1509,6 +1501,25 @@ ivas_error ivas_masa_dec_reconfigure(
tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS;
}
}
#ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC )
{
if ( n_samples_granularity > st_ivas->hTcBuffer->n_samples_granularity )
{
if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK )
{
return error;
}
}
}
else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC )
{
if ( n_samples_granularity < st_ivas->hTcBuffer->n_samples_granularity )
{
/* flush already done in IVAS_DEC_ReadFormat() */
}
}
#endif
}
else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) )
{
......@@ -1554,11 +1565,7 @@ ivas_error ivas_masa_dec_reconfigure(
if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */
{
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#ifdef FIX_1330_JBM_MEMORY
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
......
......@@ -732,17 +732,10 @@ static ivas_error ivas_mc_dec_reconfig(
int16_t tc_nchan_tc_new;
int16_t tc_nchan_allocate_new;
int16_t tc_granularity_new;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff_old, nchan_out_buff;
#endif
ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
nchan_transport_old = st_ivas->nchan_transport;
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif
last_mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */
/* temporally set the current mc_mode back to the previous one to make sure the following call to
......@@ -795,6 +788,25 @@ static ivas_error ivas_mc_dec_reconfig(
}
}
#ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
/* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv
render what still fits in the new granularity */
tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs );
if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
{
/* flush already done in IVAS_DEC_ReadFormat() */
}
/* JBM: when granularity goes up set samples to discard at the beginning of the frame */
else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity )
{
if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK )
{
return error;
}
}
#endif
if ( st_ivas->mc_mode == MC_MODE_MCT )
{
st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ) );
......@@ -1303,7 +1315,9 @@ static ivas_error ivas_mc_dec_reconfig(
tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas );
tc_nchan_allocate_new = tc_nchan_tc_new;
tc_nchan_full_new = tc_nchan_tc_new;
#ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs );
#endif
if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
{
......@@ -1372,11 +1386,7 @@ static ivas_error ivas_mc_dec_reconfig(
*-----------------------------------------------------------------*/
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#ifdef FIX_1330_JBM_MEMORY
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
......
......@@ -200,11 +200,7 @@ ivas_error ivas_omasa_dec_config(
int32_t ivas_total_brate, ism_total_brate, cpe_brate;
ISM_MODE ism_mode_old;
IVAS_FORMAT ivas_format_orig;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff, nchan_out_buff_old;
#endif
ivas_error error;
RENDERER_TYPE old_renderer_type;
......@@ -219,9 +215,6 @@ ivas_error ivas_omasa_dec_config(
ivas_format_orig = st_ivas->ivas_format;
st_ivas->ivas_format = st_ivas->last_ivas_format;
ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif
st_ivas->ivas_format = ivas_format_orig;
nSCE_old = st_ivas->nSCE;
......@@ -475,11 +468,7 @@ ivas_error ivas_omasa_dec_config(
*-----------------------------------------------------------------*/
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#ifdef FIX_1330_JBM_MEMORY
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
......@@ -682,27 +671,16 @@ void ivas_omasa_dirac_rend_jbm(
)
{
int16_t subframes_rendered;
#ifndef FIX_1330_JBM_MEMORY
int16_t slots_rendered;
#endif
int16_t n;
float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k];
#ifndef FIX_1330_JBM_MEMORY
if ( !st_ivas->hDecoderConfig->Opt_tsm )
{
#endif
*nSamplesRendered = min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available );
if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
{
mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered );
#ifdef FIX_1330_JBM_MEMORY
if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
#else
if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
#endif
{
/* Gain separated object, if edited */
for ( n = 0; n < st_ivas->nchan_ism; n++ )
......@@ -721,22 +699,14 @@ void ivas_omasa_dirac_rend_jbm(
mvr2r( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered );
/* Gain discrete objects, if edited */
#ifdef FIX_1330_JBM_MEMORY
if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
#else
if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
#endif
{
v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered );
}
}
/* Gain MASA part, if edited */
#ifdef FIX_1330_JBM_MEMORY
if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited )
#else
if ( st_ivas->hMasaIsmData->masa_gain_is_edited )
#endif
{
for ( int16_t ch = 0; ch < 2; ch++ )
{
......@@ -744,22 +714,12 @@ void ivas_omasa_dirac_rend_jbm(
}
}
}
#ifndef FIX_1330_JBM_MEMORY
}
#endif
subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered;
#ifndef FIX_1330_JBM_MEMORY
slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered;
#endif
ivas_dirac_dec_render( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_f );
#ifdef FIX_1330_JBM_MEMORY
ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered );
#else
ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered, slots_rendered );
#endif
return;
}
......
......@@ -271,70 +271,35 @@ ivas_error ivas_osba_render_sf(
)
{
int16_t n;
#ifdef FIX_1330_JBM_MEMORY
float output_sba[MAX_OUTPUT_CHANNELS][L_FRAME48k];
float *p_output_sba[MAX_OUTPUT_CHANNELS];
#else
float output_ism[MAX_OUTPUT_CHANNELS][L_FRAME48k];
float *p_output_ism[MAX_OUTPUT_CHANNELS];
#endif
ivas_error error;
for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ )
{
#ifdef FIX_1330_JBM_MEMORY
p_output_sba[n] = output_sba[n];
#else
p_output_ism[n] = &output_ism[n][0];
#endif
}
#ifndef FIX_1330_JBM_MEMORY
if ( !st_ivas->hDecoderConfig->Opt_tsm )
{
int16_t tc_offset;
tc_offset = st_ivas->hTcBuffer->n_samples_rendered;
for ( n = 0; n < st_ivas->nchan_ism; n++ )
{
mvr2r( &p_output[n][tc_offset], &output_ism[n][tc_offset], nSamplesAsked );
}
}
#endif
#ifdef FIX_1330_JBM_MEMORY
if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output_sba ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM )
{
#ifdef FIX_1330_JBM_MEMORY
ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered );
#else
ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered );
#endif
}
for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )
{
if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM )
{
#ifdef FIX_1330_JBM_MEMORY
v_add( p_output[n], p_output_sba[n], p_output[n], *nSamplesRendered );
#else
v_add( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered );
#endif
}
#ifdef FIX_1330_JBM_MEMORY
else
{
mvr2r( p_output_sba[n], p_output[n], *nSamplesRendered );
}
#endif
}
return IVAS_ERR_OK;
......
......@@ -111,12 +111,7 @@ ivas_error ivas_sba_dec_reconfigure(
int32_t ivas_total_brate;
int32_t last_ivas_total_brate;
int16_t num_channels, num_md_sub_frames;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff, nchan_out_buff_old;
int16_t sba_analysis_order_old_flush;
#endif
DECODER_CONFIG_HANDLE hDecoderConfig;
ivas_error error;
ISM_MODE ism_mode_old;
......@@ -127,18 +122,12 @@ ivas_error ivas_sba_dec_reconfigure(
hDecoderConfig = st_ivas->hDecoderConfig;
ivas_total_brate = hDecoderConfig->ivas_total_brate;
last_ivas_total_brate = st_ivas->last_active_ivas_total_brate;
#ifndef FIX_1330_JBM_MEMORY
sba_analysis_order_old_flush = st_ivas->sba_analysis_order;
#endif
/*-----------------------------------------------------------------*
* Set SBA high-level parameters
* Save old SBA high-level parameters
*-----------------------------------------------------------------*/
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate );
#endif
ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
nchan_hp20_old = getNumChanSynthesis( st_ivas );
......@@ -173,6 +162,27 @@ ivas_error ivas_sba_dec_reconfigure(
/* determine new granularity */
granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs );
#ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
/* flush renderer on granularity change form 5ms to 1.25ms, again only possible for binaural rendering */
if ( granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
{
/* flush already done in IVAS_DEC_ReadFormat() */
}
else if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity )
{
if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK )
{
return error;
}
/* make sure the changed number of slots in the last subframe is not lost in the following steps */
if ( st_ivas->hSpatParamRendCom != NULL )
{
st_ivas->hSpatParamRendCom->subframe_nbslots[st_ivas->hSpatParamRendCom->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1];
}
st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1];
}
#else
if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity )
{
/* make sure the changed number of slots in the last subframe is not lost in the following steps */
......@@ -182,6 +192,7 @@ ivas_error ivas_sba_dec_reconfigure(
}
st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1];
}
#endif
}
/* save old */
......@@ -598,11 +609,7 @@ ivas_error ivas_sba_dec_reconfigure(
*-----------------------------------------------------------------*/
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#ifdef FIX_1330_JBM_MEMORY
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
......
......@@ -979,10 +979,8 @@ typedef struct decoder_tc_buffer_structure
int16_t num_slots;
int16_t n_samples_discard; /* number of samples to discard from the beginning of the output */
#ifdef FIX_1330_JBM_MEMORY
float *tc_buffer2; /* non-scaled buffer of output audio - needed only when '*tc_buffer* is not long enough */
#endif
} DECODER_TC_BUFFER, *DECODER_TC_BUFFER_HANDLE;
typedef struct jbm_metadata_structure
......
......@@ -1099,6 +1099,7 @@ ivas_error IVAS_DEC_ReadFormat(
return error;
}
}
#ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING
/* when granularity goes up, discard samples at the beginning of the frame */
else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity )
{
......@@ -1107,6 +1108,7 @@ ivas_error IVAS_DEC_ReadFormat(
return error;
}
}
#endif
}
}
......
......@@ -369,17 +369,11 @@ int16_t ivas_get_nchan_buffers_dec(
ivas_error ivas_output_buff_dec(
float *p_output_f[], /* i/o: output audio buffers */
#ifdef FIX_1330_JBM_MEMORY
const int16_t nchan_out_buff, /* i : number of output channels */
const int16_t Opt_tsm, /* i : TSM option flag */
DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */
#else
const int16_t nchan_out_buff_old, /* i : previous frame number of output channels */
const int16_t nchan_out_buff /* i : number of output channels */
#endif
)
{
#ifdef FIX_1330_JBM_MEMORY
int16_t ch, nchan_tc_jbm, nsamp_to_allocate, n_samp_full, offset;
for ( ch = 0; ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch++ )
......@@ -437,35 +431,6 @@ ivas_error ivas_output_buff_dec(
offset += n_samp_full;
}
}
#else
int16_t ch;
if ( nchan_out_buff > nchan_out_buff_old )
{
for ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ )
{
#ifdef DEBUGGING
if ( p_output_f[ch] != NULL )
{
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Memory for floating-point output audio buffer is already allocated!\n" ) );
}
#endif
/* note: these are intra-frame heap memories */
if ( ( p_output_f[ch] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL )
{
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) );
}
}
}
else
{
for ( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ )
{
free( p_output_f[ch] );
p_output_f[ch] = NULL;
}
}
#endif
return IVAS_ERR_OK;
}
......
......@@ -945,8 +945,7 @@ ivas_error ivas_binaural_reverb_init(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */
const int32_t sampling_rate, /* i : sampling rate */
const float *defaultTimes, /* i : default reverberation times */
const float *defaultEne /* i : default reverberation energies */
,
const float *defaultEne, /* i : default reverberation energies */
float *earlyEne /* i/o: Early part energies to be modified */
);
......
......@@ -79,10 +79,10 @@
#define MAX_NR_OUTPUTS ( 2 )
const int16_t init_loop_delay[IVAS_REV_MAX_NR_BRANCHES] = { 37, 31, 29, 23, 19, 17, 13, 11 };
const int16_t default_loop_delay_48k[IVAS_REV_MAX_NR_BRANCHES] = { 2309, 1861, 1523, 1259, 1069, 919, 809, 719 };
const int16_t default_loop_delay_32k[IVAS_REV_MAX_NR_BRANCHES] = { 1531, 1237, 1013, 839, 709, 613, 541, 479 };
const int16_t default_loop_delay_16k[IVAS_REV_MAX_NR_BRANCHES] = { 769, 619, 509, 421, 353, 307, 269, 239 };
static const int16_t init_loop_delay[IVAS_REV_MAX_NR_BRANCHES] = { 37, 31, 29, 23, 19, 17, 13, 11 };
static const int16_t default_loop_delay_48k[IVAS_REV_MAX_NR_BRANCHES] = { 2309, 1861, 1523, 1259, 1069, 919, 809, 719 };
static const int16_t default_loop_delay_32k[IVAS_REV_MAX_NR_BRANCHES] = { 1531, 1237, 1013, 839, 709, 613, 541, 479 };
static const int16_t default_loop_delay_16k[IVAS_REV_MAX_NR_BRANCHES] = { 769, 619, 509, 421, 353, 307, 269, 239 };
/*------------------------------------------------------------------------------------------*
* Local Struct definition
......@@ -682,8 +682,6 @@ static ivas_error initialize_reverb_filters(
{
ivas_error error;
error = IVAS_ERR_OK;
/* init correlation and coloration filters */
if ( ( error = ivas_reverb_t2f_f2t_init( &hReverb->fft_filter_ols, hReverb->fft_size, hReverb->fft_subblock_size ) ) != IVAS_ERR_OK )
{
......@@ -710,7 +708,7 @@ static ivas_error initialize_reverb_filters(
return error;
}
return error;
return IVAS_ERR_OK;
}
......@@ -1060,7 +1058,6 @@ ivas_error ivas_reverb_open(
int16_t fft_hist_size, transition_start, transition_length;
int16_t nr_fc_input, nr_fc_fft_filter;
error = IVAS_ERR_OK;
output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC );
subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES;
predelay_bf_len = output_frame;
......@@ -1240,7 +1237,7 @@ ivas_error ivas_reverb_open(
*hReverb = pState;
return error;
return IVAS_ERR_OK;
}
......@@ -1859,12 +1856,13 @@ static ivas_error ivas_binaural_reverb_open(
return IVAS_ERR_OK;
}
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_init()
*
* Allocate and initialize binaural room reverberator handle
* for CLDFB renderers
* Initialize binaural room reverberator handle for FastConv renderer
*------------------------------------------------------------------------*/
ivas_error ivas_binaural_reverb_init(
REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */
const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */
......@@ -1873,8 +1871,7 @@ ivas_error ivas_binaural_reverb_init(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */
const int32_t sampling_rate, /* i : sampling rate */
const float *defaultTimes, /* i : default reverberation times */
const float *defaultEne /* i : default reverberation energies */
,
const float *defaultEne, /* i : default reverberation energies */
float *earlyEne /* i/o: Early part energies to be modified */
)
{
......@@ -1883,24 +1880,23 @@ ivas_error ivas_binaural_reverb_init(
float revTimes[CLDFB_NO_CHANNELS_MAX];
float revEne[CLDFB_NO_CHANNELS_MAX];
error = IVAS_ERR_OK;
if ( roomAcoustics != NULL )
{
if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics,
hHrtfStatistics,
sampling_rate,
revTimes,
revEne ) ) != IVAS_ERR_OK )
if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, revTimes, revEne ) ) != IVAS_ERR_OK )
{
return error;
}
preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX );
/* Convert preDelay from seconds to CLDFB slots as needed by binaural reverb */
preDelay = (int16_t) roundf( roomAcoustics->acousticPreDelay * CLDFB_SLOTS_PER_SECOND );
}
else
{
#ifdef FIX_1995_REVERB_INIT
for ( bin = 0; bin < numBins; bin++ )
#else
for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{
revTimes[bin] = defaultTimes[bin];
revEne[bin] = defaultEne[bin];
......@@ -1908,7 +1904,11 @@ ivas_error ivas_binaural_reverb_init(
preDelay = 10;
}
#ifdef FIX_1995_REVERB_INIT
for ( bin = 0; bin < numBins; bin++ )
#else
for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{
/* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid
spectral artefacts with the synthetic reverberator. */
......@@ -1924,23 +1924,17 @@ ivas_error ivas_binaural_reverb_init(
energyModifier = ( adjustedRevTime - revTimes[bin] ) / adjustedRevTime;
/* Adjust early and late energies, by moving late energy to early energy */
#ifdef FIX_1371_EARLY_PART_INIT_FASTCONV
if ( earlyEne != NULL )
{
adjustedEarlyEne = earlyEne[bin] + revEne[bin] * energyModifier;
earlyEne[bin] = adjustedEarlyEne; /* Store already here */
}
#else
adjustedEarlyEne = earlyEne[bin] + revEne[bin] * energyModifier;
#endif
adjustedLateEne = revEne[bin] * ( 1.0f - energyModifier );
/* Store adjusted room effect parameters to be used in reverb processing */
revTimes[bin] = adjustedRevTime;
revEne[bin] = adjustedLateEne;
#ifndef FIX_1371_EARLY_PART_INIT_FASTCONV
earlyEne[bin] = adjustedEarlyEne;
#endif
}
}
......@@ -1949,6 +1943,7 @@ ivas_error ivas_binaural_reverb_init(
return error;
}
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_close()
*
......
......@@ -174,14 +174,12 @@ ivas_error ExternalOrientationFileReading(
}
( externalOrientationReader->frameCounter )++;
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
/* Only Quaternion orientations are supported, raise an error if Euler angles are detected in the input */
if ( w == -3.0f )
{
return IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT;
}
#endif
pQuaternion->w = w;
pQuaternion->x = x;
......