Commit 323bfc69 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix for Q mismatch in param ISM dmx computation

parent 06072653
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@
#define FIX_BASOP_2529_MASA_RATIO_SCALINGS              /* Nokia: BASOP issue 2529: Fix MASA ratio scalings and verifications */
#define FIX_BASOP_2531_MCT_CP_BITRATE                   /* FhG: BASOP issue 2531: Fix MCT cp_bitrate calculation; affects bitrate switching only */
#define FIX_BASOP_2541_OMASA_ENC_FIXES                  /* Nokia: BASOP issue 2541: Fix function ivas_encode_masaism_metadata_fx */
#define FIX_BASOP_2544_Q_MISMATCH_PARAM_ISM_DMX         /* FhG: BASOP issue 2544: fix q format mismatch in downmix creation for param ISM */

/* ##################### End NON-BE switches ########################### */

+15 −0
Original line number Diff line number Diff line
@@ -229,6 +229,11 @@ static void ivas_param_ism_enc_quantize_DOA_fx(
}


#ifdef FIX_BASOP_2544_Q_MISMATCH_PARAM_ISM_DMX
#define ALPHA_PARAM_ISM_DMX_Q30           ONE_IN_Q29 /* 0.5 in Q30 */
#define ONE_MINUS_ALPHA_PARAM_ISM_DMX_Q14 ONE_IN_Q13 /* 0.5 in Q14 */
#endif

/*-------------------------------------------------------------------------*
 * ivas_param_ism_stereo_dmx()
 *
@@ -242,7 +247,11 @@ void ivas_param_ism_stereo_dmx_fx(
{
    Word16 i, j;
    Word32 tmp;
#ifdef FIX_BASOP_2544_Q_MISMATCH_PARAM_ISM_DMX
    Word16 azi_shift;
#else
    Word16 alpha, azi_shift;
#endif
    Word16 tmp_1, tmp_2, one_by_input_frame;
    Word16 cardioid_left[MAX_NUM_OBJECTS], cardioid_right[MAX_NUM_OBJECTS]; // Q14
    Word32 stereo_dmx[2][L_FRAME48k];
@@ -256,7 +265,9 @@ void ivas_param_ism_stereo_dmx_fx(
    push_wmops( "ivas_param_ism_st_dmx" );

    /*Initialization*/
#ifndef FIX_BASOP_2544_Q_MISMATCH_PARAM_ISM_DMX
    alpha = ONE_IN_Q14 /* 0.5 in Q15 */;
#endif
    move16();
    azi_shift = 0; // Q13
    move16();
@@ -292,7 +303,11 @@ void ivas_param_ism_stereo_dmx_fx(
        {
            tmp = L_add( tmp, 2 * EVS_PI_FX );
        }
#ifdef FIX_BASOP_2544_Q_MISMATCH_PARAM_ISM_DMX
        cardioid_left[i] = mac_r( ALPHA_PARAM_ISM_DMX_Q30, ONE_MINUS_ALPHA_PARAM_ISM_DMX_Q14, getCosWord16( extract_l( tmp ) ) ); // Q14
#else
        cardioid_left[i] = mac_r( L_mult( alpha, 16384 ), sub( ONE_IN_Q15 - 1, alpha ), getCosWord16( extract_l( tmp ) ) ); // Q14
#endif
        move16();

        IF( st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame > 0 )