Commit 9d4d44e1 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1372_ISAR_POST_REND

parent 7180890b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@

/* #################### Start BASOP porting switches ############################ */

#define FIX_1372_ISAR_POST_REND
#define NONBE_FIX_984_OMASA_EXT_OUTPUT                  /* Nokia: issue #984: complete the OMASA EXT output implementation */
#define FIX_1161_REDUCE_OMASA_HEAP                      /* VA: reduction of OMASA heap memory */
#define USE_NEW_HRTF_BINARY_FILE_FORMAT                 /* Orange: to activate when decided to change the hrtf binary file format */
+0 −10
Original line number Diff line number Diff line
@@ -128,15 +128,6 @@ void isar_log_cldfb2wav_data(
);
#endif

#ifndef FIX_1372_ISAR_POST_REND
void isar_SplitRenderer_PostRenderer(
    ISAR_BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle        */
    MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
    Word32 Cldfb_RealBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o  : Reference/out Binaural signals */
    Word32 Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o  : Reference/out Binaural signals */
    const IVAS_QUATERNION Quaternion_act 
);
#else
void isar_SplitRenderer_PostRenderer(
    ISAR_BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle        */
    MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
@@ -145,7 +136,6 @@ void isar_SplitRenderer_PostRenderer(
    const IVAS_QUATERNION Quaternion_act,
    Word16 *Q_in 
);
#endif

void isar_splitBinLCLDDecProcess(
    ISAR_BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec,
+0 −52
Original line number Diff line number Diff line
@@ -1589,14 +1589,6 @@ static void interpolate_rend_md_fx(
 *
 *-----------------------------------------------------------------------------------------*/

#ifndef FIX_1372_ISAR_POST_REND
void isar_SplitRenderer_PostRenderer(
    ISAR_BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle    */
    MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
    Word32 Cldfb_RealBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o  : Reference/out Binaural signals */
    Word32 Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o  : Reference/out Binaural signals */
    const IVAS_QUATERNION Quaternion_act )
#else
void isar_SplitRenderer_PostRenderer(
    ISAR_BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle    */
    MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
@@ -1604,20 +1596,13 @@ void isar_SplitRenderer_PostRenderer(
    Word32 Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o  : Reference/out Binaural signals */
    const IVAS_QUATERNION Quaternion_act,
    Word16 *Q_in )
#endif
{
    Word16 pos_idx, b, brange[2], ch_idx1;
    Word16 num_md_bands, slot_idx, b2, index_slot, num_slots, sf_idx_md;
    Word32 gd_int_fx;
#ifndef FIX_1372_ISAR_POST_REND
    Word32 pred_out_re_fx[BINAURAL_CHANNELS], pred_out_im_fx[BINAURAL_CHANNELS];
    Word32 tmp_re_fx, tmp_im_fx;
    Word16 exp_tmp1, exp_tmp2;
#else
    Word64 pred_out_re_fx64[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], pred_out_im_fx64[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    Word64 tmp_re_fx64, tmp_im_fx64, out64_re, out64_im;
    Word16 shift64 = 63;
#endif
    ISAR_BIN_HR_SPLIT_REND_MD rot_md_act[1][MAX_SPLIT_REND_MD_BANDS];
    Word16 interp_yaw_pose_idx[2], interp_pitch_pose_idx[2], interp_roll_pose_idx[2];
    Word32 interp_yaw_fact_fx, interp_pitch_fact_fx, interp_roll_fact_fx;
@@ -1707,21 +1692,6 @@ void isar_SplitRenderer_PostRenderer(
                    FOR( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ )
                    {
                        /* Apply prediction matrix */
#ifndef FIX_1372_ISAR_POST_REND
                        ivas_cmult_fix( Cldfb_RealBuffer_Ref_Binaural_fx[0][index_slot][b2], 25, Cldfb_ImagBuffer_Ref_Binaural_fx[0][index_slot][b2], 25, mix_mat_re_fx[0][ch_idx1], 6, mix_mat_im_fx[0][ch_idx1], 6, &tmp_re_fx, &tmp_im_fx, &exp_tmp1, &exp_tmp2 );

                        pred_out_re_fx[ch_idx1] = tmp_re_fx;
                        pred_out_im_fx[ch_idx1] = tmp_im_fx;
                        Word16 exp_re = exp_tmp1;
                        Word16 exp_im = exp_tmp2;

                        ivas_cmult_fix( Cldfb_RealBuffer_Ref_Binaural_fx[1][index_slot][b2], 25, Cldfb_ImagBuffer_Ref_Binaural_fx[1][index_slot][b2], 25, mix_mat_re_fx[1][ch_idx1], 6, mix_mat_im_fx[1][ch_idx1], 6, &tmp_re_fx, &tmp_im_fx, &exp_tmp1, &exp_tmp2 );

                        pred_out_re_fx[ch_idx1] = BASOP_Util_Add_Mant32Exp( pred_out_re_fx[ch_idx1], exp_re, tmp_re_fx, exp_tmp1, &exp_re );
                        pred_out_re_fx[ch_idx1] = L_shl( pred_out_re_fx[ch_idx1], exp_re - 25 );
                        pred_out_im_fx[ch_idx1] = BASOP_Util_Add_Mant32Exp( pred_out_im_fx[ch_idx1], exp_im, tmp_im_fx, exp_tmp2, &exp_im );
                        pred_out_im_fx[ch_idx1] = L_shl( pred_out_im_fx[ch_idx1], exp_im - 25 );
#else
                        tmp_re_fx64 = W_mult_32_32( Cldfb_RealBuffer_Ref_Binaural_fx[0][index_slot][b2], mix_mat_re_fx[0][ch_idx1] );
                        tmp_im_fx64 = W_mult_32_32( Cldfb_ImagBuffer_Ref_Binaural_fx[0][index_slot][b2], mix_mat_im_fx[0][ch_idx1] );
                        out64_re = W_sub( tmp_re_fx64, tmp_im_fx64 );
@@ -1756,21 +1726,12 @@ void isar_SplitRenderer_PostRenderer(
                        move16();
                        move64();
                        move64();
#endif
                    }

#ifndef FIX_1372_ISAR_POST_REND
                    FOR( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ )
                    {
                        Cldfb_RealBuffer_Ref_Binaural_fx[ch_idx1][index_slot][b2] = pred_out_re_fx[ch_idx1];
                        Cldfb_ImagBuffer_Ref_Binaural_fx[ch_idx1][index_slot][b2] = pred_out_im_fx[ch_idx1];
                    }
#endif
                }
            }
        }

#ifdef FIX_1372_ISAR_POST_REND
        FOR( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ )
        {
            FOR( slot_idx = 0; slot_idx < num_slots; slot_idx++ )
@@ -1786,7 +1747,6 @@ void isar_SplitRenderer_PostRenderer(
        }
        *Q_in = sub( add( *Q_in, shift64 ), Q6 );
        move16();
#endif
    }

    pos_idx = 0;
@@ -1846,11 +1806,7 @@ static void isar_rend_CldfbSplitPostRendProcessTdIn(
        }
    }

#ifndef FIX_1372_ISAR_POST_REND
    isar_SplitRenderer_PostRenderer( hBinHrSplitPostRend, pMultiBinPoseData, Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, QuaternionPost );
#else
    isar_SplitRenderer_PostRenderer( hBinHrSplitPostRend, pMultiBinPoseData, Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, QuaternionPost, &Q_in );
#endif

    /* Implement CLDFB synthesis */
    FOR( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ )
@@ -1871,11 +1827,7 @@ static void isar_rend_CldfbSplitPostRendProcessTdIn(
            Scale_sig32( RealBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX, scaleFactor );
            Scale_sig32( ImagBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX, scaleFactor );
        }
#ifndef FIX_1372_ISAR_POST_REND
        Q_cldfb = add( scaleFactor, sub( Q_output, Q5 ) );
#else
        Q_cldfb = add( scaleFactor, Q_in );
#endif
        Scale_sig32( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->p_filter_length, sub( sub( Q_cldfb, 1 ), Q11 ) );
        cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch_idx][0] ), num_cldfb_bands * CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, 0, 0, hBinHrSplitPostRend->cldfbSyn[ch_idx] ); // Q_cldfb - 1
        Scale_sig32( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->p_filter_length, sub( Q11, sub( Q_cldfb, 1 ) ) );
@@ -1916,11 +1868,7 @@ void isar_rend_CldfbSplitPostRendProcess(
        return;
    }

#ifndef FIX_1372_ISAR_POST_REND
    isar_SplitRenderer_PostRenderer( hBinHrSplitPostRend, pMultiBinPoseData, Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, QuaternionPost );
#else
    isar_SplitRenderer_PostRenderer( hBinHrSplitPostRend, pMultiBinPoseData, Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, QuaternionPost, &Q_cldfb_in );
#endif

    /* Implement CLDFB synthesis */
    FOR( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ )