Commit 1500082f authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 20230309_editorial_improvements

parents 33a07519 eae756c7
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
    }

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

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

+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
    }

+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;
+14 −0
Original line number Diff line number Diff line
@@ -72,6 +72,13 @@ int32_t get_delay(
        else /* IVAS */
        {
            delay = IVAS_ENC_DELAY_NS;

#ifdef FIX_350_MASA_DELAY_COMP
            if ( ivas_format == MASA_FORMAT )
            {
                delay = 0; /* All delay is compensated in the decoder with MASA */
            }
#endif
        }

        if ( ivas_format == SBA_FORMAT )
@@ -107,6 +114,13 @@ int32_t get_delay(
            /* compensate for binauralization delay */
            delay += binaural_latency_ns;
#endif

#ifdef FIX_350_MASA_DELAY_COMP
            if ( ivas_format == MASA_FORMAT )
            {
                delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with MASA */
            }
#endif
        }
    }

Loading