Commit 27c6afae authored by advasila's avatar advasila
Browse files

merge switch OMASA_FIX_LOW_FS

parent 15689a0c
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -202,7 +202,6 @@
#define MASAISM_EDIT_OBJECTS                            /* Nokia: Temporary command line editing of object directions in the decoder */
#define FIX_356_ISM_METADATA_SYNC_OMASA // temp. fix
#define OMASA_BRSW_MONO_FIX                             /* Nokia: fix renderer config under rateswitching and MONO output */
#define OMASA_FIX_LOW_FS                                /* Nokia: fixes related to lower input signal sampling rates */
#endif

/* ################## End BE DEVELOPMENT switches ######################### */
+0 −6
Original line number Diff line number Diff line
@@ -298,10 +298,8 @@ ivas_error ivas_enc(

        flag_omasa_ener_brate = 0;

#ifdef OMASA_FIX_LOW_FS
        /* Estimate TF-tile energy for the input MASA stream */
        ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport );
#endif

        if ( ( error = ivas_omasa_enc_config( st_ivas ) ) != IVAS_ERR_OK )
        {
@@ -318,10 +316,6 @@ ivas_error ivas_enc(
        set_s( nb_bits_metadata, 0, MAX_SCE + 1 );
        idx_separated_object = 0;

#ifndef OMASA_FIX_LOW_FS
        /* Estimate TF-tile energy for the input MASA stream */
        ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport );
#endif

        /* put audio object data in SCE's */
        if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC )
+1 −11
Original line number Diff line number Diff line
@@ -745,9 +745,7 @@ ivas_error ivas_masa_enc_config(
    ivas_error error;
#ifdef MASA_AND_OBJECTS
    int32_t ism_total_brate;
#ifdef OMASA_FIX_LOW_FS
    int32_t masa_total_brate;
#endif
#endif

    error = IVAS_ERR_OK;
@@ -903,16 +901,12 @@ ivas_error ivas_masa_enc_config(

#ifdef MASA_AND_OBJECTS
    st_ivas->hQMetaData->q_direction->cfg.inactiveBands = 0;
#ifdef OMASA_FIX_LOW_FS
    masa_total_brate = ivas_total_brate;
    if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC )
    {
        masa_total_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism );
    }
    if ( masa_total_brate >= IVAS_384k && ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) )
#else
    if ( ivas_total_brate > IVAS_256k && ivas_format == MASA_FORMAT )
#endif
#else
    if ( ivas_total_brate > IVAS_256k )
#endif
@@ -944,12 +938,8 @@ ivas_error ivas_masa_enc_config(
            st_ivas->hQMetaData->q_direction->cfg.inactiveBands = 0;
        }
    }
#ifdef OMASA_FIX_LOW_FS
    masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, maxBand, masa_total_brate >= IVAS_384k, NULL );

#else
    masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, maxBand, ivas_total_brate > IVAS_256k, NULL );
#endif
    masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, maxBand, masa_total_brate >= IVAS_384k, NULL );

    if ( hMasa->config.numTwoDirBands >= hMasa->config.numCodingBands )
    {
+1 −14
Original line number Diff line number Diff line
@@ -531,14 +531,8 @@ void ivas_omasa_enc(
        }

        /* force computation into high resolution */
#ifndef OMASA_FIX_LOW_FS
        n_bands_orig = hOMasa->nbands;
#endif
        n_subframes_orig = hOMasa->nSubframes;

#ifndef OMASA_FIX_LOW_FS
        hOMasa->nbands = MASA_FREQUENCY_BANDS;
#endif
        n_subframes_orig = hOMasa->nSubframes;
        hOMasa->nSubframes = MAX_PARAM_SPATIAL_SUBFRAMES;

        /* Estimate MASA parameters from the objects */
@@ -556,20 +550,13 @@ void ivas_omasa_enc(
        }

        /* restore resolution parameters */
#ifndef OMASA_FIX_LOW_FS
        hOMasa->nbands = n_bands_orig;
#endif
        hOMasa->nSubframes = n_subframes_orig;

        /* perform MASA+ISM merge in full resolution */
        numCodingBands_orig = hMasa->config.numCodingBands;
        joinedSubframes_orig = hMasa->config.joinedSubframes;

#ifndef OMASA_FIX_LOW_FS
        hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS;
#else
        hMasa->config.numCodingBands = hOMasa->nbands;
#endif
        hMasa->config.joinedSubframes = 0;

        ivas_merge_masa_metadata( hMasa, hOMasaMeta ); /* => merge result in hMasa->masaMetadata */