Commit b0e22899 authored by emerit's avatar emerit
Browse files

Merge branch 'orange/no-diegetic-pan' into orange/no-diegetic-pan-with-radius

parents 8c9a80a5 74e8e742
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@
#endif
#include "wmc_auto.h"
#include "render_config_reader.h"
#ifdef NO_DIEGETIC_PAN
#include "cnst.h"
#endif
#include "hrtf_file_reader.h"


@@ -757,7 +760,11 @@ static bool parseCmdlIVAS_dec(
    arg->renderConfigFilename = NULL;

    arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192;
#ifdef NO_DIEGETIC_PAN
    arg->no_diegetic_pan = FLT_MAX;
#else
    arg->no_diegetic_pan = 0.f;
#endif

    /*-----------------------------------------------------------------*
     * Initialization
@@ -959,8 +966,11 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-NO_DIEGETIC_PAN" ) == 0 )
        {
            i++;

            if ( argc - i <= 4 || argv[i][0] == '-' )
#ifdef NO_DIEGETIC_PAN
            if ( ( ( argv[i][0] != '-' ) && ( ( strlen( argv[0] ) >= 1 ) && ( ( argv[i][0] != '0' ) && ( argv[i][0] != '1' ) ) ) ) || ( ( argv[i][0] == '-' ) && ( ( strlen( argv[i] ) > 1 ) && ( ( argv[i][1] != '0' ) && ( argv[i][1] != '1' ) ) ) ) )
#else
            if ( argc - i <= 4 || ( argv[i][0] == '-' ) )
#endif
            {
                fprintf( stderr, "Error: Argument for panning option not specified!\n\n" );
                usage_dec();
@@ -1027,6 +1037,12 @@ static bool parseCmdlIVAS_dec(
    {
        arg->outputFormat = IVAS_DEC_OUTPUT_MONO;
        arg->decMode = IVAS_DEC_MODE_EVS;
#ifdef NO_DIEGETIC_PAN
        if ( ( arg->no_diegetic_pan <= 1.f ) && ( arg->no_diegetic_pan >= -1.f ) )
        {
            arg->outputFormat = IVAS_DEC_OUTPUT_STEREO;
        }
#endif
    }

    /*-----------------------------------------------------------------*
+12 −0
Original line number Diff line number Diff line
@@ -638,7 +638,11 @@ int main(
    IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 };
    IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 };

#ifdef NO_DIEGETIC_PAN
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.noDiegeticPan ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -1285,7 +1289,11 @@ static bool parseDiegeticPan(
            return false;
        }
    }
#ifdef NO_DIEGETIC_PAN
    return true;
#else
    return false;
#endif
}

static bool parseOrientationTracking(
@@ -1524,7 +1532,11 @@ static CmdlnArgs defaultArgs(
    clearString( args.renderConfigFilePath );

    args.orientationTracking = IVAS_ORIENT_TRK_REF;
#ifdef NO_DIEGETIC_PAN
    args.noDiegeticPan = FLT_MAX;
#else
    args.noDiegeticPan = 0.0f;
#endif

    args.delayCompensationEnabled = true;
    args.quietModeEnabled = false;
+8 −0
Original line number Diff line number Diff line
@@ -153,6 +153,10 @@ typedef enum
    RENDERER_PARAM_ISM,
    RENDERER_BINAURAL_MIXER_CONV,
    RENDERER_BINAURAL_MIXER_CONV_ROOM
#ifdef NO_DIEGETIC_PAN
    ,
    RENDERER_NO_DIEGETIC_DOWNMIX
#endif

} RENDERER_TYPE;

@@ -1456,6 +1460,10 @@ typedef enum
{
    TDREND_PLAYSTATUS_INITIAL,
    TDREND_PLAYSTATUS_PLAYING
#ifdef ISM_NO_DIEGETIC_PAN    
    ,
    TDREND_PLAYSTATUS_PLAYING_NO_DIEGETIC
#endif    
} TDREND_PlayStatus_t;

typedef enum
+3 −0
Original line number Diff line number Diff line
@@ -167,6 +167,9 @@
#define FIX_94_VERIFY_WAV_NUM_CHANNELS                  /* FhG: Issue 94 - Check if number of channels in input wav file matches encoder/renderer configuration */


#define NO_DIEGETIC_PAN
#define FIX_CRASH_EVS_BITSTREAM_WITH_OUTPUT
#define ISM_NO_DIEGETIC_PAN
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+32 −0
Original line number Diff line number Diff line
@@ -152,11 +152,25 @@ ivas_error ivas_dec(
#endif
            if ( st_ivas->ism_mode == ISM_MODE_PARAM )
        {
#ifdef FIX_CRASH_EVS_BITSTREAM_WITH_OUTPUT
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#else
            ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm );
#endif
        }
        else /* ISM_MODE_DISC */
        {
#ifdef FIX_CRASH_EVS_BITSTREAM_WITH_OUTPUT
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ) != IVAS_ERR_OK ) )
            {
                return error;
            }
#else
            ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL );
#endif
        }

        for ( n = 0; n < st_ivas->nchan_transport; n++ )
@@ -183,6 +197,15 @@ ivas_error ivas_dec(
            {
                ivas_mono_downmix_render_passive( st_ivas, output, output_frame );
            }
#ifdef NO_DIEGETIC_PAN
            else if ( st_ivas->renderer_type == RENDERER_NO_DIEGETIC_DOWNMIX )
            {
                float mixer_left = ( st_ivas->hDecoderConfig->no_diegetic_pan + 1.f ) * 0.5f;
                float mixer_rigth = 1.f - mixer_left;
                v_multc( output[0], mixer_rigth, output[1], output_frame );
                v_multc( output[0], mixer_left, output[0], output_frame );
            }
#endif
            else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
            {
                ivas_param_ism_dec( st_ivas, output );
@@ -201,6 +224,15 @@ ivas_error ivas_dec(
            {
                ivas_mono_downmix_render_passive( st_ivas, output, output_frame );
            }
#ifdef NO_DIEGETIC_PAN
            else if ( st_ivas->renderer_type == RENDERER_NO_DIEGETIC_DOWNMIX )
            {
                float mixer_left = ( st_ivas->hDecoderConfig->no_diegetic_pan + 1.f ) * 0.5f;
                float mixer_rigth = 1.f - mixer_left;
                v_multc( output[0], mixer_rigth, output[1], output_frame );
                v_multc( output[0], mixer_left, output[0], output_frame );
            }
#endif
            else if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM )
            {
                /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */
Loading