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

formatting

parent 3b4d6b0f
Loading
Loading
Loading
Loading
Loading
+7 −15
Original line number Diff line number Diff line
@@ -1793,10 +1793,8 @@ static ivas_error initOnFirstGoodFrame(
            splitRendBitsZero.pose_correction = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
            splitRendBitsZero.codec_frame_size_ms = 20;
            if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written,
                                                     -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE
                                                     ,
                                                     splitRendBitsZero.codec_frame_size_ms
                                                     ) != IVAS_ERR_OK )
                                                     -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE,
                                                     splitRendBitsZero.codec_frame_size_ms ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
@@ -2066,9 +2064,7 @@ static ivas_error decodeG192(
    nSamplesAvailableNext = 0;

    vec_pos_update = 0;
    if ( arg.enableHeadRotation
         && arg.enable5ms
    )
    if ( arg.enableHeadRotation && arg.enable5ms )
    {
        nOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS );
        vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
@@ -2373,10 +2369,8 @@ static ivas_error decodeG192(
            if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
            {
                if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                         splitRendBits.codec, splitRendBits.pose_correction
                                                         ,
                                                         splitRendBits.codec_frame_size_ms
                                                         ) != IVAS_ERR_OK )
                                                         splitRendBits.codec, splitRendBits.pose_correction,
                                                         splitRendBits.codec_frame_size_ms ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                    goto cleanup;
@@ -2387,10 +2381,8 @@ static ivas_error decodeG192(
                if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
                {
                    if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                             splitRendBits.codec, splitRendBits.pose_correction
                                                             ,
                                                             splitRendBits.codec_frame_size_ms
                                                             ) != IVAS_ERR_OK )
                                                             splitRendBits.codec, splitRendBits.pose_correction,
                                                             splitRendBits.codec_frame_size_ms ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                        goto cleanup;
+14 −32
Original line number Diff line number Diff line
@@ -996,9 +996,7 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    }
#endif
    const int16_t frameSize_smpls = (int16_t) (
        ( args.framing_5ms ? 5 : 20 )
        * args.sampleRate / 1000 );
    const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 );

    IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 };
    IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 };
@@ -1008,10 +1006,8 @@ int main(
    IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 };
#endif

    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain
                                   ,
                                   ( args.framing_5ms ) ? 1 : 4
                                   ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain,
                                   ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -1455,17 +1451,13 @@ int main(

#ifdef SPLIT_REND_WITH_HEAD_ROT
        numSamplesRead = 0;
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args )
             && splitBinNeedsNewFrame
        )
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) && splitBinNeedsNewFrame )
        {
            ivas_error error_tmp;
            numSamplesRead = (int16_t) inBufferSize;
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection
                                                        ,
                                                        &bitsBuffer.config.codec_frame_size_ms
            );
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection,
                                                        &bitsBuffer.config.codec_frame_size_ms );
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1493,9 +1485,7 @@ int main(
        }
#endif

        if ( numSamplesRead == 0
             && splitBinNeedsNewFrame
        )
        if ( numSamplesRead == 0 && splitBinNeedsNewFrame )
        {
            /* end of input data */
            break;
@@ -1570,8 +1560,7 @@ int main(
                                                          DEFAULT_AXIS
#endif
                                                          ,
                                                          sf_idx
                                                          ) ) != IVAS_ERR_OK )
                                                          sf_idx ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
@@ -1589,9 +1578,7 @@ int main(

#ifdef SPLIT_REND_WITH_HEAD_ROT
        /* Read from split renderer bfi file if specified */
        if ( splitRendBFIReader != NULL
             && splitBinNeedsNewFrame
        )
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        {
            int16_t bfi;
            SplitRendBFIFileReading( splitRendBFIReader, &bfi );
@@ -1617,10 +1604,8 @@ int main(
            }
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
            {
                if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx]
                                                                 ,
                                                                 sf_idx
                                                                 ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx],
                                                                 sf_idx ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
@@ -1784,8 +1769,7 @@ int main(
        else
        {
#endif
            if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer
                                                 ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer ) ) != IVAS_ERR_OK )
            {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) );
@@ -1845,10 +1829,8 @@ int main(
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) )
        {
            if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection
                                                     ,
                                                     bitsBuffer.config.codec_frame_size_ms
                                                     ) != IVAS_ERR_OK )
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection,
                                                     bitsBuffer.config.codec_frame_size_ms ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
+2 −4
Original line number Diff line number Diff line
@@ -2110,10 +2110,8 @@ void ivas_rend_CldfbMultiBinRendProcess(
    float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    float Cldfb_Out_Real[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o  : Binaural signals */
    float Cldfb_Out_Imag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    const int16_t low_res_pre_rend_rot
    ,
    int16_t num_subframes
)
    const int16_t low_res_pre_rend_rot,
    int16_t num_subframes )
{
    int16_t slot_idx, ch_idx, idx, pose_idx, i, j;
    int16_t sf_idx;
+16 −32
Original line number Diff line number Diff line
@@ -228,10 +228,8 @@ ivas_error ivas_dec(

                ivas_param_ism_params_to_masa_param_mapping( st_ivas );

                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport
                                         ,
                                         MAX_PARAM_SPATIAL_SUBFRAMES
                );
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport,
                                         MAX_PARAM_SPATIAL_SUBFRAMES );
            }
            else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
            {
@@ -309,8 +307,7 @@ ivas_error ivas_dec(
            else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM )
            {
                if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL,
                                                       NULL, NULL, NULL, p_output, output_Fs
                                                       ,
                                                       NULL, NULL, NULL, p_output, output_Fs,
                                                       MAX_PARAM_SPATIAL_SUBFRAMES
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                       ,
@@ -459,10 +456,8 @@ ivas_error ivas_dec(
        /* Loudspeakers, Ambisonics or Binaural rendering */
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, nchan_remapped
                                     ,
                                     MAX_PARAM_SPATIAL_SUBFRAMES
            );
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, nchan_remapped,
                                     MAX_PARAM_SPATIAL_SUBFRAMES );
        }
        else if ( st_ivas->ivas_format == MASA_FORMAT )
        {
@@ -477,10 +472,8 @@ ivas_error ivas_dec(
            }
            else if ( st_ivas->renderer_type == RENDERER_DIRAC )
            {
                ivas_dirac_dec( st_ivas, output, nchan_remapped
                                ,
                                MAX_PARAM_SPATIAL_SUBFRAMES
                );
                ivas_dirac_dec( st_ivas, output, nchan_remapped,
                                MAX_PARAM_SPATIAL_SUBFRAMES );
            }
        }
        else if ( !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 )
@@ -567,10 +560,8 @@ ivas_error ivas_dec(
            }
            else
            {
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport
                                         ,
                                         MAX_PARAM_SPATIAL_SUBFRAMES
                );
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport,
                                         MAX_PARAM_SPATIAL_SUBFRAMES );
            }
        }
        else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
@@ -710,10 +701,8 @@ ivas_error ivas_dec(
        /* Loudspeakers, Ambisonics or Binaural rendering */
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, &output[sba_ch_idx], nchan_remapped
                                     ,
                                     MAX_PARAM_SPATIAL_SUBFRAMES
            );
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, &output[sba_ch_idx], nchan_remapped,
                                     MAX_PARAM_SPATIAL_SUBFRAMES );
        }
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
        {
@@ -840,8 +829,7 @@ ivas_error ivas_dec(
                {
#endif
                    if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig,
                                                           st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs
                                                           ,
                                                           st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs,
                                                           MAX_PARAM_SPATIAL_SUBFRAMES
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                           ,
@@ -1080,17 +1068,13 @@ ivas_error ivas_dec(
            /* Rendering */
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
            {
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport
                                         ,
                                         MAX_PARAM_SPATIAL_SUBFRAMES
                );
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport,
                                         MAX_PARAM_SPATIAL_SUBFRAMES );
            }
            else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */
            {
                ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport
                                ,
                                MAX_PARAM_SPATIAL_SUBFRAMES
                );
                ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport,
                                MAX_PARAM_SPATIAL_SUBFRAMES );

                if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
                {
+6 −12
Original line number Diff line number Diff line
@@ -264,10 +264,8 @@ static ivas_error ivas_dec_init_split_rend(
    error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend,
                                      &st_ivas->hRenderConfig->split_rend_config,
                                      st_ivas->hDecoderConfig->output_Fs,
                                      cldfb_in, pcm_out
                                      ,
                                      st_ivas->hDecoderConfig->Opt_5ms
    );
                                      cldfb_in, pcm_out,
                                      st_ivas->hDecoderConfig->Opt_5ms );
    return error;
}
#endif
@@ -995,10 +993,8 @@ ivas_error ivas_init_decoder_front(

    if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation )
    {
        if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData )
                                                           ,
                                                       ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES
                                                       ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ),
                                                       ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -1010,10 +1006,8 @@ ivas_error ivas_init_decoder_front(

    if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation )
    {
        if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData )
                                                           ,
                                                       ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES
                                                       ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData ),
                                                       ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
        {
            return error;
        }
Loading