Commit 94935228 authored by lintervo's avatar lintervo
Browse files

ism metadata decoder reconfig changes for enabling object editing with bitrate switching

parent c98266fa
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -596,7 +596,11 @@ ivas_error ivas_masa_dec_open(

    ism_total_brate = 0;
    /* ISM metadata */
#ifdef OMASA_ISM_META_OPT
    if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL )
#else
    if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
#endif
    {
        /* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */
        ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
+12 −6
Original line number Diff line number Diff line
@@ -335,14 +335,20 @@ ivas_error ivas_omasa_dec_config(
    {
        /* ISM MD reconfig. */
#ifdef OMASA_ISM_META_OPT
        /* TODO: is it necessary to close the old structs if the number is constant? alternatively only check if allocation is needed */
        ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
        if ( st_ivas->hIsmMetaData[0] == NULL )
        {
            if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK )
            {
                return error;
            }

        ivas_ism_metadata_close( st_ivas->hIsmMetaData, st_ivas->nchan_ism ); /* close extra structs */
        }
        else
        {
            for ( k = 0; k < st_ivas->nchan_ism; k++ )
            {
                ivas_ism_reset_metadata_handle_dec( st_ivas->hIsmMetaData[k] );
            }
        }
#else
        n_MD = 0;

+6 −4
Original line number Diff line number Diff line
@@ -1070,13 +1070,15 @@ ivas_error IVAS_DEC_GetSamples(
                            }
                        }
                    }

                    if ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT )
                    {
                        if ( fabsf( bed_gain - 1.0f ) > OMASA_GAIN_EDIT_THR )
                        {
                            hIvasDec->st_ivas->hMasaIsmData->gain_masa_edited = bed_gain;
                            hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 1u;
                        }
                    }
                }
#endif
#ifdef DEBUG_MODE_JBM
                dbgwrite( &nTimeScalerOutSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_nTimeScaleOutSamples.dat" );