Commit be30e10f authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Cleanup in initializations, lib_rend, JBM files

[x] Float dependencies clean up in lib_rend modules
[x] Float dependencies clean up in jbm_dec
[x] Cleanup of decoder initializations
[x] Macro additions for float code and fixed code
parent 9002d7d5
Loading
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
#include "vector3_pair_file_reader.h"
#include "wmc_auto.h"


#define WMC_TOOL_SKIP

/*------------------------------------------------------------------------------------------*
@@ -2538,6 +2537,10 @@ void getMetadataFromFileReader(
        fprintf( stderr, "\nError (%s) while reading ISM metadata from: %s\n\n", ivas_error_to_string( error ), IsmFileReader_getFilePath( ismReader ) );
        exit( -1 );
    }
#ifdef IVAS_FLOAT_FIXED
    objectMetadataBuffer->positions[objIdx].azimuth_fx = (Word32)(ismMetadata.azimuth * (1<<22));
    objectMetadataBuffer->positions[objIdx].elevation_fx = (Word32)(ismMetadata.elevation * (1 << 22));
#endif // DEBUG

    objectMetadataBuffer->positions[objIdx].azimuth = ismMetadata.azimuth;
    objectMetadataBuffer->positions[objIdx].elevation = ismMetadata.elevation;
@@ -2617,6 +2620,10 @@ static void IsmPositionProvider_getNextFrame(

        /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */
        objectMetadataBuffer->positions[objIdx].elevation = min( max( objectMetadataBuffer->positions[objIdx].elevation, -90 ), 90 );
#ifdef IVAS_FLOAT_FIXED
        objectMetadataBuffer->positions[objIdx].azimuth_fx = (Word32)(objectMetadataBuffer->positions[objIdx].azimuth * (1 << 22));
        objectMetadataBuffer->positions[objIdx].elevation_fx = (Word32)(objectMetadataBuffer->positions[objIdx].elevation * (1 << 22));
#endif // IVAS_FLOAT_FIXED
        /* Wrap yaw to lie within (-180, 180] range */
        while ( objectMetadataBuffer->positions[objIdx].yaw < 0.0f )
        {
@@ -2935,6 +2942,10 @@ static void parseObjectPosition(

    position->azimuth = meta_prm[0];
    position->elevation = meta_prm[1];
#ifdef IVAS_FLOAT_FIXED
    position->azimuth_fx = (Word32)(meta_prm[0] * (1 << 22));
    position->elevation_fx = (Word32)(meta_prm[1] * (1 << 22));
#endif // IVAS_FLOAT_FIXED
    position->radius = meta_prm[2];
    position->yaw = meta_prm[5];
    position->pitch = meta_prm[6];
+2 −2
Original line number Diff line number Diff line
@@ -368,8 +368,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed(
            }
            IF( st->hHQ_core )
            {
                st->hHQ_core->Q_old_out = Q_factor_arr( st->hHQ_core->old_out, L_FRAME48k );
                st->hHQ_core->Q_old_outLB = Q_factor_arr( st->hHQ_core->old_outLB, L_FRAME32k );
                //st->hHQ_core->Q_old_out = Q_factor_arr( st->hHQ_core->old_out, L_FRAME48k );
                //st->hHQ_core->Q_old_outLB = Q_factor_arr( st->hHQ_core->old_outLB, L_FRAME32k );
				st->hHQ_core->Q_fer_samples = 0;
                //floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k );
                //floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k );
+19 −1
Original line number Diff line number Diff line
@@ -280,6 +280,15 @@ void ivas_syn_output_f(
    float *synth_out                                            /* o  : integer 16 bits synthesis signal        */
);

#ifdef IVAS_FLOAT_FIXED
void ivas_syn_output_f_fx(
    Word32 *synth[],             /* i/o: float synthesis signal              */
    const Word16 output_frame, /* i  : output frame length (one channel)   */
    const Word16 n_channels,   /* i  : number of output channels           */
    Word32 *synth_out            /* o  : integer 16 bits synthesis signal    */
);
#endif

void ivas_initialize_handles_enc(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
@@ -881,12 +890,14 @@ void TonalMdctConceal_whiten_noise_shape_ivas(
    const TONALMDCTCONC_NOISE_SHAPE_WHITENING_MODE
);

#ifndef IVAS_FLOAT_FIXED
/*! r: IGF start line */
int16_t get_igf_startline_flt(
    Decoder_State *st,                                          /* i  : decoder state                           */
    const int16_t L_frame,                                      /* i  : length of the frame                     */
    const int16_t L_frameTCX                                    /* i  : full band frame length                  */
);
#endif

float rand_triangular_signed(
    int16_t *seed );
@@ -918,10 +929,17 @@ void ivas_apply_non_diegetic_panning(
 * JBM prototypes
 *----------------------------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_jbm_dec_tc_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    Word32 *data_fx
);
#else
ivas_error ivas_jbm_dec_tc(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    float *data                                                /* o  : output synthesis signals                                    */
);
#endif

ivas_error ivas_jbm_dec_render(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
+2 −2
Original line number Diff line number Diff line
@@ -2111,8 +2111,8 @@ void ivas_dirac_dec_render_sf_fx(
    Word32 *output_fx[],           /* i/o: synthesized core-coder transport channels/DirAC output  */
#endif // MSAN_FIX
    const int16_t nchan_transport,                              /* i  : number of transport channels            */
    float *pppQMfFrame_ts_re[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX],
    float *pppQMfFrame_ts_im[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX]
    Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX]
);

void ivas_dirac_dec_render_fx(
+26 −0
Original line number Diff line number Diff line
@@ -215,6 +215,32 @@ void ivas_syn_output_f(
    return;
}

#ifdef IVAS_FLOAT_FIXED
void ivas_syn_output_f_fx(
    Word32 *synth[],             /* i/o: float synthesis signal              */
    const Word16 output_frame, /* i  : output frame length (one channel)   */
    const Word16 n_channels,   /* i  : number of output channels           */
    Word32 *synth_out            /* o  : integer 16 bits synthesis signal    */
)
{
    Word16 i, n;

    /*-----------------------------------------------------------------*
     * float to integer conversion with saturation control
     *-----------------------------------------------------------------*/

    FOR ( n = 0; n < n_channels; n++ )
    {
        FOR ( i = 0; i < output_frame; i++ )
        {
            synth_out[i * n_channels + n] = synth[n][i];
        }
    }

    return;
}

#endif

/*-------------------------------------------------------------------*
 * mvr2r_inc()
Loading