Commit 351b9d53 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Merge branch 'main' into 196-refactor-renderer-output-configuration

parents 943bf5b9 e4f2974f
Loading
Loading
Loading
Loading
Loading
+275 −2
Original line number Diff line number Diff line
@@ -88,6 +88,15 @@ typedef struct
    uint16_t durationCounters[RENDERER_MAX_ISM_INPUTS];                /* Number of frames spent at current position */
} IsmPositionProvider;

#ifdef FIX_296_CFG_LFE_SCENE_DESC
typedef struct
{
    float lfe_azi;
    float lfe_ele;
    float lfe_gain_dB;
    char lfe_routing_mtx[FILENAME_MAX];
} LfeRoutingConfig;
#endif
typedef struct
{
    IVAS_REND_AudioConfig audioConfig;
@@ -329,7 +338,11 @@ static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_

static IVAS_REND_AudioConfig ambisonicsOrderToEnum( const int16_t order );

#ifdef FIX_296_CFG_LFE_SCENE_DESC
static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs );
#else
static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders );
#endif

static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom );

@@ -341,6 +354,11 @@ static void IsmPositionProvider_getNextFrame( IsmPositionProvider *positionProvi

static void IsmPositionProvider_close( IsmPositionProvider *positionProvider );

#ifdef FIX_296_CFG_LFE_SCENE_DESC
static LfeRoutingConfig *LfeRoutingConfig_open( void );
static void LfeRoutingConfig_close( LfeRoutingConfig *lfeRoutingCfg );
#endif

static void readFromShorthandMetadata( IsmPositionProvider *positionProvider, ObjectPositionBuffer *objectMetadataBuffer, const uint32_t objIdx );

void getMetadataFromFileReader( IsmFileReader *ismReader, ObjectPositionBuffer *objectMetadataBuffer, const uint32_t objIdx );
@@ -359,7 +377,11 @@ static int8_t parseInt32( const char *line, int32_t *ret );

static void parseObjectPosition( char *line, IVAS_REND_AudioObjectPosition *position, uint16_t *positionDuration );

#ifdef FIX_296_CFG_LFE_SCENE_DESC
static void parseMetadata( char *metadataString, char *inDir, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs );
#else
static void parseMetadata( char *metadataString, char *inDir, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders );
#endif

static ivas_error parseLfePanMtxFile( const char *lfeRoutingMatrixFilePath, IVAS_REND_LfePanMtx *lfePanMtx );

@@ -548,6 +570,9 @@ int main(
    HeadRotFileReader *referenceRotReader = NULL;
    hrtfFileReader *hrtfFileReader = NULL;
    IsmPositionProvider *positionProvider;
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS];
#endif
    RenderConfigReader *renderConfigReader = NULL;
    MasaFileReader *masaReaders[RENDERER_MAX_MASA_INPUTS];
    IVAS_MASA_METADATA_HANDLE hMasaMetadata[RENDERER_MAX_MASA_INPUTS];
@@ -582,6 +607,13 @@ int main(
        hMasaMetadata[i] = NULL;
    }

#ifdef FIX_296_CFG_LFE_SCENE_DESC
    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
    {
        lfeRoutingConfigs[i] = NULL;
    }
#endif

    CmdlnArgs args = parseCmdlnArgs( argc, argv );

    if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_MONO ) ||
@@ -654,7 +686,16 @@ int main(
    if ( args.sceneDescriptionInput )
    {
        /* With scene description input, inputFilePath is the path to the scene description file. Parse it. */
#ifdef FIX_296_CFG_LFE_SCENE_DESC
        parseSceneDescriptionFile( args.inputFilePath,
                                   audioFilePath,
                                   &args.inConfig,
                                   positionProvider,
                                   masaReaders,
                                   lfeRoutingConfigs );
#else
        parseSceneDescriptionFile( args.inputFilePath, audioFilePath, &args.inConfig, positionProvider, masaReaders );
#endif
    }
    else
    {
@@ -794,7 +835,6 @@ int main(
    /* parse input LFE panning matrix */
    if ( args.lfeCustomRoutingEnabled && !isEmptyString( args.inLfePanningMatrixFile ) )
    {
        /* TODO tmu: how should we handle this on CLI for multiple MC inputs? */
        if ( ( error = parseLfePanMtxFile( args.inLfePanningMatrixFile, &lfePanMatrix ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
@@ -816,7 +856,6 @@ int main(
            exit( -1 );
        }

        /* TODO(sgi): Command line only supports one custom LS input for now, extend */
        if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
        {
            if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK )
@@ -830,7 +869,11 @@ int main(
        {
            if ( args.lfePanningEnabled )
            {
#ifdef FIX_296_CFG_LFE_SCENE_DESC
                fprintf( stderr, "Warning: LFE position specified as well as panning matrix! Ignoring position and using gains from panning matrix\n" );
#else
                fprintf( stdout, "Warning LFE position specified as well as panning matrix! Ignoring position and using gains from panning matrix\n" );
#endif
                args.lfePanningEnabled = false;
            }

@@ -849,6 +892,39 @@ int main(
                exit( -1 );
            }
        }
#ifdef FIX_296_CFG_LFE_SCENE_DESC
        else
        {
            /* check for configuration from scene description file */
            if ( lfeRoutingConfigs[i] != NULL )
            {
                /* prioritise panning matrix if configured */
                if ( !isEmptyString( lfeRoutingConfigs[i]->lfe_routing_mtx ) )
                {
                    if ( ( error = parseLfePanMtxFile( lfeRoutingConfigs[i]->lfe_routing_mtx, &lfePanMatrix ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }

                    if ( ( error = IVAS_REND_SetInputLfeMtx( hIvasRend, mcIds[i], (const IVAS_REND_LfePanMtx *) &lfePanMatrix ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }
                }
                /* set position based gains */
                else
                {
                    if ( ( error = IVAS_REND_SetInputLfePos( hIvasRend, mcIds[i], lfeRoutingConfigs[i]->lfe_gain_dB, lfeRoutingConfigs[i]->lfe_azi, lfeRoutingConfigs[i]->lfe_ele ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }
                }
            }
        }
#endif
    }

    for ( i = 0; i < args.inConfig.numAudioObjects; ++i )
@@ -1209,6 +1285,12 @@ int main(
    {
        MasaFileReader_close( &masaReaders[i] );
    }
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
    {
        LfeRoutingConfig_close( lfeRoutingConfigs[i] );
    }
#endif
    AudioFileReader_close( &audioReader );
    AudioFileWriter_close( &audioWriter );
    HeadRotationFileReader_close( &headRotReader );
@@ -1739,8 +1821,13 @@ static CmdlnArgs defaultArgs(

    args.lfePanningEnabled = false;
    args.lfeConfigGain = 1.0f;
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    args.lfeConfigAzimuth = 0.f;
    args.lfeConfigElevation = 0.f;
#else
    args.lfeConfigAzimuth = 0;
    args.lfeConfigElevation = 0;
#endif

    args.lfeCustomRoutingEnabled = false;
    clearString( args.inLfePanningMatrixFile );
@@ -1923,6 +2010,34 @@ IsmPositionProvider *IsmPositionProvider_open(
    return ipp;
}

#ifdef FIX_296_CFG_LFE_SCENE_DESC
LfeRoutingConfig *LfeRoutingConfig_open(
    void )
{
    LfeRoutingConfig *lrc;

    lrc = (LfeRoutingConfig *) malloc( sizeof( LfeRoutingConfig ) );
    lrc->lfe_azi = 0.f;
    lrc->lfe_ele = 0.f;
    lrc->lfe_gain_dB = 0.f;
    lrc->lfe_routing_mtx[0] = '\0';

    return lrc;
}

void LfeRoutingConfig_close(
    LfeRoutingConfig *lfeRoutingCfg )
{
    if ( lfeRoutingCfg != NULL )
    {

        free( lfeRoutingCfg );
    }

    return;
}
#endif

void getMetadataFromFileReader(
    IsmFileReader *ismReader,
    ObjectPositionBuffer *objectMetadataBuffer,
@@ -2212,6 +2327,12 @@ static int8_t parseInt32(

static void parseOptionalInputValues(
    char *line,
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    float *lfe_gain_dB,
    float *lfe_pos_azi,
    float *lfe_pos_ele,
    char *lfe_pan_mtx_filename,
#endif
    float *gain_dB )
{
    char *parse_pos;
@@ -2223,6 +2344,24 @@ static void parseOptionalInputValues(

    /* Set default values, in case some values are not specified */
    *gain_dB = 0.f;
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    if ( lfe_gain_dB != NULL )
    {
        *lfe_gain_dB = 0.f;
    }
    if ( lfe_pos_azi != NULL )
    {
        *lfe_pos_azi = 0.f;
    }
    if ( lfe_pos_ele != NULL )
    {
        *lfe_pos_ele = 0.f;
    }
    if ( lfe_pan_mtx_filename != NULL )
    {
        *lfe_pan_mtx_filename = '\0';
    }
#endif

    /* Save parsing position - will have to be passed to strtok to resume parsing after using strtok with non-NULL value below */
    parse_pos = readNextMetadataChunk( line, "\n" );
@@ -2239,10 +2378,50 @@ static void parseOptionalInputValues(

            if ( *endptr != '\0' )
            {
#ifdef FIX_296_CFG_LFE_SCENE_DESC
                fprintf( stderr, "Cannot parse string \"%s\" as a float value\n", value );
#else
                fprintf( stderr, "Cannot parse string string \"%s\" as a float value\n", value );
#endif
                exit( -1 );
            }
        }
#ifdef FIX_296_CFG_LFE_SCENE_DESC
        else if ( ( strcmp( key, "lfe_gain_dB" ) == 0 ) && lfe_gain_dB != NULL )
        {
            *lfe_gain_dB = (float) strtod( value, &endptr );

            if ( *endptr != '\0' )
            {
                fprintf( stderr, "Cannot parse string \"%s\" as a float value\n", value );
                exit( -1 );
            }
        }
        else if ( ( strcmp( key, "lfe_azi" ) == 0 ) && lfe_pos_azi != NULL )
        {
            *lfe_pos_azi = (float) strtod( value, &endptr );

            if ( *endptr != '\0' )
            {
                fprintf( stderr, "Cannot parse string \"%s\" as a float value\n", value );
                exit( -1 );
            }
        }
        else if ( ( strcmp( key, "lfe_ele" ) == 0 ) && lfe_pos_ele != NULL )
        {
            *lfe_pos_ele = (float) strtod( value, &endptr );

            if ( *endptr != '\0' )
            {
                fprintf( stderr, "Cannot parse string \"%s\" as a float value\n", value );
                exit( -1 );
            }
        }
        else if ( strcmp( key, "lfe_matrix" ) == 0 )
        {
            strncpy( lfe_pan_mtx_filename, value, FILENAME_MAX - 1 );
        }
#endif
        else
        {
            fprintf( stderr, "Unsupported optional key: %s\n", key );
@@ -2328,7 +2507,11 @@ static void parseIsm(
    }

    /* Read optional values */
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    parseOptionalInputValues( line, NULL, NULL, NULL, NULL, &inConfig->audioObjects[idx].gain_dB );
#else
    parseOptionalInputValues( line, &inConfig->audioObjects[idx].gain_dB );
#endif

    return;
}
@@ -2349,7 +2532,11 @@ static void parseSba(
    inConfig->ambisonicsBuses[idx].audioConfig = ambisonicsOrderToEnum( ambiOrder );

    /* Read optional values */
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    parseOptionalInputValues( line, NULL, NULL, NULL, NULL, &inConfig->ambisonicsBuses[idx].gain_dB );
#else
    parseOptionalInputValues( line, &inConfig->ambisonicsBuses[idx].gain_dB );
#endif

    return;
}
@@ -2357,6 +2544,9 @@ static void parseSba(
static void parseMc(
    char *line,
    InputConfig *inConfig,
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    LfeRoutingConfig **lfeRoutingConfigs,
#endif
    const int32_t idx )
{
    readNextMetadataChunk( line, "\n" );
@@ -2365,17 +2555,70 @@ static void parseMc(

    readNextMetadataChunk( line, "\n" );
    IVAS_REND_AudioConfig cfg = parseAudioConfig( line );
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    /* Try to use the given string as a path to a custom loudspeaker layout file. */
    if ( cfg == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
    {
        ivas_error error = parseCustomLayoutFile( line, &inConfig->inSetupCustom );

        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error while parsing input format %s\n", line );
            exit( -1 );
        }
        inConfig->numMultiChannelBuses = 1;
        inConfig->multiChannelBuses[idx].audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM;
        inConfig->multiChannelBuses[idx].inputChannelIndex = 0;
        inConfig->multiChannelBuses[idx].gain_dB = 0.0f;
    }
#else
    if ( cfg == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
    {
        parseCustomLayoutFile( line, &inConfig->inSetupCustom );
    }
#endif
    else
    {
        inConfig->multiChannelBuses[idx].audioConfig = cfg;
    }

    /* Read optional values */
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    bool lfe_panningEnabled;
    float lfe_gain_dB, lfe_azi, lfe_ele;
    char lfe_routing_mtx[FILENAME_MAX];

    parseOptionalInputValues( line, &lfe_gain_dB, &lfe_azi, &lfe_ele, lfe_routing_mtx, &inConfig->multiChannelBuses[idx].gain_dB );

    lfe_panningEnabled = ( lfe_gain_dB != 0.f || lfe_azi != 0.f || lfe_ele != 0.f ) ? true : false;

    if ( lfe_panningEnabled && !isEmptyString( lfe_routing_mtx ) )
    {
        fprintf( stderr, "Warning: LFE position specified as well as panning matrix! Ignoring position and using gains from panning matrix\n" );
        lfe_panningEnabled = false;
    }

    if ( lfe_panningEnabled || !isEmptyString( lfe_routing_mtx ) )
    {
        /* a configuration was specified, set the values */
        lfeRoutingConfigs[idx] = LfeRoutingConfig_open();

        if ( lfe_panningEnabled )
        {
            lfeRoutingConfigs[idx]->lfe_gain_dB = lfe_gain_dB;
            lfeRoutingConfigs[idx]->lfe_azi = lfe_azi;
            lfeRoutingConfigs[idx]->lfe_ele = lfe_ele;
        }

        if ( !isEmptyString( lfe_routing_mtx ) )
        {
            strncpy( lfeRoutingConfigs[idx]->lfe_routing_mtx, lfe_routing_mtx, FILENAME_MAX );
            convert_backslash( lfeRoutingConfigs[idx]->lfe_routing_mtx );
        }
    }
#else
    parseOptionalInputValues( line, &inConfig->multiChannelBuses[idx].gain_dB );
#endif

    return;
}
@@ -2416,7 +2659,11 @@ static void parseMasa(
    }

    /* Read optional values */
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    parseOptionalInputValues( line, NULL, NULL, NULL, NULL, &inConfig->masaBuses[idx].gain_dB );
#else
    parseOptionalInputValues( line, &inConfig->masaBuses[idx].gain_dB );
#endif

    return;
}
@@ -2457,7 +2704,12 @@ static void parseMetadata(
    char *inDir,
    InputConfig *inConfig,
    IsmPositionProvider *positionProvider,
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    MasaFileReader **masaReaders,
    LfeRoutingConfig **lfeRoutingConfigs )
#else
    MasaFileReader **masaReaders )
#endif
{
    char line[RENDERER_MAX_METADATA_LINE_LENGTH];
    char *delimiter;
@@ -2509,7 +2761,11 @@ static void parseMetadata(
                fprintf( stderr, "Metadata exceeds the supported number of MC inputs\n" );
                exit( -1 );
            }
#ifdef FIX_296_CFG_LFE_SCENE_DESC
            parseMc( line, inConfig, lfeRoutingConfigs, counterChannelAudioObjects - 1 );
#else
            parseMc( line, inConfig, counterChannelAudioObjects - 1 );
#endif
        }
        else if ( strcmp( line, "SBA" ) == 0 )
        {
@@ -2577,7 +2833,12 @@ static void parseSceneDescriptionFile(
    char *audioFilePath,
    InputConfig *inConfig,
    IsmPositionProvider *positionProvider,
#ifdef FIX_296_CFG_LFE_SCENE_DESC
    MasaFileReader **masaReaders,
    LfeRoutingConfig **lfeRoutingConfigs )
#else
    MasaFileReader **masaReaders )
#endif
{
    uint32_t inAudioFilePathLen;
    char inAudioFilePath[FILENAME_MAX];
@@ -2606,7 +2867,11 @@ static void parseSceneDescriptionFile(
    strcpy( audioFilePath, inDir );
    strncat( audioFilePath, inAudioFilePath, inAudioFilePathLen );

#ifdef FIX_296_CFG_LFE_SCENE_DESC
    parseMetadata( mtdStr, inDir, inConfig, positionProvider, masaReaders, lfeRoutingConfigs );
#else
    parseMetadata( mtdStr, inDir, inConfig, positionProvider, masaReaders );
#endif

    return;
}
@@ -2675,8 +2940,16 @@ static ivas_error parseLfePanMtxFile(
        set_zero( ( *lfePanMtx )[lfe_in], IVAS_MAX_OUTPUT_CHANNELS );
    }

#ifdef FIX_296_CFG_LFE_SCENE_DESC
    for ( lfe_in = 0; lfe_in < IVAS_MAX_INPUT_LFE_CHANNELS; lfe_in++ )
#else
    for ( lfe_in = 0, ch_out = 0; lfe_in < IVAS_MAX_INPUT_LFE_CHANNELS; lfe_in++ )
#endif
    {
#ifdef FIX_296_CFG_LFE_SCENE_DESC
        ch_out = 0;

#endif
        /* if EOF or a blank line is encountered, simply return */
        if ( ( fgets( line, 200, mtxFile ) == NULL ) && ( strcmp( line, "\n" ) == 0 ) && ( strcmp( line, "\r\n" ) == 0 ) )
        {
+9 −8
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ fi
cfg=./scripts/config/ci_linux.json
dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat
ism_md_cmd="--metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv"
duration_arg="-U 1:2"

if [ $BUILD -eq 1 ];then
	# Enable memory macros to find unbalanced memory allocations/deallocations
@@ -79,20 +80,20 @@ fi
ism_modes=$(./scripts/runIvasCodec.py -l | grep ISM)
non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ISM)
echo "\n======================= 1. non-ism modes no FEC =======================\n\n"
./scripts/runIvasCodec.py -m $non_ism_modes -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt
./scripts/runIvasCodec.py -m $non_ism_modes -p $cfg $duration_arg $WORKERS | tee smoke_test_output.txt
echo "\n======================= 2. ism modes no FEC =======================\n\n"
./scripts/runIvasCodec.py -m $ism_modes -p $cfg -U 1 $WORKERS $ism_md_cmd | tee smoke_test_output.txt
./scripts/runIvasCodec.py -m $ism_modes -p $cfg $duration_arg $WORKERS $ism_md_cmd | tee smoke_test_output.txt
# run the decoding again, but with 15% frame loss
echo "\n======================= 3. all modes with FEC =======================\n\n"
./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS -D="-fec 15" --decoder_only | tee smoke_test_output_plc.txt
./scripts/runIvasCodec.py -p $cfg $duration_arg $WORKERS -D="-fec 15" --decoder_only | tee smoke_test_output_plc.txt

# run JBM modes - EXT is excluded as not supported yet
modes_with_no_ext_out=$(./scripts/runIvasCodec.py -l | grep -v MASA | grep -v ISM)
modes_with_ext_out=$(./scripts/runIvasCodec.py -l | grep 'MASA\|ISM' | grep -v ISM+)
echo "\n======================= 4. JBM, modes with no EXT =======================\n\n"
./scripts/runIvasCodec.py -m $modes_with_no_ext_out -p $cfg -U 1 $WORKERS --decoder_only --jbm_file $dly_profile | tee smoke_test_output_jbm_noEXT.txt
./scripts/runIvasCodec.py -m $modes_with_no_ext_out -p $cfg $duration_arg $WORKERS --decoder_only --jbm_file $dly_profile | tee smoke_test_output_jbm_noEXT.txt
echo "\n======================= 5. JBM, modes with EXT =======================\n\n"
./scripts/runIvasCodec.py -m $modes_with_ext_out -p $cfg -U 1 $WORKERS --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 | tee -a smoke_test_output_jbm_noEXT.txt
./scripts/runIvasCodec.py -m $modes_with_ext_out -p $cfg $duration_arg $WORKERS --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 | tee -a smoke_test_output_jbm_noEXT.txt

# run all modes with binaural output using external files
modes_with_bin_out="SBA PlanarSBA MASA MC ISM1 ISM2 ISM3 ISM4"
@@ -101,14 +102,14 @@ bin_out_modes="BINAURAL BINAURAL_ROOM_IR"
echo "\n======================= 6. binaural out with HRTF files - WB =======================\n\n"
wb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _wb_)
hrtf_wb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin"
./scripts/runIvasCodec.py -p $cfg -m $wb_modes -U 1 $WORKERS -D="-hrtf ${hrtf_wb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt
./scripts/runIvasCodec.py -p $cfg -m $wb_modes $duration_arg $WORKERS -D="-hrtf ${hrtf_wb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt

echo "\n======================= 7. binaural out with HRTF files - SWB =======================\n\n"
swb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _swb_)
hrtf_swb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin"
./scripts/runIvasCodec.py -p $cfg -m $swb_modes -U 1 $WORKERS -D="-hrtf ${hrtf_swb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt
./scripts/runIvasCodec.py -p $cfg -m $swb_modes $duration_arg $WORKERS -D="-hrtf ${hrtf_swb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt

echo "\n======================= 8. binaural out with HRTF files - FB =======================\n\n"
fb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _fb_)
hrtf_fb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin"
./scripts/runIvasCodec.py -p $cfg -m $fb_modes -U 1 $WORKERS -D="-hrtf ${hrtf_fb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt
./scripts/runIvasCodec.py -p $cfg -m $fb_modes $duration_arg $WORKERS -D="-hrtf ${hrtf_fb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt
+1 −0
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@
#define FIX_483                                         /* FhG: fix issue 483, division by zero in nois_est */
#define FIX_483b                                        /* FhG: fix issue 483, uninitialized values in ivas_mct_core_enc */
#define FIX_170_DTX_MASA                                /* Nokia: Fix issue 170, relaxing the use of DTX in MASA format */
#define FIX_296_CFG_LFE_SCENE_DESC                       /* FhG: Fix issue 296 - add configurable LFE handling to the scene description file */
#define FIX_510                                         /* FhG: fix issue 510, misleading error message for invalid input format */
#define FIX_509                                         /* FhG: fix issue 509, too low number of bitsream indices in SBA */
#define FIX_519_JBM_ACCESS_NULL_TC_BUFFER               /* FhG: fix issue 519, accessing a yet uninitialized TC Buffer in frame 0*/
+3 −5
Original line number Diff line number Diff line
@@ -1148,9 +1148,9 @@ void ivas_ism_dec_digest_tc(

        /* we have a full frame interpolator, adapt it */
        /* for BE testing */
        if ( ( st_ivas->hDecoderConfig->output_Fs / (int32_t) FRAMES_PER_SECOND ) == st_ivas->hTcBuffer->n_samples_available )
        if ( ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) == st_ivas->hTcBuffer->n_samples_available )
        {
            int16_t interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / (int32_t) FRAMES_PER_SECOND );
            int16_t interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC );
            if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
            {
                st_ivas->hIsmRendererData->interpolator[0] = 0.0f;
@@ -1169,9 +1169,7 @@ void ivas_ism_dec_digest_tc(
        }
        else
        {
            ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / (int32_t) FRAMES_PER_SECOND ),
                                                          st_ivas->hTcBuffer->n_samples_available,
                                                          st_ivas->hIsmRendererData->interpolator );
            ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator );
        }
        /* also get the gains here */
        num_objects = st_ivas->nchan_transport;
+12 −8
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector):
        self.flat_output_structure = flat_output_structure
        self.limit_duration = False
        self.max_duration = 0.0
        self.start_time = 0.0
        self.encoder_cmdline_options = []
        self.decoder_cmdline_options = []
        self.run_encoder = True
@@ -541,7 +542,7 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector):
                            str(sample_rate_in),
                            "_",
                            config["cmd"]["in_config"].upper(),
                            "_L{}s".format("_".join(str(self.max_duration).split("."))),
                            "_L{}-{}s".format("_".join(str(self.start_time).split(".")), "_".join(str(self.max_duration).split("."))),
                            ".pcm",
                        ]
                    )
@@ -606,16 +607,19 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector):

                        # check if the given length with -U is longer than the file itself and avoid cutting then
                        if do_limit_duration:
                            cut_len_samples = int(float(self.max_duration) * fs)

                            in_len = sig.shape[0]
                            # first check if start time exceeds signal length
                            start_time_samples = int(float(self.start_time) * fs)
                            if start_time_samples >= in_len:
                                raise RuntimeError("Signal is shorter than given start time")

                            cut_len_samples = int(float(self.max_duration) * fs)

                            # no need to cut anything if given length is bigger than signal length
                            if cut_len_samples < in_len:
                                out_len = int(float(self.max_duration) * fs)
                                sig = ar.cut(sig, (0, out_len))
                            if cut_len_samples + start_time_samples < in_len or start_time_samples > 0:
                                out_len = min(cut_len_samples, in_len - start_time_samples)
                                sig = ar.cut(sig, (start_time_samples, out_len))

                                pcm_log.write("Limit signal length to {} samples".format(out_len))
                                pcm_log.write("Limit signal length to {}:{} samples".format(start_time_samples, out_len))
                                af.writefile(pcm_name_cpy_transformed, sig, fs)

                                resamp_in_path = pcm_name_cpy_transformed
Loading