Commit 0cfd1533 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into split_rendering_formal_improvements

parents b34d5333 459276df
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -623,6 +623,7 @@ split-rendering-pytest-on-merge-request:
    - mv IVAS_rend IVAS_rend_ref

    # back to source branch
    - git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts
    - git checkout $source_branch_commit_sha
    - make clean
    - *enable-split-rendering
+17 −1
Original line number Diff line number Diff line
@@ -149,7 +149,9 @@ typedef struct
#endif
    uint16_t acousticEnvironmentId;
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

#ifdef API_5MS
    bool framing_5ms;
#endif
} DecArguments;


@@ -972,6 +974,9 @@ static bool parseCmdlIVAS_dec(
    arg->delayCompensationEnabled = true;
    arg->voipMode = false;
    arg->complexityLevel = IVAS_DEC_COMPLEXITY_LEVEL_THREE;
#ifdef API_5MS
    arg->framing_5ms = false;
#endif

    arg->enableHeadRotation = false;
    arg->headrotTrajFileName = NULL;
@@ -1218,6 +1223,14 @@ static bool parseCmdlIVAS_dec(
            arg->inputFormat = IVAS_DEC_INPUT_FORMAT_MIME;
            i++;
        }
#ifdef API_5MS
        else if ( strcmp( argv_to_upper, "-FR5" ) == 0 )
        {
            arg->framing_5ms = true;
            fprintf( stderr, "Warning: this is a placeholder for 5ms framing.\n" );
            i++;
        }
#endif
        else if ( strcmp( argv_to_upper, "-T" ) == 0 )
        {
            arg->enableHeadRotation = true;
@@ -1551,6 +1564,9 @@ static void usage_dec( void )
#ifdef DEBUG_JBM_CMD_OPTION
    fprintf( stdout, "-VOIP_framesize     : VoIP mode: acoustic frontend fetch frame size (must be multiples of 5!)\n" );
#endif
#endif
#ifdef API_5MS
    fprintf( stdout, "-fr5                : option to perform rendering + head-tracking with 5ms frame size\n" );
#endif
    fprintf( stdout, "-fec_cfg_file       : Optimal channel aware configuration computed by the JBM   \n" );
    fprintf( stdout, "                      as described in Section 6.3.1 of TS26.448. The output is \n" );
+59 −6
Original line number Diff line number Diff line
@@ -185,6 +185,9 @@ typedef struct
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
    float syncMdDelay;
#ifdef API_5MS
    bool framing_5ms;
#endif
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
    uint16_t acousticEnvironmentId;
} CmdlnArgs;
@@ -215,6 +218,9 @@ typedef enum
#endif
    CmdLnOptionId_referenceVectorFile,
    CmdLnOptionId_exteriorOrientationFile,
#ifdef API_5MS
    CmdLnOptionId_framing5ms,
#endif
    CmdLnOptionId_syncMdDelay,
    CmdLnOptionId_directivityPatternId,
    CmdLnOptionId_acousticEnvironmentId
@@ -357,6 +363,14 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "exof",
        .description = "External orientation trajectory file for simulation of external orientations",
    },
#ifdef API_5MS
    {
        .id = CmdLnOptionId_framing5ms,
        .match = "framing_5ms",
        .matchShort = "fr5",
        .description = "Render audio with 5 ms framing.",
    },
#endif
    {
        .id = CmdLnOptionId_syncMdDelay,
        .match = "sync_md_delay",
@@ -757,6 +771,9 @@ int main(
    int16_t delayNumSamples = -1;
    int16_t delayNumSamples_orig = 0;
    int16_t zeroPad = 0;
#ifdef FIX_LARGE_RENDERER_DELAY_COMP
    int16_t zeroPadToWrite = 0;
#endif
    int32_t delayTimeScale = 0;
    int16_t i, numChannels;
    ivas_error error = IVAS_ERR_OK;
@@ -1780,7 +1797,11 @@ int main(
        if ( audioWriter != NULL )
        {
#endif
#ifdef FIX_LARGE_RENDERER_DELAY_COMP
            if ( delayNumSamples * num_out_channels < outBufferSize )
#else
        if ( delayNumSamples < outBufferSize )
#endif
            {
                if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
                {
@@ -1791,7 +1812,11 @@ int main(
            }
            else
            {
#ifdef FIX_LARGE_RENDERER_DELAY_COMP
                delayNumSamples -= (int16_t) ( outBufferSize / num_out_channels );
#else
            delayNumSamples -= (int16_t) outBufferSize;
#endif
            }
#ifdef SPLIT_REND_WITH_HEAD_ROT
        }
@@ -1891,12 +1916,32 @@ int main(
    if ( audioWriter != NULL )
    {
#endif
#ifdef FIX_LARGE_RENDERER_DELAY_COMP
        for ( zeroPadToWrite = zeroPad; zeroPadToWrite > frameSize_smpls; zeroPadToWrite -= frameSize_smpls )
        {
            memset( outInt16Buffer, 0, outBufferSize * sizeof( int16_t ) );
            if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, outBufferSize ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nOutput audio file writer error\n" );
                exit( -1 );
            }
        }

        memset( outInt16Buffer, 0, zeroPadToWrite * outBuffer.config.numChannels * sizeof( int16_t ) );
        if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nOutput audio file writer error\n" );
            exit( -1 );
        }
        zeroPadToWrite = 0;
#else
    memset( outInt16Buffer, 0, zeroPad * outBuffer.config.numChannels * sizeof( int16_t ) );
    if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPad * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nOutput audio file writer error\n" );
        exit( -1 );
    }
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
    }
#endif
@@ -2494,7 +2539,9 @@ static CmdlnArgs defaultArgs(

    args.lfeCustomRoutingEnabled = false;
    clearString( args.inLfePanningMatrixFile );

#ifdef API_5MS
    args.framing_5ms = false;
#endif
    args.syncMdDelay = 0;

    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
@@ -2642,7 +2689,13 @@ static void parseOption(
                exit( -1 );
            }
            break;

#ifdef API_5MS
        case CmdLnOptionId_framing5ms:
            assert( numOptionValues == 0 );
            args->framing_5ms = true;
            fprintf( stderr, "Warning: this is a placeholder for 5ms framing.\n" );
            break;
#endif
        case CmdLnOptionId_directivityPatternId:
            assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS );
            for ( int16_t i = 0; i < numOptionValues; ++i )
+0 −176
Original line number Diff line number Diff line
@@ -576,182 +576,6 @@ int16_t get_ivas_max_num_indices(
    return 2450;
}

/*-----------------------------------------------------------------------*
 * get_core_max_num_indices()
 *
 * Get the maximum allowed number of indices in the core coder
 *-----------------------------------------------------------------------*/

/*! r: maximum number of indices */
int16_t get_core_max_num_indices(
    const int16_t core,       /* i  : core                      */
    const int32_t total_brate /* i  : total bitrate             */
)
{

    /* set the maximum number of indices in the core coder */
    if ( core == ACELP_CORE || core == AMR_WB_CORE )
    {
        if ( total_brate <= 9600 )
        {
            return 60;
        }
        else if ( total_brate <= IVAS_13k2 )
        {
            return 70;
        }
        else if ( total_brate <= IVAS_16k4 )
        {
            return 80;
        }
        else if ( total_brate <= IVAS_24k4 )
        {
            return 100;
        }
        else if ( total_brate <= IVAS_32k )
        {
            return 180;
        }
        else if ( total_brate <= IVAS_48k )
        {
            return 340;
        }
        else if ( total_brate <= IVAS_80k )
        {
            return 450;
        }
        else if ( total_brate <= IVAS_96k )
        {
            return 500;
        }
        else if ( total_brate <= IVAS_128k )
        {
            return 550;
        }
        else if ( total_brate <= IVAS_160k )
        {
            return 600;
        }
        else if ( total_brate <= IVAS_192k )
        {
            return 650;
        }
        else if ( total_brate <= IVAS_256k )
        {
            return 700;
        }
        else
        {
            return 800;
        }
    }
    else if ( core == TCX_20_CORE || core == TCX_10_CORE )
    {
        if ( total_brate <= 9600 )
        {
            return 100;
        }
        else if ( total_brate <= IVAS_13k2 )
        {
            return 150;
        }
        else if ( total_brate <= IVAS_16k4 )
        {
            return 200;
        }
        else if ( total_brate <= IVAS_24k4 )
        {
            return 310;
        }
        else if ( total_brate <= IVAS_32k )
        {
            return 330;
        }
        else if ( total_brate <= IVAS_48k )
        {
            return 340;
        }
        else if ( total_brate <= IVAS_80k )
        {
            return 380;
        }
        else if ( total_brate <= IVAS_96k )
        {
            return 400;
        }
        else if ( total_brate <= IVAS_128k )
        {
            return 460;
        }
        else if ( total_brate <= IVAS_160k )
        {
            return 470;
        }
        else if ( total_brate <= IVAS_192k )
        {
            return 570;
        }
        else if ( total_brate <= IVAS_256k )
        {
            return 680;
        }
        else
        {
            return 800;
        }
    }
    else if ( core == HQ_CORE )
    {
        if ( total_brate <= 9600 )
        {
            return 100;
        }
        else if ( total_brate <= IVAS_16k4 )
        {
            return 200;
        }
        else if ( total_brate <= IVAS_24k4 )
        {
            return 240;
        }
        else if ( total_brate <= IVAS_32k )
        {
            return 300;
        }
        else if ( total_brate <= IVAS_48k )
        {
            return 380;
        }
        else if ( total_brate <= IVAS_96k )
        {
            return 400;
        }
        else if ( total_brate <= IVAS_128k )
        {
            return 450;
        }
        else if ( total_brate <= IVAS_160k )
        {
            return 550;
        }
        else if ( total_brate <= IVAS_192k )
        {
            return 600;
        }
        else if ( total_brate <= IVAS_256k )
        {
            return 700;
        }
        else
        {
            return 800;
        }
    }
    else
    {
        return 50;
    }
}

/*-----------------------------------------------------------------------*
 * get_BWE_max_num_indices()
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ void ivas_dirac_config_bands(
}

/*-------------------------------------------------------------------*
 * ivas_sba_get_max_md_bits()
 * ivas_get_dirac_sba_max_md_bits()
 *
 * Return maximum SBA DirAC metadata bit-budget and nominal bit-budget
 *-------------------------------------------------------------------*/
Loading