Commit 17b947f5 authored by bayers's avatar bayers
Browse files

integrate subdefine REMOVE_5MS_FLAG into NONBE_UNIFIED_DECODING_PATHS

parent 37313e7f
Loading
Loading
Loading
Loading
+16 −39
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ typedef struct
#endif
    IVAS_DEC_COMPLEXITY_LEVEL complexityLevel;
    bool tsmEnabled;
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
    bool enable5ms;
#else
    IVAS_RENDER_FRAMESIZE renderFramesize;
@@ -445,7 +445,7 @@ int main(
     *------------------------------------------------------------------------------------------*/

    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled,
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
                                       arg.enable5ms,
#else
                                       arg.renderFramesize,
@@ -466,7 +466,7 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        IVAS_RENDER_FRAMESIZE asked_frame_size = arg.renderFramesize;
#endif
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
@@ -474,7 +474,7 @@ int main(
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -640,7 +640,7 @@ int main(

#ifdef SPLIT_REND_WITH_HEAD_ROT
        if (
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
            arg.renderFramesize == IVAS_RENDER_FRAMESIZE_5MS &&
#else
            arg.enable5ms &&
@@ -649,7 +649,7 @@ int main(
              renderConfig.split_rend_config.dof == 0 ) )
        {
/*TODO : needs to be refined as this wont work with LCLD codec*/
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
            arg.renderFramesize = IVAS_RENDER_FRAMESIZE_5MS;
#else
            arg.enable5ms = true;
@@ -657,13 +657,13 @@ int main(
        }
        else
        {
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
            arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
#else
            arg.enable5ms = true;
#endif
        }
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_Set5msFlag( hIvasDec, arg.enable5ms ) ) != IVAS_ERR_OK )
@@ -1075,7 +1075,7 @@ static bool parseCmdlIVAS_dec(
    arg->Opt_non_diegetic_pan = 0;
    arg->non_diegetic_pan_gain = 0.f;
    arg->tsmEnabled = false;
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
    arg->enable5ms = false;
#else
    arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
@@ -1272,7 +1272,7 @@ static bool parseCmdlIVAS_dec(
            arg->headrotTrajFileName = argv[i];
            i++;
        }
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
        else if ( strcmp( argv_to_upper, "-FR5" ) == 0 )
        {
            arg->enable5ms = true;
@@ -1619,7 +1619,7 @@ static bool parseCmdlIVAS_dec(
        return false;
    }

#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
    if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) && ( !arg->tsmEnabled ) )
    {
        arg->enable5ms = false;
@@ -1675,7 +1675,7 @@ static void usage_dec( void )
    fprintf( stdout, "                      50 <= fac <= 150; fac<100 faster, fac>100 slower\n" );
#endif
#endif
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
    fprintf( stdout, "-fr5                : option to perform rendering + head-tracking with 5ms frame size\n" );
#else
    fprintf( stdout, "-fr L               : render frame size in ms L=(5,10,20), default is 20)\n" );
@@ -2006,7 +2006,7 @@ static ivas_error initOnFirstGoodFrame(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( *splitRendWriter != NULL )
    {
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
        int16_t enable5ms;
#endif

@@ -2014,7 +2014,7 @@ static ivas_error initOnFirstGoodFrame(
        {
            return IVAS_ERR_UNEXPECTED_NULL_POINTER;
        }
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        /* real setting of the 5ms mode for split rendering is only known after the decoded first good frame, reset the variables needed in the main decoding loop accordingly here*/
        if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, numOutSamples ) ) != IVAS_ERR_OK )
        {
@@ -2165,7 +2165,7 @@ static ivas_error decodeG192(
    nSamplesAvailableNext = 0;

    vec_pos_update = 0;
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nOutSamples ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
@@ -2232,7 +2232,7 @@ static ivas_error decodeG192(
                goto cleanup;
            }
        }
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
        int16_t enable5ms, num_subframes;
        if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK )
        {
@@ -2959,7 +2959,6 @@ static ivas_error decodeVoIP(

#ifdef NONBE_UNIFIED_DECODING_PATHS
    vec_pos_update = 0;
#ifdef REMOVE_5MS_FLAG
    if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
@@ -2975,18 +2974,6 @@ static ivas_error decodeVoIP(
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }
#else
    if ( arg.enableHeadRotation && arg.enable5ms )
    {
        nOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS );
        vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
    }
    else
    {
        nOutSamples = (int16_t) ( arg.output_Fs / 1000 * DEFAULT_FETCH_FRAMESIZE_MS );
        vec_pos_len = 1;
    }
#endif
#endif

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
@@ -3131,22 +3118,12 @@ static ivas_error decodeVoIP(
                goto cleanup;
            }
        }
#ifndef REMOVE_5MS_FLAG
        int16_t enable5ms, num_subframes;
        if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK )
        {
            return error;
        }
        arg.enable5ms = enable5ms;
        num_subframes = ( arg.enable5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
#else
        int16_t num_subframes;
        if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_GetNumOrientationSubframes failed: \n" );
            goto cleanup;
        }
#endif

        /* Head-tracking input simulation */
        /* Head-tracking input simulation */
+11 −11
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ typedef struct
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
    float syncMdDelay;
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    IVAS_RENDER_FRAMESIZE render_framesize;
#else
    bool framing_5ms;
@@ -223,7 +223,7 @@ typedef enum
#endif
    CmdLnOptionId_referenceVectorFile,
    CmdLnOptionId_exteriorOrientationFile,
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    CmdLnOptionId_framing,
#endif
    CmdLnOptionId_framing5ms,
@@ -375,7 +375,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "exof",
        .description = "External orientation trajectory file for simulation of external orientations",
    },
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    {
        .id = CmdLnOptionId_framing,
        .match = "framing",
@@ -1012,13 +1012,13 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    }
#endif
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );
#else
    const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 );
#endif

#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK )
@@ -1517,7 +1517,7 @@ int main(
    {
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0;
#else
        const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0;
@@ -1573,7 +1573,7 @@ int main(
#endif

        int16_t num_subframes, sf_idx;
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        num_subframes = (int16_t) args.render_framesize;
#else
        num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
@@ -2366,7 +2366,7 @@ static bool parseDiegeticPan(
}


#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
static bool parseRenderFramesize( char *value,
                                  IVAS_RENDER_FRAMESIZE *render_framesize )
{
@@ -2693,7 +2693,7 @@ static CmdlnArgs defaultArgs(

    args.lfeCustomRoutingEnabled = false;
    clearString( args.inLfePanningMatrixFile );
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
#else
    args.framing_5ms = false;
@@ -2859,7 +2859,7 @@ static void parseOption(
                exit( -1 );
            }
            break;
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
        case CmdLnOptionId_framing:
            assert( numOptionValues == 1 );
            if ( !parseRenderFramesize( optionValues[0], &args->render_framesize ) )
@@ -2872,7 +2872,7 @@ static void parseOption(
#endif
        case CmdLnOptionId_framing5ms:
            assert( numOptionValues == 0 );
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
            args->render_framesize = IVAS_RENDER_FRAMESIZE_5MS;
#else
            args->framing_5ms = true;
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ typedef enum

} IVAS_HEAD_ORIENT_TRK_T;

#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
typedef enum
{
    IVAS_RENDER_FRAMESIZE_UNKNOWN = 0,
+1 −1
Original line number Diff line number Diff line
@@ -953,7 +953,7 @@ ivas_error ivas_dirac_dec_config(
    if ( dec_config_flag == DIRAC_OPEN )
    {
        if (
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
            st_ivas->hDecoderConfig->Opt_5ms &&
#endif
            st_ivas->hTcBuffer == NULL )
+8 −8
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ static ivas_error ivas_dec_init_split_rend(
    }
#endif

#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
    error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS );
#else
    error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->Opt_5ms );
@@ -1050,7 +1050,7 @@ ivas_error ivas_init_decoder_front(
    if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation )
    {
        if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ),
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
                                                       st_ivas->hDecoderConfig->render_framesize
#else
                                                       ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES
@@ -1071,7 +1071,7 @@ ivas_error ivas_init_decoder_front(
#ifdef NONBE_UNIFIED_DECODING_PATHS
                                                       st_ivas->hDecoderConfig->output_Fs,
#endif
#ifdef REMOVE_5MS_FLAG
#ifdef NONBE_UNIFIED_DECODING_PATHS
                                                       st_ivas->hDecoderConfig->render_framesize
#else
                                                       ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES
@@ -2013,7 +2013,7 @@ ivas_error ivas_init_decoder(
        }

#ifndef UNIFY_CHANNEL_MEM_HEAP
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
        if ( st_ivas->hDecoderConfig->Opt_5ms )
#endif
        {
@@ -2065,7 +2065,7 @@ ivas_error ivas_init_decoder(
        st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns;

#ifndef UNIFY_CHANNEL_MEM_HEAP
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
        if ( st_ivas->hDecoderConfig->Opt_5ms )
#endif
        {
@@ -2236,7 +2236,7 @@ ivas_error ivas_init_decoder(
     * Allocate and initialize JBM struct + buffer
     *-----------------------------------------------------------------*/
    if (
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
        st_ivas->hDecoderConfig->Opt_5ms &&
#endif
        st_ivas->hTcBuffer == NULL )
@@ -2274,7 +2274,7 @@ ivas_error ivas_init_decoder(
    /*-----------------------------------------------------------------*
     * Allocate floating-point output audio buffers
     *-----------------------------------------------------------------*/
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
    if ( !st_ivas->hDecoderConfig->Opt_5ms )
#endif
    {
@@ -2291,7 +2291,7 @@ ivas_error ivas_init_decoder(
            }
        }
    }
#ifndef REMOVE_5MS_FLAG
#ifndef NONBE_UNIFIED_DECODING_PATHS
    else
    {
        n = 0;
Loading