Commit bc3d26f9 authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch '2123_ref_compilation_errors_for_split_rendering_with_debugging'...

Merge branch '2123_ref_compilation_errors_for_split_rendering_with_debugging' into 'ivas-float-update'

port MR 2252 from float - compilation errors for split rendering with DEBUGGING active

See merge request !2447
parents 877556f2 8a8a7bc7
Loading
Loading
Loading
Loading
+0 −61
Original line number Diff line number Diff line
@@ -130,7 +130,6 @@ typedef struct
    bool tsmEnabled;
    IVAS_RENDER_FRAMESIZE renderFramesize;
#ifdef DEBUGGING
    IVAS_DEC_FORCED_REND_MODE forcedRendMode;
#ifdef DEBUG_FOA_AGC
    FILE *agcBitstream; /* temporary */
#endif
@@ -183,7 +182,6 @@ static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary
#ifdef DEBUGGING
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
static int16_t app_own_random( int16_t *seed );
static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar );
#endif
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader );

@@ -540,28 +538,6 @@ int main(
#endif
    }

    /*------------------------------------------------------------------------------------------*
     * Binaural rendering mode: set and print info
     *------------------------------------------------------------------------------------------*/

    if ( arg.forcedRendMode != IVAS_DEC_FORCE_REND_UNFORCED )
    {
        if ( ( error = IVAS_DEC_SetForcedRendMode( hIvasDec, arg.forcedRendMode ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Forcing binaural rendering mode failed (only TDREND and CLDFBREND are expected).\n\n" );
            goto cleanup;
        }

        if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_TD_RENDERER )
        {
            fprintf( stdout, "Forcing rendering to:   TD renderer\n" );
        }
        else if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_CLDFB_RENDERER )
        {
            fprintf( stdout, "Forcing rendering to:   CLDFB renderer\n" );
        }
    }

    /*-----------------------------------------------------------------*
     * Open Error pattern file for simulation
     *-----------------------------------------------------------------*/
@@ -970,7 +946,6 @@ static bool parseCmdlIVAS_dec(
#ifdef DEBUGGING
    float ftmp;

    arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED;
#ifdef DEBUG_FOA_AGC
    arg->agcBitstream = NULL;
#endif
@@ -1140,17 +1115,6 @@ static bool parseCmdlIVAS_dec(
            }
            i += 2;
        }
        else if ( strcmp( argv_to_upper, "-FORCE" ) == 0 )
        {
            i++;
            if ( i < argc - 3 )
            {
                strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 );
                argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
                arg->forcedRendMode = parseForcedRendModeDec( argv_to_upper );
                i++;
            }
        }
#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
        /* Define additional subfolder for debug info output in ./res */
@@ -3967,31 +3931,6 @@ static void do_object_editing(
    return;
}

#ifdef DEBUGGING

/*---------------------------------------------------------------------*
 * parseForcedRendModeDec()
 *
 *
 *---------------------------------------------------------------------*/

static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec(
    char *forcedRendModeChar )
{
    if ( ( strcmp( to_upper( forcedRendModeChar ), "TDREND" ) == 0 ) )
    {
        return IVAS_DEC_FORCE_REND_TD_RENDERER;
    }
    if ( ( strcmp( to_upper( forcedRendModeChar ), "CLDFBREND" ) == 0 ) )
    {
        return IVAS_DEC_FORCE_REND_CLDFB_RENDERER;
    }

    return IVAS_DEC_FORCE_REND_UNDEFINED;
}

#endif


/*---------------------------------------------------------------------*
 * load_hrtf_from_file()
+0 −13
Original line number Diff line number Diff line
@@ -1167,8 +1167,6 @@ ivas_error ivas_init_decoder_front(

#ifdef DEBUGGING
    st_ivas->noClipping = 0;

    st_ivas->hDecoderConfig->force_rend = -1;
#endif
    /*-------------------------------------------------------------------*
     * Allocate and initialize Custom loudspeaker layout handle
@@ -3226,17 +3224,6 @@ static ivas_error doSanityChecks_IVAS(
    {
        return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED, "Wrong set-up: Only object editing or Non-diegetic panning can be used." );
    }
#ifdef DEBUGGING
    if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) )
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" );
    }

    if ( ( st_ivas->hHrtfTD != NULL && st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) )
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_FORCE_MODE, "Incorrect debug configuration: Cannot force CLDFB renderer in combination with TD renderer HRTF file" );
    }
#endif

    return IVAS_ERR_OK;
}
+0 −17
Original line number Diff line number Diff line
@@ -95,21 +95,8 @@ void ivas_renderer_select(
            {
                if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
                {
#ifdef DEBUGGING
                    if ( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER )
                    {
                        *renderer_type = RENDERER_BINAURAL_FASTCONV;
                        *internal_config = IVAS_AUDIO_CONFIG_HOA3; /* Render ISM to HOA3 before binauralization*/
                    }
                    else
                    {
                        *renderer_type = RENDERER_BINAURAL_OBJECTS_TD;
                        *internal_config = output_config;
                    }
#else
                    *renderer_type = RENDERER_BINAURAL_OBJECTS_TD;
                    *internal_config = output_config;
#endif
                }
                else
                {
@@ -198,11 +185,7 @@ void ivas_renderer_select(

                if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
                {
#ifdef DEBUGGING
                    if ( ( ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && st_ivas->mc_mode == MC_MODE_MCT && st_ivas->hDecoderConfig->force_rend != FORCE_CLDFB_RENDERER )
#else
                    if ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && st_ivas->mc_mode == MC_MODE_MCT )
#endif
                    {
                        *renderer_type = RENDERER_BINAURAL_OBJECTS_TD;
                    }
+1 −5
Original line number Diff line number Diff line
@@ -1031,10 +1031,6 @@ typedef struct decoder_config_structure
    int16_t Opt_dpid_on;                         /* indicates whether Directivity pattern option is used */
    int16_t Opt_aeid_on;                         /* indicates whether Acoustic environment option is used */
    int16_t Opt_ObjEdit_on;                      /* indicates whether object editing option is used */
#ifdef DEBUGGING
    /* temp. development parameters */
    int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */
#endif
    int16_t Opt_tsm;                             /* indicates whether time scaling modification is activated */
    IVAS_RENDER_FRAMESIZE render_framesize;
    int16_t Opt_delay_comp; /* flag indicating delay compensation active */
+0 −59
Original line number Diff line number Diff line
@@ -4829,65 +4829,6 @@ int32_t IVAS_DEC_GetCntFramesLimited(
    }
}


/*---------------------------------------------------------------------*
 * forcedRendModeApiToInternalDec()
 *
 *
 *---------------------------------------------------------------------*/

static ivas_error forcedRendModeApiToInternalDec(
    const IVAS_DEC_FORCED_REND_MODE forcedRendMode,
    int16_t *forcedModeInternal )
{
    switch ( forcedRendMode )
    {
        case IVAS_DEC_FORCE_REND_TD_RENDERER:
            *forcedModeInternal = FORCE_TD_RENDERER;
            break;
        case IVAS_DEC_FORCE_REND_CLDFB_RENDERER:
            *forcedModeInternal = FORCE_CLDFB_RENDERER;
            break;
        case IVAS_DEC_FORCE_REND_UNFORCED:
            *forcedModeInternal = -1;
            break;
        default:
            return IVAS_ERR_INVALID_FORCE_MODE;
            break;
    }

    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_SetForcedRendMode()
 *
 *
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_SetForcedRendMode(
    IVAS_DEC_HANDLE hIvasDec,                      /* i/o: IVAS decoder handle   */
    const IVAS_DEC_FORCED_REND_MODE forcedRendMode /* i  : forced renderer mode  */
)
{
    int16_t newForcedRend;
    ivas_error error;

    if ( ( error = forcedRendModeApiToInternalDec( forcedRendMode, &newForcedRend ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    if ( hIvasDec->st_ivas->hDecoderConfig->force_rend != newForcedRend )
    {
        hIvasDec->st_ivas->hDecoderConfig->force_rend = newForcedRend;
    }

    return IVAS_ERR_OK;
}


#ifdef DEBUG_SBA_AUDIO_DUMP
/*---------------------------------------------------------------------*
 * IVAS_DEC_GetSbaDebugParams( )
Loading