Loading lib_com/ivas_prot_fx.h +19 −0 Original line number Diff line number Diff line Loading @@ -5938,6 +5938,25 @@ void Quat2EulerDegree_fx( Word32 *pitch_fx, /* o : pitch */ Word32 *roll_fx /* o : roll */ ); void Copy_Quat_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat /* i : quaternion describing the rotation */ ); void modify_Quat_q_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat, /* i : quaternion describing the rotation */ Word16 q_new /* i : quaternion describing the rotation */ ); void modify_Rmat_q_fx( const Word32 Rmat_in[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* i : real-space rotation matrix for this rotation */ Word32 Rmat_out[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* o : real-space rotation matrix for this rotation*/ Word16 num_subframes, Word16 q_cur, /* i : current q factor for rotation matrix */ Word16 q_new /* i : target q factor for rotation matrix */ ); #endif #endif lib_com/ivas_rotation_com.c +73 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,79 @@ void Euler2Quat( #ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * Copy_Quat_fx() * * Quaternion q factor modification *------------------------------------------------------------------------*/ void Copy_Quat_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat /* i : quaternion describing the rotation */ ) { out_quat->q_fact = in_quat->q_fact; out_quat->w_fx = in_quat->w_fx; out_quat->x_fx = in_quat->x_fx; out_quat->y_fx = in_quat->y_fx; out_quat->z_fx = in_quat->z_fx; move16(); move32(); move32(); move32(); move32(); return; } /*------------------------------------------------------------------------- * Scale_Quat_fx() * * Quaternion q factor modification *------------------------------------------------------------------------*/ void modify_Quat_q_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat, /* i : quaternion describing the rotation */ Word16 q_new /* i : quaternion describing the rotation */ ) { out_quat->w_fx = L_shl( in_quat->w_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->x_fx = L_shl( in_quat->x_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->y_fx = L_shl( in_quat->y_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->z_fx = L_shl( in_quat->z_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->q_fact = q_new; return; } /*------------------------------------------------------------------------- * modify_Rmat_q_fx() * * Rotation matrix q factor modification *------------------------------------------------------------------------*/ void modify_Rmat_q_fx( const Word32 Rmat_in[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* i : real-space rotation matrix for this rotation */ Word32 Rmat_out[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* o : real-space rotation matrix for this rotation*/ Word16 num_subframes, Word16 q_cur, /* i : current q factor for rotation matrix */ Word16 q_new /* i : target q factor for rotation matrix */ ) { Word16 i, j, k; FOR( i = 0; i < num_subframes; i++ ) { FOR( j = 0; j < 3; j++ ) { FOR( k = 0; k < 3; k++ ) { Rmat_out[i][j][k] = L_shl( Rmat_in[i][j][k], sub( q_new, q_cur ) ); move32(); } } } return; } /*------------------------------------------------------------------------- * Quat2EulerDegree() * Loading lib_dec/ivas_binRenderer_internal.c +5 −8 Original line number Diff line number Diff line Loading @@ -1945,10 +1945,7 @@ void ivas_binRenderer_fx( Quaternions_abs.w_fx = L_negate( 12582912 ); // Q22 q_fact_orig = Quaternions_ref->q_fact; Quaternions_ref->w_fx = L_shl( Quaternions_ref->w_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 Quaternions_ref->x_fx = L_shl( Quaternions_ref->x_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 Quaternions_ref->y_fx = L_shl( Quaternions_ref->y_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 Quaternions_ref->z_fx = L_shl( Quaternions_ref->z_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 modify_Quat_q_fx( Quaternions_ref, Quaternions_ref, Q22 ); IF( EQ_16( hCombinedOrientationData->shd_rot_max_order, 0 ) ) { Loading Loading @@ -1981,13 +1978,13 @@ void ivas_binRenderer_fx( Quaternions_abs.z_fx = L_add( Quaternions_abs.z_fx, Quaternions_rel.z_fx ); Euler2Quat_fx( deg2rad_fx( Quaternions_abs.x_fx ), deg2rad_fx( Quaternions_abs.y_fx ), deg2rad_fx( Quaternions_abs.z_fx ), &Quaternions_abs ); Quaternions_abs.w_fx = L_shl( Quaternions_abs.w_fx, Q7 ); // Q29 Quaternions_abs.x_fx = L_shl( Quaternions_abs.x_fx, Q7 ); // Q29 Quaternions_abs.y_fx = L_shl( Quaternions_abs.y_fx, Q7 ); // Q29 Quaternions_abs.z_fx = L_shl( Quaternions_abs.z_fx, Q7 ); // Q29 modify_Quat_q_fx( &Quaternions_abs, &Quaternions_abs, q_fact_orig ); QuatToRotMat_fx( Quaternions_abs, Rmat_local ); modify_Rmat_q_fx( Rmat_local, Rmat_local, MAX_PARAM_SPATIAL_SUBFRAMES, sub( shl( q_fact_orig, 1 ), 32 ), Q30 ); if ( hBinRenderer->hInputSetup->is_loudspeaker_setup ) { rotateFrame_sd_cldfb( Rmat_local, RealBuffer_fx, ImagBuffer_fx, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); Loading lib_enc/lib_enc.c +5 −0 Original line number Diff line number Diff line Loading @@ -1447,8 +1447,13 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } #ifdef SPLIT_REND_WITH_HEAD_ROT *delay = NS2SA( hEncoderConfig->input_Fs, get_delay_fx( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, IVAS_AUDIO_CONFIG_INVALID ) ); move16(); #else *delay = NS2SA( hEncoderConfig->input_Fs, get_delay_fx( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL ) ); move16(); #endif *delay = imult1616( *delay, hEncoderConfig->nchan_inp ); move16(); Loading lib_isar/isar_stat.h +0 −8 Original line number Diff line number Diff line Loading @@ -136,14 +136,6 @@ typedef struct isar_binaural_head_rot_split_pre_rendering_struct float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; ISAR_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; ISAR_BIN_HR_SPLIT_REND_HUFF huff_cfg; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HANDLE_CLDFB_FILTER_BANK cldfbSynRotBinDec[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS]; #endif #ifdef SPLIT_POSE_CORRECTION_DEBUG BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; #endif } ISAR_BIN_HR_SPLIT_PRE_REND, *ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE; /*----------------------------------------------------------------------------------* * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) Loading Loading
lib_com/ivas_prot_fx.h +19 −0 Original line number Diff line number Diff line Loading @@ -5938,6 +5938,25 @@ void Quat2EulerDegree_fx( Word32 *pitch_fx, /* o : pitch */ Word32 *roll_fx /* o : roll */ ); void Copy_Quat_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat /* i : quaternion describing the rotation */ ); void modify_Quat_q_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat, /* i : quaternion describing the rotation */ Word16 q_new /* i : quaternion describing the rotation */ ); void modify_Rmat_q_fx( const Word32 Rmat_in[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* i : real-space rotation matrix for this rotation */ Word32 Rmat_out[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* o : real-space rotation matrix for this rotation*/ Word16 num_subframes, Word16 q_cur, /* i : current q factor for rotation matrix */ Word16 q_new /* i : target q factor for rotation matrix */ ); #endif #endif
lib_com/ivas_rotation_com.c +73 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,79 @@ void Euler2Quat( #ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * Copy_Quat_fx() * * Quaternion q factor modification *------------------------------------------------------------------------*/ void Copy_Quat_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat /* i : quaternion describing the rotation */ ) { out_quat->q_fact = in_quat->q_fact; out_quat->w_fx = in_quat->w_fx; out_quat->x_fx = in_quat->x_fx; out_quat->y_fx = in_quat->y_fx; out_quat->z_fx = in_quat->z_fx; move16(); move32(); move32(); move32(); move32(); return; } /*------------------------------------------------------------------------- * Scale_Quat_fx() * * Quaternion q factor modification *------------------------------------------------------------------------*/ void modify_Quat_q_fx( const IVAS_QUATERNION *in_quat, /* i : quaternion describing the rotation */ IVAS_QUATERNION *out_quat, /* i : quaternion describing the rotation */ Word16 q_new /* i : quaternion describing the rotation */ ) { out_quat->w_fx = L_shl( in_quat->w_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->x_fx = L_shl( in_quat->x_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->y_fx = L_shl( in_quat->y_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->z_fx = L_shl( in_quat->z_fx, sub( q_new, in_quat->q_fact ) ); // q_new out_quat->q_fact = q_new; return; } /*------------------------------------------------------------------------- * modify_Rmat_q_fx() * * Rotation matrix q factor modification *------------------------------------------------------------------------*/ void modify_Rmat_q_fx( const Word32 Rmat_in[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* i : real-space rotation matrix for this rotation */ Word32 Rmat_out[MAX_PARAM_SPATIAL_SUBFRAMES][3][3], /* o : real-space rotation matrix for this rotation*/ Word16 num_subframes, Word16 q_cur, /* i : current q factor for rotation matrix */ Word16 q_new /* i : target q factor for rotation matrix */ ) { Word16 i, j, k; FOR( i = 0; i < num_subframes; i++ ) { FOR( j = 0; j < 3; j++ ) { FOR( k = 0; k < 3; k++ ) { Rmat_out[i][j][k] = L_shl( Rmat_in[i][j][k], sub( q_new, q_cur ) ); move32(); } } } return; } /*------------------------------------------------------------------------- * Quat2EulerDegree() * Loading
lib_dec/ivas_binRenderer_internal.c +5 −8 Original line number Diff line number Diff line Loading @@ -1945,10 +1945,7 @@ void ivas_binRenderer_fx( Quaternions_abs.w_fx = L_negate( 12582912 ); // Q22 q_fact_orig = Quaternions_ref->q_fact; Quaternions_ref->w_fx = L_shl( Quaternions_ref->w_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 Quaternions_ref->x_fx = L_shl( Quaternions_ref->x_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 Quaternions_ref->y_fx = L_shl( Quaternions_ref->y_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 Quaternions_ref->z_fx = L_shl( Quaternions_ref->z_fx, sub( Q22, Quaternions_ref->q_fact ) ); // Q22 modify_Quat_q_fx( Quaternions_ref, Quaternions_ref, Q22 ); IF( EQ_16( hCombinedOrientationData->shd_rot_max_order, 0 ) ) { Loading Loading @@ -1981,13 +1978,13 @@ void ivas_binRenderer_fx( Quaternions_abs.z_fx = L_add( Quaternions_abs.z_fx, Quaternions_rel.z_fx ); Euler2Quat_fx( deg2rad_fx( Quaternions_abs.x_fx ), deg2rad_fx( Quaternions_abs.y_fx ), deg2rad_fx( Quaternions_abs.z_fx ), &Quaternions_abs ); Quaternions_abs.w_fx = L_shl( Quaternions_abs.w_fx, Q7 ); // Q29 Quaternions_abs.x_fx = L_shl( Quaternions_abs.x_fx, Q7 ); // Q29 Quaternions_abs.y_fx = L_shl( Quaternions_abs.y_fx, Q7 ); // Q29 Quaternions_abs.z_fx = L_shl( Quaternions_abs.z_fx, Q7 ); // Q29 modify_Quat_q_fx( &Quaternions_abs, &Quaternions_abs, q_fact_orig ); QuatToRotMat_fx( Quaternions_abs, Rmat_local ); modify_Rmat_q_fx( Rmat_local, Rmat_local, MAX_PARAM_SPATIAL_SUBFRAMES, sub( shl( q_fact_orig, 1 ), 32 ), Q30 ); if ( hBinRenderer->hInputSetup->is_loudspeaker_setup ) { rotateFrame_sd_cldfb( Rmat_local, RealBuffer_fx, ImagBuffer_fx, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); Loading
lib_enc/lib_enc.c +5 −0 Original line number Diff line number Diff line Loading @@ -1447,8 +1447,13 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } #ifdef SPLIT_REND_WITH_HEAD_ROT *delay = NS2SA( hEncoderConfig->input_Fs, get_delay_fx( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, IVAS_AUDIO_CONFIG_INVALID ) ); move16(); #else *delay = NS2SA( hEncoderConfig->input_Fs, get_delay_fx( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL ) ); move16(); #endif *delay = imult1616( *delay, hEncoderConfig->nchan_inp ); move16(); Loading
lib_isar/isar_stat.h +0 −8 Original line number Diff line number Diff line Loading @@ -136,14 +136,6 @@ typedef struct isar_binaural_head_rot_split_pre_rendering_struct float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; ISAR_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; ISAR_BIN_HR_SPLIT_REND_HUFF huff_cfg; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HANDLE_CLDFB_FILTER_BANK cldfbSynRotBinDec[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS]; #endif #ifdef SPLIT_POSE_CORRECTION_DEBUG BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; #endif } ISAR_BIN_HR_SPLIT_PRE_REND, *ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE; /*----------------------------------------------------------------------------------* * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) Loading