Commit b029ee8c authored by emerit's avatar emerit
Browse files

fix renderer 7.1 &nd 5.1 binaural crash

parent 57efa442
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -155,6 +155,9 @@ typedef struct
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    int8_t orientation_tracking;
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    int16_t Opt_Headrotation;
#endif
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
    IVAS_REND_COMPLEXITY_LEVEL complexityLevel;
@@ -826,7 +829,7 @@ int main(
    Word32 nonDiegeticPanGain_fx = ( args.nonDiegeticPanGain == 1.0f ) ? ONE_IN_Q31 : ( args.nonDiegeticPanGain == -1.0f ) ? L_negate( ONE_IN_Q31 )
                                                                                                                           : (Word32) ( args.nonDiegeticPanGain * ( 1LL << Q31 ) );
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, args.Opt_Headrotation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#endif
@@ -2334,6 +2337,9 @@ static CmdlnArgs defaultArgs(
    clearString( args.renderConfigFilePath );
    clearString( args.externalOrientationFilePath );

#ifdef FIX_POINT_HRTF_FILE_FORMAT
    args.Opt_Headrotation = 0;
#endif
    args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;
    args.nonDiegeticPan = 0;
    args.nonDiegeticPanGain = 0.f;
@@ -2418,6 +2424,9 @@ static void parseOption(
            break;
        case CmdLnOptionId_trajFile:
            assert( numOptionValues == 1 );
#ifdef FIX_POINT_HRTF_FILE_FORMAT
            args->Opt_Headrotation = 1;
#endif
            strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_referenceVectorFile:
+21 −0
Original line number Diff line number Diff line
@@ -2965,6 +2965,9 @@ ivas_error IVAS_REND_Open(
#endif
    const Word16 nonDiegeticPan,
    const Word32 nonDiegeticPanGain, /* Q31 */
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    const Word16 Opt_Headrotation, /* i  : indicates whether head-rotation is used             */
#endif
    const Word16 num_subframes )
{
    Word16 i;
@@ -3015,11 +3018,23 @@ ivas_error IVAS_REND_Open(
    }

    /* Initialize headrotation data */
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    hIvasRend->headRotData.headRotEnabled = 0;
    if ( Opt_Headrotation )
    {
        IF( NE_32( ( error = initHeadRotation_fx( hIvasRend ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
    }
#else
    IF( NE_32( ( error = initHeadRotation_fx( hIvasRend ) ), IVAS_ERR_OK ) )
    {
        return error;
    }

#endif

    /* Initialize external orientation data */
    IF( NE_32( ( error = ivas_external_orientation_open( &( hIvasRend->hExternalOrientationData ), num_subframes ) ), IVAS_ERR_OK ) )
    {
@@ -4518,6 +4533,12 @@ ivas_error IVAS_REND_SetOrientationTrackingMode(
    const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i  : Head orientation tracking type */
)
{
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    if ( hIvasRend->headRotData.headRotEnabled == 0 )
    {
        return IVAS_ERR_OK;
    }
#endif
    return ivas_orient_trk_SetTrackingType_fx( hIvasRend->headRotData.hOrientationTracker, orientation_tracking );
}

+3 −0
Original line number Diff line number Diff line
@@ -114,6 +114,9 @@ ivas_error IVAS_REND_Open(
#endif
	const Word16 nonDiegeticPan,                    /* i  : non-diegetic object flag                            */
	const Word32 nonDiegeticPanGain,                  /* i  : non-diegetic panning gain                           */
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    const Word16 Opt_Headrotation,        /* i  : indicates whether head-rotation is used             */
#endif
	const Word16 num_subframes                      /* i  : number of subframes                                 */
);