Commit 7476506a authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_1065_ISM_MD_HANDLE

parent 5c6192ad
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -2376,20 +2376,14 @@ ivas_error ivas_ism_dec_config_fx(

ivas_error ivas_ism_metadata_dec_create_fx(
    Decoder_Struct *st_ivas,    /* i/o: IVAS decoder structure                      */
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
    const Word16 n_ISms,        /* i  : number of separately coded objects          */
#else
    const Word16 n_ISms,       /* i  : number of objects           */
#endif
    Word32 element_brate_tmp[] /* o  : element bitrate per object                   */
);

#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
void ivas_ism_reset_metadata_handle_dec_fx(
    ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle                         */
);

#endif
ivas_error ivas_sba_dec_reconfigure_fx(
    Decoder_Struct *st_ivas,  /* i/o: IVAS decoder structure              */
    UWord16 *nSamplesFlushed, /* o  : number of samples flushed           */
+0 −1
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@
#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 NONBE_FIX_SBA_SIGNALING_BITS_B                  /* FhG: issue 1061: option B: signal sba order additionally in OSBA */
#define NONBE_FIX_1065_ISM_MD_HANDLE                    /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */
#define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP               /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */
#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
/* #################### End BASOP porting switches ############################ */
+0 −8
Original line number Diff line number Diff line
@@ -1508,11 +1508,7 @@ ivas_error ivas_init_decoder_fx(
            }
        }

#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
        IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK )
#else
        IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nSCE, element_brate_tmp ) ), IVAS_ERR_OK ) )
#endif
        {
            return error;
        }
@@ -1919,7 +1915,6 @@ ivas_error ivas_init_decoder_fx(

            reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] );

#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
            IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
            {
                if ( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK )
@@ -1929,14 +1924,11 @@ ivas_error ivas_init_decoder_fx(
            }
            else
            {
#endif
                IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, 1, NULL ) ), IVAS_ERR_OK ) )
                {
                    return error;
                }
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
            }
#endif
        }
        ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) )
        {
+0 −49
Original line number Diff line number Diff line
@@ -780,7 +780,6 @@ ivas_error ivas_ism_metadata_dec_fx(
    return IVAS_ERR_OK;
}

#ifdef NONBE_FIX_1065_ISM_MD_HANDLE

/*-------------------------------------------------------------------*
 * ivas_ism_reset_metadata_handle_dec()
@@ -826,7 +825,6 @@ void ivas_ism_reset_metadata_handle_dec_fx(
    return;
}

#endif

/*-------------------------------------------------------------------------
 * ivas_ism_metadata_dec_create()
@@ -836,11 +834,7 @@ void ivas_ism_reset_metadata_handle_dec_fx(

ivas_error ivas_ism_metadata_dec_create_fx(
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure               */
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
    const Word16 n_ISms, /* i  : number of separately coded objects   */
#else
    const Word16 n_ISms, /* i  : number of objects           */
#endif
    Word32 element_brate_tmp[] /* o  : element bitrate per object           */
)
{
@@ -848,61 +842,19 @@ ivas_error ivas_ism_metadata_dec_create_fx(
    ivas_error error;

    /* allocate ISM metadata handles */
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
    FOR( ch = 0; ch < n_ISms; ch++ )
#else
    FOR( ch = 0; ch < MAX_NUM_OBJECTS; ch++ )
#endif
    {
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
        IF( st_ivas->hIsmMetaData[ch] == NULL ) /* note: the handle can be allocated in OMASA bitrate switching from ISM_MASA_MODE_xxx_ONE_OBJ to ISM_MASA_MODE_DISC mode for 'ch==0' */
        {
#endif
            IF( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) );
            }
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
        }
#endif

#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
        ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[ch] );
#else
        st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0;
        move16();
        st_ivas->hIsmMetaData[ch]->position_angle.last_angle1_idx = 0;
        move16();
        st_ivas->hIsmMetaData[ch]->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 );
        move16();
        st_ivas->hIsmMetaData[ch]->orientation_angle.last_angle1_idx = 0;
        move16();
        st_ivas->hIsmMetaData[ch]->orientation_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 );
        move16();
        st_ivas->hIsmMetaData[ch]->last_radius_idx = 8; /* Init to radius 1.0 */
        move16();

        st_ivas->hIsmMetaData[ch]->last_true_azimuth_fx = 0;
        move32();
        st_ivas->hIsmMetaData[ch]->last_true_elevation_fx = 0;
        move32();
        st_ivas->hIsmMetaData[ch]->last_azimuth_fx = 0;
        move32();
        st_ivas->hIsmMetaData[ch]->last_elevation_fx = 0;
        move32();

        st_ivas->hIsmMetaData[ch]->ism_imp = -1;
        move16();
        st_ivas->hIsmMetaData[ch]->ism_md_null_flag = 0;
        move16();
        st_ivas->hIsmMetaData[ch]->ism_md_lowrate_flag = 0;
        move16();

        ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] );
#endif
    }

#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
    /* sanity freeing - it can happen only in reconfiguration when a smaller number of handles than before is requested */
    FOR( ; ch < MAX_NUM_OBJECTS; ch++ )
    {
@@ -913,7 +865,6 @@ ivas_error ivas_ism_metadata_dec_create_fx(
        }
    }

#endif
    IF( element_brate_tmp != NULL )
    {
        IF( NE_32( ( error = ivas_ism_config_fx( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ), IVAS_ERR_OK ) )
+0 −20
Original line number Diff line number Diff line
@@ -569,7 +569,6 @@ ivas_error ivas_omasa_dec_config_fx(
        IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
        {
            /* the full number of hIsmMetaData are needed for EXT output */
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
            IF( st_ivas->hIsmMetaData[0] == NULL )
            {
                IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK )
@@ -584,20 +583,6 @@ ivas_error ivas_omasa_dec_config_fx(
                    ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] );
                }
            }
#else
            move16();
            n_MD = st_ivas->nchan_ism;
            ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );

            error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL );
            move32();
            IF( NE_32( error, IVAS_ERR_OK ) )
            {
                return error;
            }

            ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD );
#endif
        }
        ELSE
        {
@@ -616,21 +601,16 @@ ivas_error ivas_omasa_dec_config_fx(
                        return error;
                    }
                }
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
                ELSE
                {
                    ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[0] );
                }
#endif
            }
            ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) )
            {
                n_MD = st_ivas->nchan_ism;
                move16();

#ifndef NONBE_FIX_1065_ISM_MD_HANDLE
                ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
#endif
                error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL );
                move32();
                IF( NE_32( error, IVAS_ERR_OK ) )