Loading lib_enc/ivas_enc.c +3 −29 Original line number Diff line number Diff line Loading @@ -64,28 +64,6 @@ static float *getSmplPtr( return buffer.data + chnlIdx * buffer.config.numSamplesPerChannel + smplIdx; } static ivas_error getAmbisonicsOrder( AUDIO_CONFIG config, int16_t *order ) { switch ( config ) { case IVAS_AUDIO_CONFIG_FOA: *order = 1; break; case IVAS_AUDIO_CONFIG_HOA2: *order = 2; break; case IVAS_AUDIO_CONFIG_HOA3: *order = 3; break; default: return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Unsupported audio config" ); } return IVAS_ERR_OK; } /*------------------------------------------------------------------------- * Helper functions used by SHrotmatgen, * an implementation of the algorithm in Loading Loading @@ -318,7 +296,7 @@ static void SHrotmatgen( return; } static ivas_error rotateFrameSba( static void rotateFrameSba( IVAS_ENC_AudioBuffer inAudio, /* i : Input Audio buffer */ int16_t sba_order, /* i : Input Audio config */ const ENC_HeadRotData *headRotData, /* i : Head rotation data */ Loading @@ -335,7 +313,6 @@ static ivas_error rotateFrameSba( enc_rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; enc_rotation_gains gains; ivas_error error; int16_t idx; float val, cf, oneminuscf; Loading Loading @@ -405,7 +382,7 @@ static ivas_error rotateFrameSba( pop_wmops(); return IVAS_ERR_OK; return; } /*-------------------------------------------------------------------* Loading Loading @@ -623,10 +600,7 @@ ivas_error ivas_enc( data_out.config.numSamplesPerChannel = n_samples_chan; data_out.data = malloc( nchan_inp * n_samples_chan * sizeof( float ) ); if ( ( error = rotateFrameSba( data_in, st_ivas->hEncoderConfig->sba_order, &st_ivas->headRotData, &st_ivas->headRotData.rot_gains_prev[0], data_out ) ) != IVAS_ERR_OK ) { return error; } rotateFrameSba( data_in, st_ivas->hEncoderConfig->sba_order, &st_ivas->headRotData, &st_ivas->headRotData.rot_gains_prev[0], data_out ); /* Copy data to audio buffer (needs to be cleaned up) */ for ( ch = 0; ch < nchan_inp; ++ch ) Loading Loading
lib_enc/ivas_enc.c +3 −29 Original line number Diff line number Diff line Loading @@ -64,28 +64,6 @@ static float *getSmplPtr( return buffer.data + chnlIdx * buffer.config.numSamplesPerChannel + smplIdx; } static ivas_error getAmbisonicsOrder( AUDIO_CONFIG config, int16_t *order ) { switch ( config ) { case IVAS_AUDIO_CONFIG_FOA: *order = 1; break; case IVAS_AUDIO_CONFIG_HOA2: *order = 2; break; case IVAS_AUDIO_CONFIG_HOA3: *order = 3; break; default: return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Unsupported audio config" ); } return IVAS_ERR_OK; } /*------------------------------------------------------------------------- * Helper functions used by SHrotmatgen, * an implementation of the algorithm in Loading Loading @@ -318,7 +296,7 @@ static void SHrotmatgen( return; } static ivas_error rotateFrameSba( static void rotateFrameSba( IVAS_ENC_AudioBuffer inAudio, /* i : Input Audio buffer */ int16_t sba_order, /* i : Input Audio config */ const ENC_HeadRotData *headRotData, /* i : Head rotation data */ Loading @@ -335,7 +313,6 @@ static ivas_error rotateFrameSba( enc_rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; enc_rotation_gains gains; ivas_error error; int16_t idx; float val, cf, oneminuscf; Loading Loading @@ -405,7 +382,7 @@ static ivas_error rotateFrameSba( pop_wmops(); return IVAS_ERR_OK; return; } /*-------------------------------------------------------------------* Loading Loading @@ -623,10 +600,7 @@ ivas_error ivas_enc( data_out.config.numSamplesPerChannel = n_samples_chan; data_out.data = malloc( nchan_inp * n_samples_chan * sizeof( float ) ); if ( ( error = rotateFrameSba( data_in, st_ivas->hEncoderConfig->sba_order, &st_ivas->headRotData, &st_ivas->headRotData.rot_gains_prev[0], data_out ) ) != IVAS_ERR_OK ) { return error; } rotateFrameSba( data_in, st_ivas->hEncoderConfig->sba_order, &st_ivas->headRotData, &st_ivas->headRotData.rot_gains_prev[0], data_out ); /* Copy data to audio buffer (needs to be cleaned up) */ for ( ch = 0; ch < nchan_inp; ++ch ) Loading