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

Integration of fixed point sub-functions 13.

[x] ivas_ism_dec_digest_tc fixed point changes.
[x] Add changes related to conversion of ivas_param_ism_params_to_masa_param_mapping.
[x] ivas_mdct_core_reconstruct function fixed point changes.
[x] Intermediate float-to-fixed and fixed-to-float conversions cleanup.
[x] Add integeration changes for subfunctions of ivas_init_decoder.
[x] Added changes to commonize structs in orient_trk.
[x] Shoebox functions in fixed point
[x] Fix for issues #712 and #713
[x] Fix added for crashes observed in renderer pytest.
parent 37b2a8f8
Loading
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -132,31 +132,22 @@ typedef struct _IVAS_ISM_METADATA
typedef struct
{
    float w, x, y, z;

} IVAS_QUATERNION;

#ifdef IVAS_FLOAT_FIXED
typedef struct
{
    Word32 w_fx, x_fx, y_fx, z_fx;
    Word16 w_qfact, x_qfact, y_qfact, z_qfact;
} IVAS_QUATERNION_FX;
#endif

typedef struct
{
    float x, y, z;
} IVAS_QUATERNION;

} IVAS_VECTOR3;

#ifdef IVAS_FLOAT_FIXED
typedef struct
{
    float x, y, z;
#ifdef IVAS_FLOAT_FIXED
    Word32 x_fx, y_fx, z_fx;
    Word16 x_qfact, y_qfact, z_qfact;

} IVAS_VECTOR3_FX;
#endif
} IVAS_VECTOR3;

typedef enum
{
@@ -241,6 +232,9 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
    IVAS_VECTOR3 dimensions;             /* Room dimensions [m]     */
    float AbsCoeff[IVAS_ROOM_ABS_COEFF]; /* Absorption coeffs       */
    IVAS_VECTOR3 ListenerOrigin;         /* Listener origin         */
#ifdef IVAS_FLOAT_FIXED
    int32_t AbsCoeff_fx[IVAS_ROOM_ABS_COEFF]; /* Absorption coeffs       */
#endif

} IVAS_ROOM_ACOUSTICS_CONFIG_DATA;

+4 −0
Original line number Diff line number Diff line
@@ -707,6 +707,7 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed(
                fixedToFloat_arr( st->hTcxDec->syn_OverlFB, st->hTcxDec->syn_OverlFB_float, st->hTcxDec->Q_syn_OverlFB, 480 );
                fixedToFloat_arr( st->hTcxDec->old_synth, st->hTcxDec->old_synth_float, Q_old_synth, OLD_SYNTH_INTERNAL_DEC );
                fixedToFloat_arr( st->hTcxDec->synth_history_fx, st->hTcxDec->synth_history, Q_synth_history, L_PROT48k + L_FRAME_MAX );
                st->hTcxDec->q_synth_history_fx = Q_synth_history;
                fixedToFloat_arr( st->hTcxDec->ltpGainMemory_fx, st->hTcxDec->ltpGainMemory, 15, N_LTP_GAIN_MEMS );
                st->hTcxDec->tcxltp_second_last_pitch_float = fixedToFloat( st->hTcxDec->tcxltp_second_last_pitch, 16 );
                st->hTcxDec->tcxltp_third_last_pitch_float = fixedToFloat( st->hTcxDec->tcxltp_third_last_pitch, 16 );
@@ -1409,6 +1410,7 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2(
                fixedToFloat_arr( st->hTcxDec->syn_OverlFB, st->hTcxDec->syn_OverlFB_float, st->hTcxDec->Q_syn_OverlFB, 480 );
                fixedToFloat_arr( st->hTcxDec->old_synth, st->hTcxDec->old_synth_float, Q_old_synth, OLD_SYNTH_INTERNAL_DEC );
                fixedToFloat_arr( st->hTcxDec->synth_history_fx, st->hTcxDec->synth_history, Q_synth_history, L_PROT48k + L_FRAME_MAX );
                st->hTcxDec->q_synth_history_fx = Q_synth_history;
                fixedToFloat_arr( st->hTcxDec->ltpGainMemory_fx, st->hTcxDec->ltpGainMemory, 15, N_LTP_GAIN_MEMS );
                st->hTcxDec->tcxltp_second_last_pitch_float = fixedToFloat( st->hTcxDec->tcxltp_second_last_pitch, 16 );
                st->hTcxDec->tcxltp_third_last_pitch_float = fixedToFloat( st->hTcxDec->tcxltp_third_last_pitch, 16 );
@@ -1971,6 +1973,8 @@ void fixed_to_float_stereo_tcx_core_dec(

    fixedToFloat_arr( hTcxDec->old_synth, hTcxDec->old_synth_float, 0, hTcxDec->old_synth_len );
    fixedToFloat_arr( hTcxDec->synth_history_fx, hTcxDec->synth_history, 0, NS2SA_fx2( st->output_Fs, PH_ECU_MEM_NS ) );
    st->hTcxDec->q_synth_history_fx = 0;

    fixedToFloat_arr( hTcxDec->old_synthFB_fx, hTcxDec->old_synthFB, 0, NS2SA_fx2( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) + hTcxDec->old_synth_lenFB );
    fixedToFloat_arr( st->old_lsp_q_cng, st->old_lsp_q_cng_float, Q15, M );
    fixedToFloat_arr( st->lsp_old_fx, st->lsp_old, Q15, M );
+8 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
#define _180_OVER_PI                            ( 180.0f / EVS_PI )
#ifdef IVAS_FLOAT_FIXED
#define _180_OVER_PI_Q25                         1922527233
#define _180_OVER_PI_FX                          (Word32) (( 180.0f / EVS_PI ) *ONE_IN_Q10)
#define PI_OVER_4_Q29                            421657440
#define PI_OVER_Q29                              1686629760
#define Q31_0_99                                 2126008811
@@ -368,6 +369,8 @@ typedef enum
#define STEP_PARAM_ISM_POW_RATIO_NBITS_Q15      (4681)  /* 1.0f / (float)((1 << PARAM_ISM_POW_RATIO_NBITS) - 1) */

/* ISM DTX */
#define ISM_Q_STEP_FX                           10485760
#define ISM_Q_STEP_BORDER_FX                    20971520
#define ISM_DTX_COH_SCA_BITS                    4
#define ISM_DTX_AZI_BITS_HIGH                   8
#define ISM_DTX_ELE_BITS_HIGH                   7
@@ -1798,10 +1801,14 @@ typedef enum
#define ER_LIST_ORIGIN_Y                        (0.0f)
#define ER_LIST_HEIGHT                          (1.6f)
#ifdef IVAS_FLOAT_FIXED
#define ER_LIST_HEIGHT_FX                          26214
#define ER_RADIUS_FX                           (1* ONE_IN_Q30) //Q2.30
#define ER_LIST_ORIGIN_X_FX                    (0)
#define ER_LIST_ORIGIN_Y_FX                    (0)
#define ER_LIST_HEIGHT_FX                      (1.6 *ONE_IN_Q22) //Q.22
#endif // IVAS_FLOAT_FIXED



/*----------------------------------------------------------------------------------*
 * Stereo downmix EVS constants
 *----------------------------------------------------------------------------------*/
+8 −0
Original line number Diff line number Diff line
@@ -1212,6 +1212,11 @@ void ivas_param_ism_dec(
    float *output_f[]                                           /* i/o: synthesized core-coder transport channels/DirAC output  */
);

#ifdef IVAS_FLOAT_FIXED
void ivas_ism_dec_digest_tc_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
);
#endif
void ivas_ism_dec_digest_tc(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
);
@@ -1246,6 +1251,9 @@ void ivas_param_ism_dec_render_fx(
    float *output_f[],                                           /* o  : rendered time signal                        */
    Word32 *output_f_fx[]
);
void ivas_param_ism_params_to_masa_param_mapping_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
);
#endif

void ivas_param_ism_params_to_masa_param_mapping(
+3 −3
Original line number Diff line number Diff line
@@ -1934,12 +1934,12 @@ void TDREND_MIX_LIST_SetPos_fx(
ivas_error TDREND_Update_listener_orientation_fx(
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle           */
    const Word16 headRotEnabled,                       /* i  : Headrotation flag            */
    const IVAS_QUATERNION_FX *headPosition_fx,         /* i  : Listener orientation         */
    const IVAS_VECTOR3_FX *Pos_fx                     /* i  : Listener Position            */
    const IVAS_QUATERNION *headPosition_fx,         /* i  : Listener orientation         */
    const IVAS_VECTOR3 *Pos_fx                     /* i  : Listener Position            */
);

void QuatToRotMat_fx(
    const IVAS_QUATERNION_FX quat, /* i  : quaternion describing the rotation            Qx      */
    const IVAS_QUATERNION quat, /* i  : quaternion describing the rotation            Qx      */
    Word32 Rmat[3][3]              /* o  : real-space rotation matrix for this rotation  2*Qx-32 */
);

Loading