Loading lib_dec/ivas_binRenderer_internal_fx.c +1068 −1070 Original line number Diff line number Diff line Loading @@ -390,40 +390,40 @@ static void ivas_binRenderer_filterModule_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } if ( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } if ( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } if ( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } Loading Loading @@ -526,13 +526,13 @@ static void ivas_binRenderer_filterModule_fx( IF( EQ_16( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hBinRenConvModule->Q_filterStates[pos_idx] = 31; move16(); for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { /* set the memories to zero */ set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] ); Loading @@ -543,13 +543,13 @@ static void ivas_binRenderer_filterModule_fx( } ELSE { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hBinRenConvModule->Q_filterStates[pos_idx] = 31; move16(); for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { /* set the memories to zero */ set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTaps ); Loading Loading @@ -644,10 +644,8 @@ static void ivas_binRenderer_filterModule_fx( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" ); } for ( i = 0; i < dim1; i++ ) { IF( ( localMem[i] = (Word32 **) malloc( dim2 * sizeof( Word32 * ) ) ) == NULL ) { FOR( i = 0; i < dim1; i++ ){ IF( ( localMem[i] = (Word32 **) malloc( dim2 * sizeof( Word32 * ) ) ) == NULL ){ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" ); } IF( allocate_init_flag == 0 ) Loading Loading @@ -1086,7 +1084,7 @@ static void ivas_binRenderer_filterModule_fx( set32_fx( outImagRightPtr_fx, 0, CLDFB_NO_CHANNELS_MAX ); /*Ambisonics input requires different processing*/ if ( EQ_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) IF( EQ_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) { Word32 *inRealPtr_W, *inImagPtr_W; Word32 *inRealPtr_Y, *inImagPtr_Y; Loading @@ -1106,7 +1104,7 @@ static void ivas_binRenderer_filterModule_fx( outImagRightPtr_fx[bandIdx] = L_sub( inImagPtr_W[bandIdx], inImagPtr_Y[bandIdx] ); } } else ELSE { FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { Loading Loading @@ -1163,12 +1161,12 @@ static void ivas_binRenderer_filterModule_fx( * prepare library opening *-----------------------------------------------------------------*/ if ( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) IF( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Renderer\n" ) ); } if ( ( hBinRenderer->hInputSetup = (IVAS_OUTPUT_SETUP_HANDLE) malloc( sizeof( IVAS_OUTPUT_SETUP ) ) ) == NULL ) IF( ( hBinRenderer->hInputSetup = (IVAS_OUTPUT_SETUP_HANDLE) malloc( sizeof( IVAS_OUTPUT_SETUP ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output setup Binaural Renderer\n" ) ); } Loading Loading @@ -1903,11 +1901,11 @@ static void ivas_binRenderer_filterModule_fx( modify_Rmat_q_fx( Rmat_local, Rmat_local, sub( shl( q_fact_orig, 1 ), 32 ), Q30 ); if ( hBinRenderer->hInputSetup->is_loudspeaker_setup ) IF( hBinRenderer->hInputSetup->is_loudspeaker_setup ) { rotateFrame_sd_cldfb_fixed( Rmat_local, RealBuffer_fx, ImagBuffer_fx, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); } else ELSE { rotateFrame_shd_cldfb( RealBuffer_fx, ImagBuffer_fx, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); } Loading Loading @@ -1959,7 +1957,7 @@ static void ivas_binRenderer_filterModule_fx( { FOR( k = 0; k < numTimeSlots; k++ ) { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { /* Combine first and second parts to generate binaural output signal with room effect */ v_add_32( Cldfb_RealBuffer_Binaural_fx[pos_idx][chIdx][k], reverbRe_fx[chIdx][k], Cldfb_RealBuffer_Binaural_fx[pos_idx][chIdx][k], hBinRenderer->conv_band ); // Q6 Loading Loading
lib_dec/ivas_binRenderer_internal_fx.c +1068 −1070 Original line number Diff line number Diff line Loading @@ -390,40 +390,40 @@ static void ivas_binRenderer_filterModule_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } if ( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx] = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } if ( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } if ( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) IF( ( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } Loading Loading @@ -526,13 +526,13 @@ static void ivas_binRenderer_filterModule_fx( IF( EQ_16( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hBinRenConvModule->Q_filterStates[pos_idx] = 31; move16(); for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { /* set the memories to zero */ set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] ); Loading @@ -543,13 +543,13 @@ static void ivas_binRenderer_filterModule_fx( } ELSE { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hBinRenConvModule->Q_filterStates[pos_idx] = 31; move16(); for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { /* set the memories to zero */ set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTaps ); Loading Loading @@ -644,10 +644,8 @@ static void ivas_binRenderer_filterModule_fx( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" ); } for ( i = 0; i < dim1; i++ ) { IF( ( localMem[i] = (Word32 **) malloc( dim2 * sizeof( Word32 * ) ) ) == NULL ) { FOR( i = 0; i < dim1; i++ ){ IF( ( localMem[i] = (Word32 **) malloc( dim2 * sizeof( Word32 * ) ) ) == NULL ){ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" ); } IF( allocate_init_flag == 0 ) Loading Loading @@ -1086,7 +1084,7 @@ static void ivas_binRenderer_filterModule_fx( set32_fx( outImagRightPtr_fx, 0, CLDFB_NO_CHANNELS_MAX ); /*Ambisonics input requires different processing*/ if ( EQ_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) IF( EQ_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) { Word32 *inRealPtr_W, *inImagPtr_W; Word32 *inRealPtr_Y, *inImagPtr_Y; Loading @@ -1106,7 +1104,7 @@ static void ivas_binRenderer_filterModule_fx( outImagRightPtr_fx[bandIdx] = L_sub( inImagPtr_W[bandIdx], inImagPtr_Y[bandIdx] ); } } else ELSE { FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { Loading Loading @@ -1163,12 +1161,12 @@ static void ivas_binRenderer_filterModule_fx( * prepare library opening *-----------------------------------------------------------------*/ if ( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) IF( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Renderer\n" ) ); } if ( ( hBinRenderer->hInputSetup = (IVAS_OUTPUT_SETUP_HANDLE) malloc( sizeof( IVAS_OUTPUT_SETUP ) ) ) == NULL ) IF( ( hBinRenderer->hInputSetup = (IVAS_OUTPUT_SETUP_HANDLE) malloc( sizeof( IVAS_OUTPUT_SETUP ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output setup Binaural Renderer\n" ) ); } Loading Loading @@ -1903,11 +1901,11 @@ static void ivas_binRenderer_filterModule_fx( modify_Rmat_q_fx( Rmat_local, Rmat_local, sub( shl( q_fact_orig, 1 ), 32 ), Q30 ); if ( hBinRenderer->hInputSetup->is_loudspeaker_setup ) IF( hBinRenderer->hInputSetup->is_loudspeaker_setup ) { rotateFrame_sd_cldfb_fixed( Rmat_local, RealBuffer_fx, ImagBuffer_fx, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); } else ELSE { rotateFrame_shd_cldfb( RealBuffer_fx, ImagBuffer_fx, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); } Loading Loading @@ -1959,7 +1957,7 @@ static void ivas_binRenderer_filterModule_fx( { FOR( k = 0; k < numTimeSlots; k++ ) { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { /* Combine first and second parts to generate binaural output signal with room effect */ v_add_32( Cldfb_RealBuffer_Binaural_fx[pos_idx][chIdx][k], reverbRe_fx[chIdx][k], Cldfb_RealBuffer_Binaural_fx[pos_idx][chIdx][k], hBinRenderer->conv_band ); // Q6 Loading