Commit c36b71d9 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into 1634_basop_port_fl1477

parents ac14964d 24a91cb5
Loading
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -1717,7 +1717,12 @@ static ivas_error initOnFirstGoodFrame(

                for ( int16_t j = 0; j < numInitialBadFrames; ++j )
                {
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                    float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale );
                    if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) );
                        return error;
@@ -2101,13 +2106,28 @@ static ivas_error decodeG192(
            if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                int16_t fullDelayNumSamples[3];
                float delayMs;

                /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */
                if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
#endif
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
@@ -2233,13 +2253,27 @@ static ivas_error decodeG192(
            if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                int16_t fullDelayNumSamples[3];
                float delayMs;

                if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
#endif
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
@@ -2785,13 +2819,28 @@ static ivas_error decodeVoIP(
                if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
                {
                    IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                    int16_t fullDelayNumSamples[3];
                    float delayMs;

                    /* delayNumSamples_orig is fetched only for the first good frame, but here the delay can change between frames, so need to re-fetch */
                    if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                    }
#endif
                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                    delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                    if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                        goto cleanup;
+4 −1
Original line number Diff line number Diff line
@@ -1987,8 +1987,11 @@ int main(
                    }
                }
            }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
            if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput, NULL ) ) != IVAS_ERR_OK ) /* NULL -> use default metadata delay settings */
#else
            if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
            }
+6 −0
Original line number Diff line number Diff line
@@ -147,7 +147,13 @@ typedef enum
    RENDERER_NON_DIEGETIC_DOWNMIX,
    RENDERER_OSBA_STEREO,
    RENDERER_OSBA_AMBI,
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
    RENDERER_OSBA_LS,
    RENDERER_OMASA_OBJECT_EXT,
    RENDERER_OMASA_MIX_EXT
#else
    RENDERER_OSBA_LS
#endif
} RENDERER_TYPE;

#define MAX_FREQUENCY_BANDS                    64
+33 −6
Original line number Diff line number Diff line
@@ -156,6 +156,33 @@ void ivas_omasa_rearrange_channels_fx(
    const Word16 output_frame         /* i  : output frame length per channel */
);

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
ivas_error ivas_omasa_combine_separate_ism_with_masa_open_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                 */
);

void ivas_omasa_combine_separate_ism_with_masa_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                    */
    Word32 *output[],                                           /* o  : output synthesis signal                */
    Word16 *output_q,                                           /* i/o: output Q value                         */
    const int16_t nchan_ism,                                    /* i  : number of ISMs                         */
    const int16_t output_frame                                  /* i  : output frame length per channel        */
);

ivas_error ivas_omasa_render_objects_from_mix_open_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                 */
);

void ivas_omasa_render_objects_from_mix_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                    */
    Word32 *output[],                                           /* o  : output synthesis signal                */
    const int16_t nchan_ism,                                    /* i  : number of ISMs                         */
    const int16_t output_frame,                                 /* i  : output frame length per channel        */
    Word16 *output_q                                            /* i/o: output Q value                         */
);

#endif

ivas_error ivas_omasa_ism_metadata_dec_fx(
    Decoder_Struct *st_ivas,            /* i/o: IVAS decoder structure            */
    const Word32 ism_total_brate,       /* i  : ISM total bitrate                 */
+8 −7
Original line number Diff line number Diff line
@@ -155,19 +155,20 @@
#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM
#endif

#define USE_NEW_HRTF_BINARY_FILE_FORMAT                 /* Orange: to activate when decided to change the hrtf binary file format */
#define NONBE_FIX_984_OMASA_EXT_OUTPUT                        /* Nokia: issue #984: complete the OMASA EXT output implementation */

#define USE_NEW_HRTF_BINARY_FILE_FORMAT                 /* Orange: to activate when decided to change the hrtf binary file format */
#define FIX_WARNING_RENDER_CONFIG                       /* Orange: fix warning on windows build */



#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF              /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */
#define NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB     /* FhG: fix bug in TD MDCT-Stereo concealment */

#define FIX_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define FIX_1831_REVERB_REGRESSION                      /* Philips: fixes reverb regression issues  */

#define FIX_1835_REVERB_ACTIVATION                      /* FhG: Modified reverberation activation logic and corrected factEQ calculation */
#define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST           /* FhG: address issue 1037 */
#define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI      /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */
#define NONBE_FIX_1056_ISM_RATE_SWITCH                  /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */	
#define NONBE_FIX_1075                                  /* FhG: fix segfault for bitrate switching + BINAURAL_ROOM_REVERB output in MC */
#define NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB     /* FhG: fix bug in TD MDCT-Stereo concealment */

/* #################### End BASOP porting switches ############################ */

#endif
Loading