Commit 90c91a25 authored by sagnowski's avatar sagnowski
Browse files

Add float dump for testing external vs internal rendering

parent 910d40c3
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@ if(WMOPS)
  add_definitions("-DWMOPS=1")
endif()

if(DEC_TO_REND_FLOAT_DUMP)
  add_compile_definitions(DEC_TO_REND_FLOAT_DUMP)
endif()

project(stereo-evs)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # make Visual Studio projects look nicer
+19 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
*******************************************************************************************************/

#include "options.h"
#include "debug.h"
#include "audio_file_reader.h"
#include "audio_file_writer.h"
#include "cmdl_tools.h"
@@ -750,6 +751,10 @@ int32_t main( int32_t argc, char **argv )
        fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath );
        exit( -1 );
    }
#ifdef DEC_TO_REND_FLOAT_DUMP
    printf( "Warning: Renderer executable built with DEC_TO_REND_FLOAT_DUMP enabled!\n" );
    printf( "         Float dump file (./float_out.wav) will be forced as input.\n" );
#endif

    inBufferSize = frameSize_smpls * totalNumInChannels;
    outBufferSize = frameSize_smpls * numOutChannels;
@@ -800,6 +805,20 @@ int32_t main( int32_t argc, char **argv )

        /* Convert from int to float and from interleaved to packed */
        convertInputBuffer( inpInt16Buffer, numSamplesRead, frameSize_smpls, num_in_channels, inFloatBuffer );
#ifdef DEC_TO_REND_FLOAT_DUMP
        /* Overwrite from dump file */
        float tmp[960 * 16];
        dbgread( tmp, sizeof( float ), numSamplesRead, "./float_out.raw" );

        /* Conversion from interleaved to packed still necessary */
        for ( int32_t i = 0; i < numSamplesRead / num_in_channels; ++i )
        {
            for ( int32_t c = 0; c < num_in_channels; ++c )
            {
                inFloatBuffer[c * frameSize_smpls + i] = tmp[i * num_in_channels + c];
            }
        }
#endif

        for ( int32_t i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
        {
+10 −0
Original line number Diff line number Diff line
@@ -144,6 +144,16 @@ uint32_t ivas_syn_output(
        }
    }

#ifdef DEC_TO_REND_FLOAT_DUMP
    for ( i = 0; i < output_frame; ++i )
    {
        for ( n = 0; n < n_channels; ++n )
        {
            dbgwrite( &synth[n][i], sizeof( float ), 1, 1, "./float_out.raw" );
        }
    }
#endif

    return noClipping;
}