Commit cc8a9faa authored by TYAGIRIS's avatar TYAGIRIS
Browse files

Merge branch 'ivas-float-update' of...

Merge branch 'ivas-float-update' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into ivas-float-update
parents 3edf1998 05f58f72
Loading
Loading
Loading
Loading
+126 −90
Original line number Diff line number Diff line
@@ -433,8 +433,7 @@ static int16_t getTotalNumInChannels(
    IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS],
    IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS],
    IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS],
    IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS]
)
    IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] )
{
    int16_t totalNumInChannels = 0;
    int16_t i, numInputChannels;
@@ -520,8 +519,7 @@ static void setupWithSingleFormatInput(
    CmdlnArgs args,
    char *audioFilePath,
    IsmPositionProvider *positionProvider,
    MasaFileReader **masaReaders
)
    MasaFileReader **masaReaders )
{
    /* With single-format input, inputFilePath is the path to input audio file. */
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
@@ -580,8 +578,6 @@ static float dBToLin(
}




/*------------------------------------------------------------------------------------------*
 * main()
 *
@@ -641,6 +637,8 @@ int main(
        lfeRoutingConfigs[i] = NULL;
    }

    IVAS_REND_PrintDisclaimer();

    CmdlnArgs args = parseCmdlnArgs( argc, argv );

    if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) ||
@@ -800,6 +798,48 @@ int main(
        exit( -1 );
    }

    fprintf( stdout, "Input audio file:       %s\n", args.inputFilePath );
    fprintf( stdout, "Output audio file:      %s\n\n", args.outputFilePath );

    if ( args.inConfig.numAudioObjects > 0 )
    {
        if ( args.inConfig.numAudioObjects == 1 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM1 );
        }
        else if ( args.inConfig.numAudioObjects == 2 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM2 );
        }
        else if ( args.inConfig.numAudioObjects == 3 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM3 );
        }
        else if ( args.inConfig.numAudioObjects == 4 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM4 );
        }
    }
    for ( i = 0; i < args.inConfig.numMultiChannelBuses; i++ )
    {
        IVAS_REND_PrintInputConfig( args.inConfig.multiChannelBuses[i].audioConfig );
    }
    for ( i = 0; i < args.inConfig.numMasaBuses; i++ )
    {
        IVAS_REND_PrintInputConfig( args.inConfig.masaBuses[i].audioConfig );
    }
    for ( i = 0; i < args.inConfig.numAmbisonicsBuses; i++ )
    {
        IVAS_REND_PrintInputConfig( args.inConfig.ambisonicsBuses[i].audioConfig );
    }

    if ( ( error = IVAS_REND_PrintConfig( hIvasRend ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\n IVAS_REND_PrintConfig failed: %s\n\n", ivas_error_to_string( error ) );
        //goto cleanup;
        exit( -1 );
    }

    /* === Configure === */
    if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
    {
@@ -855,7 +895,6 @@ int main(
            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed\n" );
            exit( -1 );
        }

    }

    if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientation_tracking ) ) != IVAS_ERR_OK )
@@ -1366,7 +1405,6 @@ int main(
        }



        if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in getting samples\n" );
@@ -3270,8 +3308,7 @@ static void convertInputBuffer(
    const int16_t numIntSamplesPerChannel,
    const int16_t numFloatSamplesPerChannel,
    const int16_t numChannels,
    float *floatBuffer
)
    float *floatBuffer )
{
    int16_t chnl, smpl, i;

@@ -3308,8 +3345,7 @@ static void convertOutputBuffer(
    const float *floatBuffer,
    const int16_t numSamplesPerChannel,
    const int16_t numChannels,
    int16_t *intBuffer
)
    int16_t *intBuffer )
{
    int16_t chnl, smpl, i;
    float temp;
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ int16_t print_disclaimer( FILE *fPtr )
{

    fprintf( fPtr, "\n==================================================================================================\n" );
    fprintf( fPtr, " IVAS Codec Baseline\n" );
    fprintf( fPtr, " \n IVAS Codec Version IVAS-FL-1.0\n" );
    fprintf( fPtr, " \n" );
    fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" );
    fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" );
+16 −104
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
#include "jbm_pcmdsp_fifo.h"
#include <math.h>
#include <assert.h>
#include <string.h>
#ifdef DEBUGGING
#include "debug.h"
#endif
@@ -458,7 +457,6 @@ ivas_error IVAS_DEC_Configure(
}



/*---------------------------------------------------------------------*
 * get_render_framesize_ms( )
 *
@@ -938,8 +936,6 @@ ivas_error IVAS_DEC_GetSamples(
}




/*---------------------------------------------------------------------*
 * IVAS_DEC_Setup( )
 *
@@ -1094,8 +1090,7 @@ static ivas_error IVAS_DEC_GetRenderedSamples(
    const uint16_t nSamplesForRendering, /* i  : number of TC samples wanted from the renderer              */
    uint16_t *nSamplesRendered,          /* o  : number of samples rendered                                 */
    uint16_t *nSamplesAvailableNext,     /* o  : number of samples still available in the renerer pipeline  */
    int16_t *pcmBuf
)
    int16_t *pcmBuf )
{
    Decoder_Struct *st_ivas;
    ivas_error error;
@@ -2453,85 +2448,6 @@ const char *IVAS_DEC_GetErrorMessage(
}


/*---------------------------------------------------------------------*
 * get_channel_config()
 *
 * Gets a str related to input config
 *---------------------------------------------------------------------*/

static ivas_error get_channel_config(
    AUDIO_CONFIG config,
    char *str )
{
    if ( config == IVAS_AUDIO_CONFIG_MONO )
    {
        strcpy( str, "Mono" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_STEREO )
    {
        strcpy( str, "Stereo" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_5_1 )
    {
        strcpy( str, "Multichannel 5.1 (CICP6)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_7_1 )
    {
        strcpy( str, "Multichannel 7.1 (CICP12)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_5_1_2 )
    {
        strcpy( str, "Multichannel 5.1+2 (CICP14)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_5_1_4 )
    {
        strcpy( str, "Multichannel 5.1+4 (CICP16)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_7_1_4 )
    {
        strcpy( str, "Multichannel 7.1+4 (CICP19)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
        strcpy( str, "Multichannel (custom loudspeaker layout)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_FOA )
    {
        strcpy( str, "Ambisonics: First Order (FOA)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_HOA2 )
    {
        strcpy( str, "Ambisonics: Second Order (HOA2)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_HOA3 )
    {
        strcpy( str, "Ambisonics: Third Order (HOA3)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL )
    {
        strcpy( str, "Binaural: no room" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
    {
        strcpy( str, "Binaural: room with impulse responses" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
        strcpy( str, "Binaural: room with reverb" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL )
    {
        strcpy( str, "External renderer" );
    }
    else
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" );
    }

    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * printConfigInfo_dec( )
 *
@@ -3216,7 +3132,3 @@ static ivas_error IVAS_DEC_VoIP_reconfigure(

    return IVAS_ERR_OK;
}



+112 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include "ivas_prot_rend.h"
#include "ivas_rom_com.h"
#include "ivas_prot.h"
#include <string.h>
#ifdef DEBUGGING
#include "debug.h"
#include <assert.h>
@@ -435,3 +436,114 @@ ivas_error ivas_output_buff_dec(

    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * get_channel_config()
 *
 * Gets a str related to input config
 *---------------------------------------------------------------------*/

ivas_error get_channel_config(
    const AUDIO_CONFIG config,
    char *str )
{
    if ( config == IVAS_AUDIO_CONFIG_MONO )
    {
        strcpy( str, "Mono" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_STEREO )
    {
        strcpy( str, "Stereo" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_ISM1 )
    {
        strcpy( str, "Object-based audio (1 object)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_ISM2 )
    {
        strcpy( str, "Object-based audio (2 objects)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_ISM3 )
    {
        strcpy( str, "Object-based audio (3 objects)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_ISM4 )
    {
        strcpy( str, "Object-based audio (4 objects)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_5_1 )
    {
        strcpy( str, "Multichannel 5.1 (CICP6)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_7_1 )
    {
        strcpy( str, "Multichannel 7.1 (CICP12)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_5_1_2 )
    {
        strcpy( str, "Multichannel 5.1+2 (CICP14)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_5_1_4 )
    {
        strcpy( str, "Multichannel 5.1+4 (CICP16)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_7_1_4 )
    {
        strcpy( str, "Multichannel 7.1+4 (CICP19)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
        strcpy( str, "Multichannel (custom loudspeaker layout)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_MASA1 )
    {
        strcpy( str, "Metadata-Assisted Spatial Audio mono (MASA1)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_MASA2 )
    {
        strcpy( str, "Metadata-Assisted Spatial Audio stereo (MASA2)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_FOA )
    {
        strcpy( str, "Ambisonics: First Order (FOA)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_HOA2 )
    {
        strcpy( str, "Ambisonics: Second Order (HOA2)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_HOA3 )
    {
        strcpy( str, "Ambisonics: Third Order (HOA3)" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL )
    {
        strcpy( str, "Binaural: no room" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
    {
        strcpy( str, "Binaural: room with impulse responses" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
        strcpy( str, "Binaural: room with reverb" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    {
        strcpy( str, "BINAURAL_SPLIT_CODED" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        strcpy( str, "Binaural_Split_PCM" );
    }
    else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL )
    {
        strcpy( str, "External renderer" );
    }
    else
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" );
    }

    return IVAS_ERR_OK;
}
+6 −1
Original line number Diff line number Diff line
@@ -77,6 +77,12 @@ int16_t ivas_get_nchan_buffers_dec(
    const int32_t ivas_total_brate                              /* i  : total IVAS bitrate                              */
);

ivas_error get_channel_config(
    const AUDIO_CONFIG config,
    char *str 
);


/*----------------------------------------------------------------------------------*
 * Limiter prototypes
 *----------------------------------------------------------------------------------*/
@@ -1532,7 +1538,6 @@ void masaPrerendClose(
);



/* clang-format on */

#endif /* IVAS_PROT_REND_H */
Loading