Commit 53c2d38d authored by stoutjesdijk's avatar stoutjesdijk 🎧
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into 103-Digest-room-acoustics-parameters-for-Parametric-Binaural-Renderer
parents d894ddae 9e5e915b
Loading
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -1297,15 +1297,24 @@ 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;
@@ -1313,7 +1322,11 @@ 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;
@@ -1546,14 +1559,23 @@ 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;
@@ -1573,8 +1595,8 @@ static ivas_error decodeG192(
#endif
        }
#ifdef WMOPS
        update_wmops();
        update_mem();
        update_wmops();
#endif
    }

@@ -2074,8 +2096,8 @@ static ivas_error decodeVoIP(
        systemTime_ms += 20;

#ifdef WMOPS
        update_wmops();
        update_mem();
        update_wmops();
#endif
    }

+17 −8
Original line number Diff line number Diff line
@@ -778,8 +778,8 @@ int main(
        }

#ifdef WMOPS
        update_wmops();
        update_mem();
        update_wmops();
#endif
    }

@@ -1640,8 +1640,18 @@ static void usage_enc( void )
    fprintf( stdout, "                                                *VBR mode (average bitrate),\n" );
    fprintf( stdout, "                      for AMR-WB IO modes R =  (6600, 8850, 12650, 14250, 15850, 18250,\n" );
    fprintf( stdout, "                                                19850, 23050, 23850) \n" );
#ifdef ISM_HIGHEST_BITRATE
    fprintf( stdout, "                      for IVAS stereo R =      (13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" );
    fprintf( stdout, "                                                96000, 128000, 160000, 192000, 256000) \n" );
    fprintf( stdout, "                      for IVAS ISM R =          13200 for 1 ISM, 16400 for 1 ISM and 2 ISM, \n" );
    fprintf( stdout, "                                               (24400, 32000, 48000, 64000, 80000, 96000, 128000) \n" );
    fprintf( stdout, "                                                for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000) \n" );
    fprintf( stdout, "                                                for 3 ISM and 4 ISM also 384000 \n" );
    fprintf( stdout, "                                                for 4 ISM also 512000 \n" );
#else
    fprintf( stdout, "                      for IVAS stereo & ISm R =(13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" );
    fprintf( stdout, "                                                96000, 128000, 160000, 192000, 256000) \n" );
#endif
    fprintf( stdout, "                      for IVAS SBA, MASA, MC R=(13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" );
    fprintf( stdout, "                                                96000, 128000, 160000, 192000, 256000, 384000, 512000) \n" );
    fprintf( stdout, "                      Alternatively, R can be a bitrate switching file which consists of R values\n" );
@@ -1657,16 +1667,16 @@ static void usage_enc( void )
    fprintf( stdout, "EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -masa, -mc\n" );
    fprintf( stdout, "-stereo [Mode]      : Stereo format, default is unified stereo \n" );
    fprintf( stdout, "                      optional for Mode: 1: DFT Stereo, 2: TD Stereo, 3: MDCT Stereo\n" );
    fprintf( stdout, "-ism Channels Files : ISm format \n" );
    fprintf( stdout, "                      where Channels specifies the number of ISms (1-4)\n" );
    fprintf( stdout, "-ism Channels Files : ISM format \n" );
    fprintf( stdout, "                      where Channels specifies the number of ISMs (1-4)\n" );
    fprintf( stdout, "                      and Files specify input files containing metadata, one file per object\n" );
    fprintf( stdout, "                      (use NULL for no input metadata)\n" );
    fprintf( stdout, "-sba +/-Order       : Scene Based Audio input format (Ambisonics ACN/SN3D),\n" );
    fprintf( stdout, "                      where Order specifies the Ambisionics order (1-3),\n" );
    fprintf( stdout, "                      where positive (+) means full 3D and negative (-) only 2D/planar components to be coded\n" );
    fprintf( stdout, "-masa Ch File       : MASA format \n" );
    fprintf( stdout, "                      where Ch specifies the number of input/transport channels (1 or 2): \n" );
    fprintf( stdout, "                      and File specifies input file containing parametric metadata \n" );
    fprintf( stdout, "-masa Channels File : MASA format \n" );
    fprintf( stdout, "                      where Channels specifies the number of input/transport channels (1 or 2): \n" );
    fprintf( stdout, "                      and File specifies input file containing parametric MASA metadata \n" );
    fprintf( stdout, "-mc InputConf       : Multi-channel format\n" );
    fprintf( stdout, "                      where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4\n" );
    fprintf( stdout, "                      Loudspeaker positions are assumed to have azimuth and elevation as per \n" );
@@ -1676,8 +1686,7 @@ static void usage_enc( void )
    fprintf( stdout, "                      where 0 = adaptive, 3-100 = fixed in number of frames,\n" );
    fprintf( stdout, "                      default is deactivated\n" );
    fprintf( stdout, "-dtx                : Activate DTX mode with a SID update rate of 8 frames\n" );
    fprintf( stdout, "                      Note: DTX is currently supported in EVS, stereo, 1 ISm, \n" );
    fprintf( stdout, "                      SBA (up to 128kbps) and MASA (up to 128kbps)\n" );
    fprintf( stdout, "                      Note: DTX is supported in EVS, stereo, ISM, SBA up to 80kbps and MASA up to 128kbps \n" );
    fprintf( stdout, "-rf p o             : Activate channel-aware mode for WB and SWB signal at 13.2kbps, \n" );
    fprintf( stdout, "                      where FEC indicator, p: LO or HI, and FEC offset, o: 2, 3, 5, or 7 in number of frames.\n" );
    fprintf( stdout, "                      Alternatively p and o can be replaced by a rf configuration file with each line  \n" );
+1 −1
Original line number Diff line number Diff line
@@ -1021,8 +1021,8 @@ int main(
        }

#ifdef WMOPS
        update_wmops();
        update_mem();
        update_wmops();
#endif
    }

+3 −6
Original line number Diff line number Diff line
@@ -706,8 +706,7 @@ ivas_error openCldfb(
    HANDLE_CLDFB_FILTER_BANK hs;
    int16_t buf_len;

    hs = (HANDLE_CLDFB_FILTER_BANK) malloc( sizeof( CLDFB_FILTER_BANK ) );
    if ( hs == NULL )
    if ( ( hs = (HANDLE_CLDFB_FILTER_BANK) malloc( sizeof( CLDFB_FILTER_BANK ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" );
    }
@@ -728,8 +727,7 @@ ivas_error openCldfb(
        buf_len = hs->p_filter_length;
    }

    hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) );
    if ( hs->cldfb_state == NULL )
    if ( ( hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" );
    }
@@ -1148,8 +1146,7 @@ ivas_error cldfb_save_memory(
        hs->memory_length = hs->p_filter_length;
    }

    hs->memory = (float *) malloc( hs->memory_length * sizeof( float ) );
    if ( hs->memory == NULL )
    if ( ( hs->memory = (float *) malloc( hs->memory_length * sizeof( float ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
+4 −0
Original line number Diff line number Diff line
@@ -87,7 +87,11 @@ typedef struct
} IVAS_QUATERNION;

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;
Loading