Commit 1acecee7 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into orange/no-diegetic-pan-with-radius

parents cc009bc6 209b62c4
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -1387,24 +1387,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;
@@ -1412,11 +1403,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;
@@ -1676,23 +1663,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 −7
Original line number Diff line number Diff line
@@ -657,9 +657,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 ) );
@@ -691,11 +688,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 );
+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 −4
Original line number Diff line number Diff line
@@ -97,11 +97,7 @@ typedef struct
} IVAS_VECTOR3;

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