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

Merge branch 'ivas-float-update' of...

Merge branch 'ivas-float-update' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into 1629_ref_port_fl1485
parents 37adf0f7 dd3eacaf
Loading
Loading
Loading
Loading
Loading
+49 −3
Original line number Diff line number Diff line
@@ -1975,7 +1975,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;
@@ -2442,13 +2447,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;

                /* 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;
@@ -2575,13 +2594,26 @@ 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;
@@ -3229,13 +3261,27 @@ 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
@@ -1844,8 +1844,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
@@ -118,7 +118,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;


+24 −0
Original line number Diff line number Diff line
@@ -5733,6 +5733,30 @@ void ivas_omasa_rearrange_channels(
    const int16_t 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(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                 */
);

void ivas_omasa_combine_separate_ism_with_masa(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                    */
    float *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        */
);

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

void ivas_omasa_render_objects_from_mix(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                    */
    float *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        */
);

#endif
void ivas_omasa_dirac_rend_jbm(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                     */
    const uint16_t nSamplesAsked,                               /* i  : number of samples requested             */
+2 −2
Original line number Diff line number Diff line
@@ -180,13 +180,13 @@
#define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM   /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */
#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 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 actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on  )*/
#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_984_OMASA_EXT_OUTPUT                  /* Nok: issue 1497 - porting OMASA EXT MR   */
/* #################### End BASOP porting switches ############################ */

/* clang-format on */
Loading