Commit 71c4267e authored by emerit's avatar emerit
Browse files

Merge branch 'main' into 744_step2_tables_and_bin_update_nonBE

parents deaf3f9d 53e45cf1
Loading
Loading
Loading
Loading
+2 −141
Original line number Diff line number Diff line
@@ -129,11 +129,7 @@ typedef struct
#endif
    IVAS_DEC_COMPLEXITY_LEVEL complexityLevel;
    bool tsmEnabled;
#ifndef NONBE_UNIFIED_DECODING_PATHS
    bool enable5ms;
#else
    IVAS_RENDER_FRAMESIZE renderFramesize;
#endif
#ifdef DEBUGGING
    IVAS_DEC_FORCED_REND_MODE forcedRendMode;
#ifdef DEBUG_FOA_AGC
@@ -163,11 +159,7 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF
#else
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#endif
#ifndef NONBE_UNIFIED_DECODING_PATHS
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
#else
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec );
#endif

#ifdef DEBUGGING
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
@@ -203,9 +195,7 @@ int main(
    Vector3PairFileReader *referenceVectorReader = NULL;
    RenderConfigReader *renderConfigReader = NULL;
    int16_t *pcmBuf = NULL;
#ifdef NONBE_UNIFIED_DECODING_PATHS
    IVAS_RENDER_FRAMESIZE asked_frame_size;
#endif
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL;
@@ -442,20 +432,14 @@ int main(
     * Configure the decoder
     *------------------------------------------------------------------------------------------*/

#ifndef NONBE_UNIFIED_DECODING_PATHS
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking,
                                       arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    asked_frame_size = arg.renderFramesize;
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif

    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }
#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 ) );
@@ -466,7 +450,6 @@ int main(
    {
        fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" );
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure Split rendering
@@ -475,16 +458,13 @@ 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 NONBE_UNIFIED_DECODING_PATHS
        asked_frame_size = arg.renderFramesize;
#endif
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }

#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 ) );
@@ -495,7 +475,6 @@ int main(
        {
            fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for split rendering!\n" );
        }
#endif

        arg.enableHeadRotation = true;
    }
@@ -650,35 +629,18 @@ int main(
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef NONBE_UNIFIED_DECODING_PATHS
        if ( arg.renderFramesize == IVAS_RENDER_FRAMESIZE_5MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
                                                                   renderConfig.split_rend_config.dof == 0 ) )
#else
        if ( arg.enable5ms && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
                                renderConfig.split_rend_config.dof == 0 ) )
#endif
        {
            /*TODO : needs to be refined as this wont work with LCLD codec*/
#ifdef NONBE_UNIFIED_DECODING_PATHS
            arg.renderFramesize = IVAS_RENDER_FRAMESIZE_5MS;
#else
            arg.enable5ms = true;
#endif
        }
        else
        {
#ifdef NONBE_UNIFIED_DECODING_PATHS
            arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
#else
            arg.enable5ms = true;
#endif
        }

#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 )
#endif
        {
            return error;
        }
@@ -946,11 +908,7 @@ int main(

    if ( arg.voipMode )
    {
#ifdef NONBE_UNIFIED_DECODING_PATHS
        error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec );
#else
        error = decodeVoIP( arg, hBsReader, hIvasDec );
#endif
    }
    else
    {
@@ -1217,11 +1175,7 @@ static bool parseCmdlIVAS_dec(
    arg->Opt_non_diegetic_pan = 0;
    arg->non_diegetic_pan_gain = 0.f;
    arg->tsmEnabled = false;
#ifndef NONBE_UNIFIED_DECODING_PATHS
    arg->enable5ms = false;
#else
    arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
#endif
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
    arg->tsmScale = 100;
@@ -1365,9 +1319,6 @@ static bool parseCmdlIVAS_dec(
            i++;
            int32_t tmp = 100;
            arg->tsmEnabled = true;
#ifndef NONBE_UNIFIED_DECODING_PATHS
            arg->enable5ms = true;
#endif
            if ( i < argc - 3 )
            {
                if ( !is_digits_only( argv[i] ) )
@@ -1416,13 +1367,6 @@ static bool parseCmdlIVAS_dec(
            arg->headrotTrajFileName = argv[i];
            i++;
        }
#ifndef NONBE_UNIFIED_DECODING_PATHS
        else if ( strcmp( argv_to_upper, "-FR5" ) == 0 )
        {
            arg->enable5ms = true;
            i++;
        }
#else
        else if ( strcmp( argv_to_upper, "-FR" ) == 0 )
        {
            int32_t tmp;
@@ -1456,7 +1400,6 @@ static bool parseCmdlIVAS_dec(
                }
            }
        }
#endif
        else if ( strcmp( argv_to_upper, "-OTR" ) == 0 )
        {

@@ -1763,13 +1706,6 @@ static bool parseCmdlIVAS_dec(
        return false;
    }

#ifndef NONBE_UNIFIED_DECODING_PATHS
    if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) && ( !arg->tsmEnabled ) )
    {
        arg->enable5ms = false;
    }

#endif
    return true;
}

@@ -1819,11 +1755,7 @@ static void usage_dec( void )
    fprintf( stdout, "                      50 <= fac <= 150; fac<100 faster, fac>100 slower\n" );
#endif
#endif
#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" );
#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" );
    fprintf( stdout, "                      written into a .txt file. Each line contains the FER indicator \n" );
@@ -1904,11 +1836,7 @@ static ivas_error initOnFirstGoodFrame(
    const DecArguments arg,            /* i  : */
    const int16_t numInitialBadFrames, /* i  : */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef NONBE_UNIFIED_DECODING_PATHS
    int16_t *numOutSamples, /* i/o: */
#else
    uint16_t *numOutSamples, /* i/o: */
#endif
    int16_t *vec_pos_len,   /* i/o: */
#else
    const uint16_t numOutSamples, /* i  : */
@@ -2151,15 +2079,11 @@ static ivas_error initOnFirstGoodFrame(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( *splitRendWriter != NULL )
    {
#ifndef NONBE_UNIFIED_DECODING_PATHS
        int16_t enable5ms;
#endif
        if ( numOutSamples == NULL || vec_pos_len == NULL )
        {
            return IVAS_ERR_UNEXPECTED_NULL_POINTER;
        }

#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 )
        {
@@ -2171,24 +2095,6 @@ static ivas_error initOnFirstGoodFrame(
            fprintf( stderr, "\nError getting render frame size in samples\n" );
            return error;
        }
#else
        if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK )
        {
            return error;
        }

        /* 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 ( enable5ms )
        {
            *numOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS );
            *vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
        }
        else
        {
            *numOutSamples = (int16_t) ( arg.output_Fs / 1000 * DEFAULT_FETCH_FRAMESIZE_MS );
            *vec_pos_len = 1;
        }
#endif
    }
#endif

@@ -2230,11 +2136,7 @@ static ivas_error decodeG192(
    int16_t nOutChannels = 0;
    int16_t delayNumSamples = -1;
    int16_t delayNumSamples_orig[3];
#if defined( SPLIT_REND_WITH_HEAD_ROT ) && !defined( NONBE_UNIFIED_DECODING_PATHS )
    uint16_t nOutSamples = 0;
#else
    int16_t nOutSamples = 0;
#endif
    int32_t delayTimeScale = 0;
    ivas_error error = IVAS_ERR_UNKNOWN;
    uint16_t numObj = 0;
@@ -2283,7 +2185,6 @@ static ivas_error decodeG192(
    nSamplesAvailableNext = 0;

    vec_pos_update = 0;
#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" );
@@ -2294,18 +2195,6 @@ static ivas_error decodeG192(
        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

#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
@@ -2389,22 +2278,12 @@ static ivas_error decodeG192(
            }
        }

#ifndef NONBE_UNIFIED_DECODING_PATHS
        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 */
        if ( arg.enableHeadRotation )
@@ -3062,12 +2941,10 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer
static ivas_error decodeVoIP(
    DecArguments arg,
    BS_READER_HANDLE hBsReader,
#ifdef NONBE_UNIFIED_DECODING_PATHS
    RotFileReader *headRotReader,
    RotFileReader *externalOrientationFileReader,
    RotFileReader *refRotReader,
    Vector3PairFileReader *referenceVectorReader,
#endif
    IVAS_DEC_HANDLE hIvasDec )
{
    bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */
@@ -3110,13 +2987,10 @@ static ivas_error decodeVoIP(

    IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN;
    IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS];
#ifdef NONBE_UNIFIED_DECODING_PATHS
    IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } };
    int16_t vec_pos_update, vec_pos_len;
    int16_t nOutSamples = 0;
#endif

#ifdef NONBE_UNIFIED_DECODING_PATHS
    vec_pos_update = 0;
    if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK )
    {
@@ -3133,7 +3007,6 @@ static ivas_error decodeVoIP(
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }
#endif

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
@@ -3234,16 +3107,7 @@ static ivas_error decodeVoIP(

    while ( 1 )
    {
#ifndef NONBE_UNIFIED_DECODING_PATHS
#if defined( SPLIT_REND_WITH_HEAD_ROT )
        uint16_t nOutSamples = 0;
#else
        int16_t nOutSamples = 0;
#endif
        nOutSamples = (int16_t) ( arg.output_Fs / 1000 * JBM_FRONTEND_FETCH_FRAMESIZE_MS );
#endif

#ifdef NONBE_UNIFIED_DECODING_PATHS
        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
        {
@@ -3362,7 +3226,6 @@ static ivas_error decodeVoIP(
                }
            }
        }
#endif

        /* read all packets with a receive time smaller than the system time */
        while ( nextPacketRcvTime_ms <= systemTime_ms )
@@ -3551,9 +3414,7 @@ static ivas_error decodeVoIP(
        {
            fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
        }
#ifdef NONBE_UNIFIED_DECODING_PATHS
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#endif
        frame++;
        systemTime_ms += systemTimeInc_ms;

+2 −56
Original line number Diff line number Diff line
@@ -187,11 +187,7 @@ typedef struct
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
    float syncMdDelay;
#ifdef NONBE_UNIFIED_DECODING_PATHS
    IVAS_RENDER_FRAMESIZE render_framesize;
#else
    bool framing_5ms;
#endif
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
    uint16_t acousticEnvironmentId;
} CmdlnArgs;
@@ -223,11 +219,7 @@ typedef enum
#endif
    CmdLnOptionId_referenceVectorFile,
    CmdLnOptionId_exteriorOrientationFile,
#ifdef NONBE_UNIFIED_DECODING_PATHS
    CmdLnOptionId_framing,
#else
    CmdLnOptionId_framing5ms,
#endif
    CmdLnOptionId_syncMdDelay,
    CmdLnOptionId_directivityPatternId,
    CmdLnOptionId_acousticEnvironmentId
@@ -380,21 +372,12 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "exof",
        .description = "External orientation trajectory file for simulation of external orientations",
    },
#ifdef NONBE_UNIFIED_DECODING_PATHS
    {
        .id = CmdLnOptionId_framing,
        .match = "framing",
        .matchShort = "fr",
        .description = "Set Render audio framing.",
    },
#else
    {
        .id = CmdLnOptionId_framing5ms,
        .match = "framing_5ms",
        .matchShort = "fr5",
        .description = "Render audio with 5 ms framing.",
    },
#endif
    {
        .id = CmdLnOptionId_syncMdDelay,
        .match = "sync_md_delay",
@@ -1033,27 +1016,12 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    }
#endif
#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 NONBE_UNIFIED_DECODING_PATHS

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ),
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig,
#endif
                                   args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ),
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig,
#endif
                                   args.nonDiegeticPan, args.nonDiegeticPanGain, ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
@@ -1686,11 +1654,7 @@ int main(
    {
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;
#ifdef NONBE_UNIFIED_DECODING_PATHS
        const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0;
#else
        const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0;
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
        numSamplesRead = 0;
@@ -1742,11 +1706,7 @@ int main(
#endif

        int16_t num_subframes, sf_idx;
#ifdef NONBE_UNIFIED_DECODING_PATHS
        num_subframes = (int16_t) args.render_framesize;
#else
        num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
#endif

        if ( isCurrentFrameMultipleOf20ms )
        {
@@ -2554,7 +2514,6 @@ static bool parseDiegeticPan(
}


#ifdef NONBE_UNIFIED_DECODING_PATHS
static bool parseRenderFramesize(
    char *value,
    IVAS_RENDER_FRAMESIZE *render_framesize )
@@ -2584,7 +2543,6 @@ static bool parseRenderFramesize(

    return true;
}
#endif

static bool parseOrientationTracking(
    char *value,
@@ -2881,11 +2839,7 @@ static CmdlnArgs defaultArgs(

    args.lfeCustomRoutingEnabled = false;
    clearString( args.inLfePanningMatrixFile );
#ifdef NONBE_UNIFIED_DECODING_PATHS
    args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
#else
    args.framing_5ms = false;
#endif
    args.syncMdDelay = 0;

    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
@@ -3047,7 +3001,6 @@ static void parseOption(
                exit( -1 );
            }
            break;
#ifdef NONBE_UNIFIED_DECODING_PATHS
        case CmdLnOptionId_framing:
            assert( numOptionValues == 1 );
            if ( !parseRenderFramesize( optionValues[0], &args->render_framesize ) )
@@ -3057,13 +3010,6 @@ static void parseOption(
            }

            break;
#else
        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 −2
Original line number Diff line number Diff line
@@ -147,7 +147,6 @@ typedef enum

} IVAS_HEAD_ORIENT_TRK_T;

#ifdef NONBE_UNIFIED_DECODING_PATHS
typedef enum
{
    IVAS_RENDER_FRAMESIZE_UNKNOWN = 0,
@@ -156,7 +155,6 @@ typedef enum
    IVAS_RENDER_FRAMESIZE_20MS = 4

} IVAS_RENDER_FRAMESIZE;
#endif

typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE;
typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE;
+1 −23
Original line number Diff line number Diff line
@@ -1335,49 +1335,27 @@ typedef struct {
    unsigned short length[81];
} HUFF_ELEMENTS;

#ifdef FIX_891_PARAMUPMIX_CLEANUP
typedef struct {
    HUFF_ELEMENTS df0;
    HUFF_ELEMENTS df;
} HUFF_TABLE;
#else
typedef struct {
    HUFF_ELEMENTS df0;
    HUFF_ELEMENTS df;
    HUFF_ELEMENTS dt;
} HUFF_TABLE;
#endif

typedef enum {
    ALPHA,
    BETA
} PAR_TYPE;

#ifndef FIX_891_PARAMUPMIX_CLEANUP
typedef enum {
    FINE,
    COARSE
} QUANT_TYPE;

#endif
typedef struct {
    int16_t nquant;
    int16_t offset;
    float data[35];
} ACPL_QUANT_TABLE;  
#ifdef FIX_891_PARAMUPMIX_CLEANUP

typedef struct
{
    const int16_t (*alpha)[2];
    const int16_t (*beta)[2];
} HUFF_NODE_TABLE;
#else
typedef struct
{
    const int16_t (*alpha[2])[2];
    const int16_t (*beta[2])[2];
} HUFF_NODE_TABLE;
#endif

/*----------------------------------------------------------------------------------*
 * Parametric MC Constants
+6 −26
Original line number Diff line number Diff line
@@ -162,12 +162,7 @@ ivas_error ivas_dirac_config(
    hConfig->dec_param_estim = FALSE;
    if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) /* skip for MASA decoder */
    {
        if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                              ,
                                              ivas_format
#endif
                                              ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band, ivas_format ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -324,12 +319,8 @@ void ivas_get_dirac_sba_max_md_bits(
    int16_t *bits_frame_nominal,
    int16_t *metadata_max_bits,
    int16_t *qmetadata_max_bit_req,
    const int16_t nbands
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
    ,
    IVAS_FORMAT ivas_format
#endif
)
    const int16_t nbands,
    IVAS_FORMAT ivas_format )
{
    if ( sba_total_brate <= IVAS_13k2 )
    {
@@ -345,13 +336,11 @@ void ivas_get_dirac_sba_max_md_bits(
    {
        *bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC;
        *metadata_max_bits = 103;
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
        /* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */
        if ( ivas_format == SBA_ISM_FORMAT )
        {
            ( *metadata_max_bits ) -= 3;
        }
#endif
    }
    else if ( sba_total_brate <= IVAS_32k )
    {
@@ -406,12 +395,8 @@ ivas_error ivas_dirac_sba_config(
    int16_t *element_mode,            /* i/o: element mode of the core coder                       */
    int32_t sba_total_brate,          /* i  : SBA total bitrate                                    */
    const int16_t sba_order,          /* i  : Ambisonic (SBA) order                                */
    const int16_t nbands              /* i  : number of frequency bands                            */
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
    ,
    IVAS_FORMAT ivas_format
#endif
)
    const int16_t nbands,             /* i  : number of frequency bands                            */
    IVAS_FORMAT ivas_format )
{
    int16_t nbands_coded;
    int16_t hodirac_flag;
@@ -473,12 +458,7 @@ ivas_error ivas_dirac_sba_config(
        }
    }

    ivas_get_dirac_sba_max_md_bits( sba_total_brate, &hQMetaData->bits_frame_nominal, &hQMetaData->metadata_max_bits, &hQMetaData->qmetadata_max_bit_req, hQMetaData->q_direction[0].cfg.nbands
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                    ,
                                    ivas_format
#endif
    );
    ivas_get_dirac_sba_max_md_bits( sba_total_brate, &hQMetaData->bits_frame_nominal, &hQMetaData->metadata_max_bits, &hQMetaData->qmetadata_max_bit_req, hQMetaData->q_direction[0].cfg.nbands, ivas_format );

    return error;
}
Loading