Commit 6cc23ab1 authored by hmund's avatar hmund
Browse files

Merge branch 'main' into dlb_sba_encoder_complexity_opt

parents a00fc3e5 742255e9
Loading
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -1353,24 +1353,15 @@ static ivas_error initOnFirstGoodFrame(
        /* If outputting MASA, open output file and write metadata for initial bad frames */
        else if ( *pBsFormat == IVAS_DEC_BS_MASA )
        {
#ifdef FIX_350_MASA_DELAY_COMP
            if ( ( error = MasaFileWriter_open( arg.outputWavFilename, arg.delayCompensationEnabled, ppMasaWriter ) ) != IVAS_ERR_OK )
#else
            if ( ( error = MasaFileWriter_open( arg.outputWavFilename, ppMasaWriter ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError: Error opening MASA decoded metadata file %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) );
                return error;
            }

            /* Duplicate good first frame metadata to fill the beginning of stream. */
#ifdef FIX_350_MASA_DELAY_COMP
            MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL;
            if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#else
            IVAS_MASA_QMETADATA_HANDLE qMetadata = NULL;
            if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &qMetadata ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                return error;
@@ -1378,11 +1369,7 @@ static ivas_error initOnFirstGoodFrame(

            for ( int16_t j = 0; j < numInitialBadFrames; ++j )
            {
#ifdef FIX_350_MASA_DELAY_COMP
                if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, qMetadata ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) );
                    return error;
@@ -1429,11 +1416,7 @@ static ivas_error decodeG192(
    ivas_error error = IVAS_ERR_UNKNOWN;
    uint16_t numObj = 0;
    IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN;
#ifdef FIX_406_IVAS_POSITION
    IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
#else
    IVAS_POSITION Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
#endif

    IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS];
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
@@ -1646,23 +1629,14 @@ static ivas_error decodeG192(
            }
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            {
#ifdef FIX_350_MASA_DELAY_COMP
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#else
                IVAS_MASA_QMETADATA_HANDLE qMetadata;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &qMetadata ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

#ifdef FIX_350_MASA_DELAY_COMP
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, qMetadata ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
+0 −15
Original line number Diff line number Diff line
@@ -536,11 +536,7 @@ int main(
    int32_t delayTimeScale = 0;
    int16_t i, numChannels;
    ivas_error error = IVAS_ERR_OK;
#ifdef FIX_406_IVAS_POSITION
    IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME];
#else
    IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME];
#endif

#ifdef WMOPS
    reset_wmops();
@@ -649,9 +645,6 @@ int main(
                fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" );
                exit( -1 );
            }
#ifndef FIX_389_EXT_REND_PCM_SR
            args.sampleRate = inFileSampleRate;
#endif
            break;
        default:
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
@@ -679,11 +672,7 @@ int main(
    }

    /* === Configure === */
#ifdef FIX_392_LATE_REVERB
    if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_InitConfig( hIvasRend, ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "Error in Renderer Config Init\n" );
        exit( -1 );
@@ -975,12 +964,8 @@ int main(
        }
        else
        {
#ifdef FIX_379_EXT_METADATA
            error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL );
            if ( ( error != IVAS_ERR_OK ) && ( error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC
#else
            if ( ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) ) != IVAS_ERR_OK ) && ( IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC
#endif
            {
                fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
+0 −7
Original line number Diff line number Diff line
@@ -833,13 +833,6 @@ static ivas_error write_indices_element(
            /* restore previous pointer position */
            pt_stream_loc = pt_stream_backup;
        }
#ifndef ISSUE_24_CLEANUP_MCT_LFE
        /* TODO implemented only for MCT for now */
        if ( ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_MCT ) && ( element_id * CPE_CHANNELS + n == LFE_CHANNEL ) )
        {
            continue;
        }
#endif
#ifdef ENABLE_BITRATE_VERIFICATION
        total_nb_bits =
#endif
+0 −11
Original line number Diff line number Diff line
@@ -93,20 +93,9 @@ typedef struct
    float x, y, z;
} IVAS_VECTOR3;

#ifndef FIX_406_IVAS_POSITION
typedef struct
{
    float x, y, z;

} IVAS_POSITION;
#endif

typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE;
#ifdef FIX_350_MASA_DELAY_COMP
typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE;
#else
typedef struct ivas_masa_qmetadata_frame_struct *IVAS_MASA_QMETADATA_HANDLE;
#endif

typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE;
typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE;
+8 −45
Original line number Diff line number Diff line
@@ -250,18 +250,10 @@ int16_t getTnsAllowed(
    const int32_t total_brate, /* i  : total bitrate               */
    const int16_t igf,         /* i  : flag indicating IGF activity*/
    const int16_t element_mode /* i  : IVAS element mode           */
#ifndef ISSUE_24_CLEANUP_MCT_LFE
    ,
    const MCT_CHAN_MODE mct_chan_mode /* i  : MCT channel mode            */
#endif
)
{
    int16_t tnsAllowed = 0;

#ifndef ISSUE_24_CLEANUP_MCT_LFE
    if ( mct_chan_mode != MCT_CHAN_MODE_LFE )
    {
#endif
    if ( igf )
    {
        if ( total_brate > HQ_16k40 || ( ( total_brate > HQ_13k20 ) && element_mode == IVAS_CPE_DFT ) )
@@ -273,9 +265,6 @@ int16_t getTnsAllowed(
    {
        tnsAllowed = 1;
    }
#ifndef ISSUE_24_CLEANUP_MCT_LFE
    }
#endif

    return tnsAllowed;
}
@@ -419,20 +408,10 @@ int16_t getIgfPresent(
    const int32_t total_brate,  /* i  : total bitrate               */
    const int16_t bwidth,       /* i  : audio bandwidth             */
    const int16_t rf_mode       /* i  : flag to signal the RF mode  */
#ifndef ISSUE_24_CLEANUP_MCT_LFE
    ,
    const int16_t mct_chan_mode /* i  : MCT channel mode            */
#endif
)
{
    int16_t igfPresent = 0;

#ifndef ISSUE_24_CLEANUP_MCT_LFE
    if ( mct_chan_mode == MCT_CHAN_MODE_LFE )
    {
        return igfPresent;
    }
#endif

    if ( bwidth == SWB )
    {
@@ -820,12 +799,7 @@ void init_tcx_cfg(
    const int16_t infoIGFStopFreq,
    const int16_t element_mode,
    const int16_t ini_frame,
    const int16_t MCT_flag
#ifndef ISSUE_24_CLEANUP_MCT_LFE
    ,
    const MCT_CHAN_MODE mct_chan_mode /* i  : MDCT channel mode     */
#endif
)
    const int16_t MCT_flag )
{
    int16_t i;
    int16_t mdctWindowLength;
@@ -855,20 +829,9 @@ void init_tcx_cfg(
    /* set number of coded lines */
    hTcxCfg->tcx_coded_lines = getNumTcxCodedLines( bwidth );

#ifndef ISSUE_24_CLEANUP_MCT_LFE
    if ( mct_chan_mode == MCT_CHAN_MODE_LFE )
    {
        hTcxCfg->tcx_coded_lines = MCT_LFE_MAX_LINE;
    }
#endif
    /* TNS in TCX */
    hTcxCfg->pCurrentTnsConfig = NULL;
    hTcxCfg->fIsTNSAllowed = getTnsAllowed( total_brate, igf, element_mode
#ifndef ISSUE_24_CLEANUP_MCT_LFE
                                            ,
                                            mct_chan_mode
#endif
    );
    hTcxCfg->fIsTNSAllowed = getTnsAllowed( total_brate, igf, element_mode );

    if ( hTcxCfg->fIsTNSAllowed )
    {
Loading