Commit a6e5f3f3 authored by emerit's avatar emerit
Browse files

add error message on scaling factor

parent b9b3d3c3
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1795,11 +1795,32 @@ static ivas_error ivas_rend_initCrend_fx(
#endif
#ifdef FIX_CREND_CHANGES_AND_HRTF_FILE_FORMAT
    if ( hHrtf->factor_Q_latency_s_fx != 0 )
    {
        hHrtf->factor_Q_latency_s_fx = sub( hHrtf->factor_Q_latency_s_fx, 31 );
        if ( hHrtf->factor_Q_latency_s_fx < 0 )
        {
            hHrtf->factor_Q_latency_s_fx = 0;
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: factor_Q_latency_s_fx wrong value too small must be > 30 !\n\n" );
        }
    }
    if ( hHrtf->factor_Q_inv_diffuse_weight_fx != 0 )
    {
        hHrtf->factor_Q_inv_diffuse_weight_fx = sub( hHrtf->factor_Q_inv_diffuse_weight_fx, 15 );
        if ( hHrtf->factor_Q_inv_diffuse_weight_fx < 0 )
        {
            hHrtf->factor_Q_inv_diffuse_weight_fx = 0;
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: factor_Q_inv_diffuse_weight_fx wrong value too small must be > 14 !\n\n" );
        }
    }
    if ( hHrtf->factor_Q_pOut_to_bin_fx != 0 )
    {
        hHrtf->factor_Q_pOut_to_bin_fx = sub( 31, hHrtf->factor_Q_pOut_to_bin_fx );
        if ( hHrtf->factor_Q_pOut_to_bin_fx < 0 )
        {
            hHrtf->factor_Q_pOut_to_bin_fx = 0;
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: factor_Q_pOut_to_bin_fx wrong value too big must be < 32 !\n\n" );
        }
    }
#endif
    pCrend->hHrtfCrend = hHrtf;