Commit 8e696bae authored by Christoph Hold's avatar Christoph Hold
Browse files

Fix 249 - Compilation Error with DEBUG_MODE_DIRAC

parent 42e71295
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1859,7 +1859,7 @@ void ivas_dirac_dec(
    {
        int16_t n, tmp[IVAS_SPAR_MAX_CH * L_FRAME48k];
        char file_name[50] = { 0 };
        const int16_t output_frame = st_ivas->->hDecoderConfig->output_Fs / FRAMES_PER_SEC;
        const int16_t output_frame = st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC;

        for ( n = 0; n < nchan_transport; n++ )
        {
@@ -2156,7 +2156,7 @@ void ivas_dirac_dec(
                hDirAC->dirac_estimator_idx = ( hDirAC->dirac_estimator_idx + 1 ) % hDirAC->dirac_md_buffer_length;
            }

#if DEBUG_MODE_DIRAC
#ifdef DEBUG_MODE_DIRAC
            {
                static FILE *fp_direction_vector = NULL, *fp_diffuseness = NULL, *fp_referencePower = NULL;

+0 −42
Original line number Diff line number Diff line
@@ -954,45 +954,3 @@ ivas_error ivas_sba_dec_reconfigure(

    return error;
}


#ifdef DEBUG_MODE_DIRAC
/*-----------------------------------------------------------------------*
 * Debugging function
 *-----------------------------------------------------------------------*/

static void debug_mode_dirac(
    float output[MAX_OUTPUT_CHANNELS][L_FRAME48k],
    const int16_t nchan_transport,
    const int16_t output_frame )
{
    int16_t i, n;
    int16_t tmp[L_FRAME48k];
    char file_name[50] = { 0 };

#ifdef DEBUG_MODE_DIRAC_NOCORE
    for ( n = 0; n < nchan_transport; n++ )
    {
        sprintf( file_name, "./res/ivas_dirac_enc_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) );
        dbgread( tmp, sizeof( int16_t ), output_frame, file_name );
        for ( i = 0; i < output_frame; i++ )
        {
            output[n][i] = (float) ( tmp[i] );
        }
    }
#else
    for ( n = 0; n < nchan_transport; n++ )
    {
        for ( i = 0; i < output_frame; i++ )
        {
            tmp[i] = (int16_t) ( output[n][i] + 0.5f );
        }

        sprintf( file_name, "./res/ivas_dirac_dec_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) );
        dbgwrite( tmp, sizeof( int16_t ), output_frame, 1, file_name );
    }
#endif

    return;
}
#endif
+41 −0
Original line number Diff line number Diff line
@@ -757,3 +757,44 @@ void ivas_sba_prototype_renderer(

    return;
}

#ifdef DEBUG_MODE_DIRAC
/*-----------------------------------------------------------------------*
 * Debugging function
 *-----------------------------------------------------------------------*/

static void debug_mode_dirac(
    float output[MAX_OUTPUT_CHANNELS][L_FRAME48k],
    const int16_t nchan_transport,
    const int16_t output_frame )
{
    int16_t i, n;
    int16_t tmp[L_FRAME48k];
    char file_name[50] = { 0 };

#ifdef DEBUG_MODE_DIRAC_NOCORE
    for ( n = 0; n < nchan_transport; n++ )
    {
        sprintf( file_name, "./res/ivas_dirac_enc_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) );
        dbgread( tmp, sizeof( int16_t ), output_frame, file_name );
        for ( i = 0; i < output_frame; i++ )
        {
            output[n][i] = (float) ( tmp[i] );
        }
    }
#else
    for ( n = 0; n < nchan_transport; n++ )
    {
        for ( i = 0; i < output_frame; i++ )
        {
            tmp[i] = (int16_t) ( output[n][i] + 0.5f );
        }

        sprintf( file_name, "./res/ivas_dirac_dec_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) );
        dbgwrite( tmp, sizeof( int16_t ), output_frame, 1, file_name );
    }
#endif

    return;
}
#endif