Commit c6fbe78d authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

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

Merge branch 'ivas-float-update' into 1066-ivas-float-update-enhance-the-mode-enforcement-functionality-force-to-include-support-for-read-write-operations
parents 9f1556f6 6432cc34
Loading
Loading
Loading
Loading
Loading
+41 −1
Original line number Diff line number Diff line
@@ -384,6 +384,15 @@ int main(
        goto cleanup;
    }

#ifdef SUPPORT_FORCE_TCX10_TCX20
#ifdef DEBUGGING
    if ( arg.forcedMode == IVAS_ENC_FORCE_TCX10 && totalBitrate < 48000 )
    {
        fprintf( stderr, "Warning: Enforcing the TCX10 mode is only supported for bitrates higher or equal than 48 kbps!\n\n" );
    }
#endif
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure and initialize (allocate memory for static variables) the encoder
     *------------------------------------------------------------------------------------------*/
@@ -1102,7 +1111,24 @@ static bool parseCmdlIVAS_enc(
            }
            else
            {
#ifdef SUPPORT_FORCE_TCX10_TCX20
                if ( arg->forcedMode == IVAS_ENC_FORCE_TCX10 )
                {
                    strcpy( stmp, "TCX10" );
                }
                else if ( arg->forcedMode == IVAS_ENC_FORCE_TCX20 )
                {
                    strcpy( stmp, "TCX20" );
                }
                else
                {
                    strncpy( stmp, argv[i + 1], sizeof( stmp ) );
                }

                fprintf( stdout, "Forcing codec to:       %s\n", stmp );
#else
                fprintf( stdout, "Forcing codec to:       %s\n", argv[i + 1] );
#endif
            }
#endif

@@ -2134,10 +2160,24 @@ static IVAS_ENC_FORCED_MODE parseForcedMode(
    {
        return IVAS_ENC_FORCE_GSC;
    }
    if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) )
    if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) 
#ifdef SUPPORT_FORCE_TCX10_TCX20
         || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 )
#endif
        )
    {
#ifdef SUPPORT_FORCE_TCX10_TCX20
        return IVAS_ENC_FORCE_TCX20;
#else
        return IVAS_ENC_FORCE_TCX;
#endif
    }
#ifdef SUPPORT_FORCE_TCX10_TCX20
    if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) )
    {
        return IVAS_ENC_FORCE_TCX10;
    }
#endif
    if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) )
    {
        return IVAS_ENC_FORCE_HQ;
+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;
+6 −0
Original line number Diff line number Diff line
@@ -81,8 +81,14 @@
#define FORCE_MUSIC                     101             /* debugging - force music on the command line */
#define FORCE_ACELP                     102             /* debugging - force ACELP core on the command line */
#define FORCE_GSC                       103             /* debugging - force GSC core on the command line */
#ifdef SUPPORT_FORCE_TCX10_TCX20
#define FORCE_TCX10                     104             /* debugging - force TCX10 core on the command line */
#define FORCE_TCX20                     105             /* debugging - force TCX20 core on the command line */
#define FORCE_HQ                        106             /* debugging - force HQ core on the command line */
#else
#define FORCE_TCX                       104             /* debugging - force TCX core on the command line */
#define FORCE_HQ                        105             /* debugging - force HQ core on the command line */
#endif
#define FORCE_TD_RENDERER               201
#define FORCE_CLDFB_RENDERER            202
#endif
+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" );
+4 −1
Original line number Diff line number Diff line
@@ -200,6 +200,9 @@ ivas_error pre_proc_front_ivas(
    const int16_t front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const IVAS_FORMAT ivas_format,                              /* i  : IVAS format                                */
    const int16_t MCT_flag,                                     /* i  : hMCT handle allocated (1) or not (0)       */
#ifdef NONBE_1211_DTX_BR_SWITCHING
    const int32_t last_ivas_total_brate,                        /* i  : last IVAS total bitrate                    */
#endif
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                         */
#ifdef DEBUG_MODE_INFO
	, const int16_t ch_idx
Loading