Commit 4f728cf7 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch 'main' of forge.3gpp.org:ivas-codec-pc/ivas-codec into FhG/rend_cfg_lfe

parents 89671087 fc4afb21
Loading
Loading
Loading
Loading
Loading
+69 −0
Original line number Diff line number Diff line
@@ -1118,6 +1118,22 @@ static IVAS_REND_AudioConfig ambisonicsOrderToEnum(
    return IVAS_REND_AUDIO_CONFIG_UNKNOWN;
}

#ifdef FIX_293_EXT_RENDERER_CLI
static const CmdLnParser_Option *findOptionById(
    const int32_t id )
{
    for ( int32_t i = 0; i < numCliOptions; ++i )
    {
        if ( cliOptions[i].id == id )
        {
            return &cliOptions[i];
        }
    }

    return NULL;
}
#endif

static bool parseInConfig(
    const char *inFormatStr,
    InputConfig *inConfig,
@@ -1205,8 +1221,13 @@ static bool parseInConfig(

                if ( error == IVAS_ERR_FAILED_FILE_OPEN )
                {
#ifdef FIX_293_EXT_RENDERER_CLI
                    /* Failed to open with given string - most likely wasn't a file path */
                    const CmdLnParser_Option *listOption = findOptionById( CmdLnOptionId_listFormats );
                    fprintf( stderr, "Unsupported input format: %s. To list valid formats, use option --%s.\n", inFormatStr, listOption->match );
#else
                    fprintf( stderr, "Unsupported input format: %s\n", inFormatStr );
#endif
                    return false;
                }
                if ( error != IVAS_ERR_OK )
@@ -1221,10 +1242,20 @@ static bool parseInConfig(
            }
            break;
        default:
#ifdef FIX_293_EXT_RENDERER_CLI
        {
            /* Default case covers formats that are defined in the IVAS_REND_AudioConfig enum,
             * but cannot be used at input, e.g. BINAURAL */
            const CmdLnParser_Option *listOption = findOptionById( CmdLnOptionId_listFormats );
            fprintf( stderr, "Unsupported input format: %s. To list valid formats, use option --%s.\n", inFormatStr, listOption->match );
            return false;
        }
#else
            /* Default case covers formats that are defined in the IVAS_REND_AudioConfig enum,
             * but cannot be used at input, e.g. BINAURAL */
            fprintf( stderr, "Unsupported input format: %s\n", inFormatStr );
            return false;
#endif
    }

    return true;
@@ -1390,7 +1421,20 @@ static IVAS_REND_AudioConfig parseAudioConfig(
    }
    if ( strncmp( charBuf, "ISM", 3 ) == 0 )
    {
#ifdef FIX_293_EXT_RENDERER_CLI
        /* Accept input config as ISM only if the 4th character is a number from 1 to 4.
         * Otherwise, do nothing. Unknown audio config will be returned. */
        switch ( charBuf[3] )
        {
            case '1':
            case '2':
            case '3':
            case '4':
                return IVAS_REND_AUDIO_CONFIG_OBJECT;
        }
#else
        return IVAS_REND_AUDIO_CONFIG_OBJECT;
#endif
    }
    if ( strncmp( charBuf, "MASA", 4 ) == 0 )
    {
@@ -1466,6 +1510,7 @@ static bool parseLfePositionConfig(
}
#endif

#ifndef FIX_293_EXT_RENDERER_CLI
static const CmdLnParser_Option *findOptionById(
    const int32_t id )
{
@@ -1479,6 +1524,7 @@ static const CmdLnParser_Option *findOptionById(

    return NULL;
}
#endif

static bool checkRequiredArgs(
    CmdlnArgs args )
@@ -1808,6 +1854,24 @@ void IsmPositionProvider_getNextFrame(

    for ( objIdx = 0; objIdx < positionProvider->numObjects; ++objIdx )
    {
#ifdef FIX_293_EXT_RENDERER_CLI
        /* If ISM metadata reader is open, read from metadata file */
        if ( positionProvider->ismReaders[objIdx] != NULL )
        {
            getMetadataFromFileReader( positionProvider->ismReaders[objIdx], objectMetadataBuffer, objIdx );
        }
        /* Otherwise, if positions were provided in a scene description file, use them */
        else if ( positionProvider->positions[objIdx] != NULL )
        {
            readFromShorthandMetadata( positionProvider, objectMetadataBuffer, objIdx );
        }
        /* Otherwise fall back to default position */
        else
        {
            objectMetadataBuffer->positions[objIdx].azimuth = 0.0f;
            objectMetadataBuffer->positions[objIdx].elevation = 0.0f;
        }
#else
        if ( positionProvider->ismReaders[objIdx] != NULL )
        {
            getMetadataFromFileReader( positionProvider->ismReaders[objIdx], objectMetadataBuffer, objIdx );
@@ -1816,6 +1880,7 @@ void IsmPositionProvider_getNextFrame(
        {
            readFromShorthandMetadata( positionProvider, objectMetadataBuffer, objIdx );
        }
#endif

        /* Wrap azimuth to lie within (-180, 180] range */
        while ( objectMetadataBuffer->positions[objIdx].azimuth < 0.0f )
@@ -2203,7 +2268,11 @@ static void parseMasa(
    if ( strncmp( line, "MASA", 4 ) != 0 )
    {
        char numTcs = *line;
#ifdef FIX_293_EXT_RENDERER_CLI
        snprintf( line, 6 /* write at most 6 characters: MASAx + null termination */, "MASA%c", numTcs );
#else
        sprintf( line, "MASA%c", numTcs );
#endif
    }

    inConfig->masaBuses[idx].audioConfig = parseAudioConfig( line );
+15 −3
Original line number Diff line number Diff line
@@ -57,8 +57,20 @@ cfg=./scripts/config/ci_linux.json
dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat

if [ $BUILD -eq 1 ];then
	# Enable memory macros to find unbalanced memory allocations/deallocations
	# Does not implement full memory analysis
	make clean
	
    # Replace free -> free_, malloc -> malloc_, calloc -> calloc_
	./scripts/prepare_mem_dryrun.py

	# Enable WMOPS and disable DEBUGGING
	sed -i.bak -e "s/\/\*\s*\(#define\s*WMOPS\)\s*\*\//\1/g" lib_com/options.h
	sed -i.bak -e "s/\/\/\s*\(#define\s*WMOPS\)/\1/g"        lib_com/options.h
#	sed -i.bak -e "s/\s*\(#define\s*DEBUGGING\)/\/\*\1*\//g" lib_com/options.h

	make all -j

fi

./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt
+2 −0
Original line number Diff line number Diff line
@@ -153,6 +153,8 @@
#define ENV_STAB_FIX                                    /* Contribution 23: HQ envelope stability memory fix */
#define STABILIZE_GIPD                                  /* FhG: Contribution 22: gIPD stabilization */
#define FIX_292_VBAP_CALLOC_REMOVAL                     /* Nokia: Fixes issue 292 by removing the remnant callocs */
#define FIX_293_EXT_RENDERER_CLI                        /* FhG: Fix bugs in external renderer CLI */
#define FIX_268                                         /* Issue 268: Add low cost dry-run of memory analysis */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+3 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@
#include "debug.h"
#endif
#include "jbm_jb4_inputbuffer.h"
#ifdef FIX_268
#include "wmc_auto.h"
#endif

#define WMC_TOOL_SKIP

+4 −0
Original line number Diff line number Diff line
@@ -2722,7 +2722,11 @@ static IVAS_REND_InputId makeInputId(
    /* Put config type in second byte (from LSB), put index + 1 in first byte
     *
     * Index is incremented here so that a valid ID can never be 0. */
#ifdef FIX_293_EXT_RENDERER_CLI
    return (IVAS_REND_InputId) ( ( ( (uint32_t) getAudioConfigType( config ) ) << 8 ) | ( inputIndex + 1 ) );
#else
    return (IVAS_REND_InputId) ( ( getAudioConfigType( config ) << 8 ) | ( inputIndex + 1 ) );
#endif
}

static ivas_error getInputById(
Loading