Commit 06323c42 authored by vaclav's avatar vaclav
Browse files

fix formal issues

parent 9d077975
Loading
Loading
Loading
Loading
Loading
+17 −29
Original line number Diff line number Diff line
@@ -54,11 +54,6 @@
#include "debug.h"
#endif
#include "wmc_auto.h"
#ifdef OBJ_EDITING_API
#ifdef OBJ_EDITING_EXAMPLE
#include <math.h>
#endif
#endif


#define WMC_TOOL_SKIP
@@ -1101,10 +1096,8 @@ static bool parseCmdlIVAS_dec(

#ifdef OBJ_EDITING_EXAMPLE
    arg->objEditEnabled = false;
#endif
#


#endif
    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -1557,7 +1550,6 @@ static bool parseCmdlIVAS_dec(

            i += tmp;
        }

#ifdef OBJ_EDITING_EXAMPLE
        else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 )
        {
@@ -2140,10 +2132,6 @@ static ivas_error decodeG192(
        return error;
    }

#ifdef OBJ_EDITING_API
    IVAS_EDITABLE_PARAMETERS editableParameters;
#endif

    IVAS_RENDER_CONFIG_DATA renderConfig;
    RenderConfigReader *renderConfigReader = NULL;

@@ -2445,23 +2433,23 @@ static ivas_error decodeG192(
                }
#endif
                /* Feed into decoder */
                if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi
#ifdef OBJ_EDITING_API
                                                          ,
                                                          isSplitRend,
                                                          splitRendBits
                if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK )
#endif
                                                          ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

#ifdef OBJ_EDITING_API
#ifdef OBJ_EDITING_EXAMPLE
                /* Do object info editing */
                if ( arg.objEditEnabled )
                {
                    IVAS_EDITABLE_PARAMETERS editableParameters;

                    /* Do object info editing here */
                    /* get object parameters */
                    if ( ( error = IVAS_DEC_GetEditableParameters( hIvasDec, &editableParameters ) ) != IVAS_ERR_OK )
                    {
@@ -2484,6 +2472,7 @@ static ivas_error decodeG192(
                            num_nondiegetic_objects++;
                        }
                    }

                    if ( num_nondiegetic_objects )
                    {
                        float start_angle, angle_inc;
@@ -2515,6 +2504,7 @@ static ivas_error decodeG192(
                        goto cleanup;
                    }
                }

#endif
                /* Do the final preparations needed for rendering */
                if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK )
@@ -3362,26 +3352,24 @@ static ivas_error decodeVoIP(
        while ( nSamplesRendered < nOutSamples )
        {
#endif

#ifdef SUPPORT_JBM_TRACEFILE
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter
#ifdef OBJ_EDITING_API
                                                     ,
                                                     &nSamplesRendered, &parameterAvailableForEditing
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &nSamplesRendered, &parameterAvailableForEditing ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter ) ) != IVAS_ERR_OK )
#endif
                                                     ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, &parameterAvailableForEditing
#ifdef OBJ_EDITING_API
                                                                                                                                                   & nSamplesRendered,
                                                 &parameterAvailableForEditing
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, &parameterAvailableForEditing & nSamplesRendered, &parameterAvailableForEditing ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, &parameterAvailableForEditing ) ) != IVAS_ERR_OK )
#endif
                                                 ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }

#ifdef OBJ_EDITING_API
            if ( parameterAvailableForEditing == true )
            {
+1 −0
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ typedef struct _IVAS_EDITABLE_PARAMETERS
    int16_t num_obj;
    IVAS_ISM_METADATA ism_metadata[IVAS_MAX_NUM_OBJECTS];
    float gain_bed;

} IVAS_EDITABLE_PARAMETERS;
#endif

+17 −3
Original line number Diff line number Diff line
@@ -1105,7 +1105,7 @@ void ivas_param_ism_dec_digest_tc(

#ifdef OBJ_EDITING_API
void ivas_param_ism_dec_dequant_md(
    Decoder_Struct *st_ivas 
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder handle                         */
);

void ivas_param_ism_dec_prepare_renderer(
@@ -5622,6 +5622,18 @@ ivas_error ivas_osba_render_sf(
    float *output_f[]                                           /* o  : rendered time signal                    */
);

#ifdef OBJ_EDITING_API
void ivas_osba_stereo_add_channels(
    float *tc_f[],                                              /* i  : transport channels                      */
    float *output_f[],                                          /* i/o: output channels                         */
    const float gain,                                           /* i  : gain bed value                          */
    const int16_t nchan_out,                                    /* i  : number of output channels               */
    const int16_t nchan_ism,                                    /* i  : number of ISM channels                  */
    const int16_t ism_mode,                                     /* i  : ISM mode                                */
    const int16_t n_samples_to_render                           /* i  : output frame length per channel         */
);
#endif

void ivas_osba_data_close(
    SBA_ISM_DATA_HANDLE *hSbaIsmData                            /* i/o: OSBA rendering handle                   */
);
@@ -5630,6 +5642,8 @@ ISM_MODE ivas_osba_ism_mode_select(
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate      */
    const int16_t nchan_ism                                     /* i  : number of input ISM's   */
);


/*----------------------------------------------------------------------------------*
* OMASA prototypes
*---------------------------------------------------------------------------------*/
+2 −0
Original line number Diff line number Diff line
@@ -177,9 +177,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
        {
            /* close the parametric binaural renderer */
            ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin );

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

#endif
            /* Open the TD Binaural renderer */
            if ( st_ivas->hHrtfTD == NULL || st_ivas->hBinRendererTd == NULL )
+8 −7
Original line number Diff line number Diff line
@@ -860,8 +860,8 @@ void ivas_param_ism_dec_digest_tc(
        nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe;
        nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE;
    }
#endif

#endif
    push_wmops( "ivas_param_ism_dec_digest_tc" );

#ifndef OBJ_EDITING_API
@@ -939,8 +939,8 @@ void ivas_param_ism_dec_digest_tc(
            }
        }
    }
#endif

#endif
    if ( st_ivas->hDecoderConfig->Opt_tsm )
    {
        /*TODO : FhG to check*/
@@ -954,7 +954,6 @@ void ivas_param_ism_dec_digest_tc(
        {
            if ( st_ivas->hDecoderConfig->Opt_tsm )
            {

                float RealBuffer[CLDFB_NO_CHANNELS_MAX];
                float ImagBuffer[CLDFB_NO_CHANNELS_MAX];

@@ -962,8 +961,8 @@ void ivas_param_ism_dec_digest_tc(
                mvr2r( RealBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands );
                mvr2r( ImagBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands );
            }

#ifndef OBJ_EDITING_API

            ivas_param_ism_collect_slot( hParamIsmDec, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], ch, ref_power, cx_diag );
#endif
        }
@@ -988,13 +987,14 @@ void ivas_param_ism_dec_digest_tc(

#ifdef OBJ_EDITING_API
/*-------------------------------------------------------------------------*
 * ivas_param_ism_dec_prepare_renderer()
 * ivas_param_ism_dec_dequant_md()
 *
 *
 *-------------------------------------------------------------------------*/

void ivas_param_ism_dec_dequant_md(
    Decoder_Struct *st_ivas )
    Decoder_Struct *st_ivas /* i/o: IVAS decoder handle     */
)
{
    /* De-quantization */
    if ( !( st_ivas->hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 || st_ivas->hDecoderConfig->ivas_total_brate == FRAME_NO_DATA ) )
@@ -1460,8 +1460,8 @@ void ivas_param_ism_params_to_masa_param_mapping(
    {
        st_ivas->hISMDTX.dtx_flag = 1;
    }
#endif

#endif
    if ( st_ivas->hISMDTX.dtx_flag )
    {
        float energy_ratio;
@@ -1534,6 +1534,7 @@ void ivas_param_ism_params_to_masa_param_mapping(
                hSpatParamRendCom->surroundingCoherence[sf_idx][bin_idx] = 0.0;
            }
        }

#ifdef OBJ_EDITING_PARAMISM_BIN
        for ( obj = 0; obj < st_ivas->nchan_ism; obj++ )
        {
Loading