Commit ab85f0a2 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

convert some code parts to basop

parent 641691d7
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1872,7 +1872,7 @@ ivas_error ivas_init_decoder_fx(
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
            {
                /* reusing OMASA function for allocating and initializing MASA_ISM rendering handle (even though not in OMASA) */
                if ( ( error = ivas_omasa_data_open( st_ivas ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_omasa_data_open_fx( st_ivas ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
+4 −4
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
            ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin );
#ifdef OBJ_EDITING_PARAMISM_BIN
            /* Close omasa data struct (used for object editing) */
            ivas_omasa_data_close( &st_ivas->hMasaIsmData );
            ivas_omasa_data_close_fx( &st_ivas->hMasaIsmData );
#endif

            /* Open the TD Binaural renderer */
@@ -271,7 +271,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(

#ifdef OBJ_EDITING_PARAMISM_BIN
            /* Close omasa data struct (used for object editing) */
            ivas_omasa_data_close( &st_ivas->hMasaIsmData );
            ivas_omasa_data_close_fx( &st_ivas->hMasaIsmData );
#endif

            /* Open Crend Binaural renderer */
@@ -312,7 +312,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
            
#ifdef OBJ_EDITING_PARAMISM_BIN
            /* Open omasa data struct (used for object editing) */
            if ( ( error = ivas_omasa_data_open( st_ivas ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_omasa_data_open_fx( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -347,7 +347,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(

#ifdef OBJ_EDITING_PARAMISM_BIN
            /* Open omasa data struct (used for object editing) */
            if ( ( error = ivas_omasa_data_open( st_ivas ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_omasa_data_open_fx( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
            }
+12 −10
Original line number Diff line number Diff line
@@ -4654,15 +4654,16 @@ void ivas_jbm_dec_prepare_renderer(
                IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) )
                {
#ifdef OMASA_OBJECT_EDITING
                    float gainIsm;
                    gainIsm = OMASA_TDREND_MATCHING_GAIN;
                    Word32 gainIsm;
                    gainIsm = OMASA_TDREND_MATCHING_GAIN_FX;

                    if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
                    IF ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
                    {
                        gainIsm *= st_ivas->hMasaIsmData->gain_ism_edited[n];
                        //gainIsm *= st_ivas->hMasaIsmData->gain_ism_edited[n];
                        assert( 0 && "Insert actual basop code here!");
                    }

                    v_multc( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], gainIsm, st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available );
                    v_multc_fixed_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], gainIsm, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available );
#else
                    v_multc_fixed_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN_FX, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available );
#endif
@@ -4671,16 +4672,17 @@ void ivas_jbm_dec_prepare_renderer(
                //TODO: check if tis is a bug in main already
            }
#ifdef OMASA_OBJECT_EDITING
            if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC )
            IF ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC )
            {
                int16_t tcBufferSize;
                Word16 tcBufferSize;
                tcBufferSize = st_ivas->hSpatParamRendCom->num_slots * st_ivas->hSpatParamRendCom->slot_size;

                if ( st_ivas->hMasaIsmData->masa_gain_is_edited )
                IF ( st_ivas->hMasaIsmData->masa_gain_is_edited )
                {
                    for ( int16_t ch = 0; ch < 2; ch++ )
                    FOR ( Word16 ch = 0; ch < 2; ch++ )
                    {
                        v_multc( st_ivas->hTcBuffer->tc[ch], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc[ch], tcBufferSize );
                        //v_multc_fixed_16( st_ivas->hTcBuffer->tc_fx[ch], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc_fx[ch], tcBufferSize );
                        assert( 0 && "Insert actual basop code here!");
                    }
                }
            }
+1 −1
Original line number Diff line number Diff line
@@ -839,7 +839,7 @@ ivas_error ivas_masa_dec_open_fx(
    /* ISM metadata */
#ifdef OMASA_OBJECT_EDITING
    test();
    IF ( EQ_16(st_ivas->ivas_format, MASA_FORMAT) && NE_16(st_ivas->hIsmMetaData[0], NULL ) )
    IF ( EQ_16(st_ivas->ivas_format, MASA_FORMAT) && st_ivas->hIsmMetaData[0] == NULL )
#else
    test();
    test();
+13 −9
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ ivas_error ivas_omasa_dec_config_fx(
#ifdef OMASA_OBJECT_EDITING
        if ( st_ivas->hIsmMetaData[0] == NULL )
        {
            if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -662,7 +662,7 @@ ivas_error ivas_omasa_dec_config_fx(
        {
            for ( k = 0; k < st_ivas->nchan_ism; k++ )
            {
                ivas_ism_reset_metadata_handle_dec( st_ivas->hIsmMetaData[k] );
                ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] );
            }
        }
#else
@@ -1184,14 +1184,16 @@ void ivas_omasa_dirac_rend_jbm_fx(
        {
            Copy32( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered );
#ifdef OMASA_OBJECT_EDITING
            if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
            IF ( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) )
            {
                /* Gain separated object, if edited */
                for ( n = 0; n < st_ivas->nchan_ism; n++ )
                FOR ( n = 0; n < st_ivas->nchan_ism; n++ )
                {
                    if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && st_ivas->hMasaIsmData->idx_separated_ism == n )
                    test();
                    IF ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && EQ_16(st_ivas->hMasaIsmData->idx_separated_ism, n ) )
                    {
                        v_multc( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[0], *nSamplesRendered );
                        //v_multc( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[0], *nSamplesRendered );
                        assert ( 0 && "Insert proper basop code here!");
                    }
                }
            }
@@ -1205,9 +1207,10 @@ void ivas_omasa_dirac_rend_jbm_fx(
                Copy32( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered );
#ifdef OMASA_OBJECT_EDITING
                /* Gain discrete objects, if edited */
                if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
                IF ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] )
                {
                    v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered );
                    //v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered );
                    assert( 00 && "Insert proper basop code here!");
                }
#endif
            }
@@ -1217,7 +1220,8 @@ void ivas_omasa_dirac_rend_jbm_fx(
            {
                for ( int16_t ch = 0; ch < 2; ch++ )
                {
                    v_multc( output_f[ch], st_ivas->hMasaIsmData->gain_masa_edited, output_f[ch], *nSamplesRendered );
                    //v_multc( output_f[ch], st_ivas->hMasaIsmData->gain_masa_edited, output_f[ch], *nSamplesRendered );
                    assert( 00 && "Insert proper basop code here!");
                }
            }
#endif
Loading