Commit b3a7e5db authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1053_REVERB_RECONFIGURATION

parent 93bdf82d
Loading
Loading
Loading
Loading
+0 −45
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ static
 *------------------------------------------------------------------------------------------*/


#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
    uint16_t *pID;
@@ -98,7 +97,6 @@ typedef struct
    uint16_t selected;
    uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif

typedef struct
{
@@ -153,11 +151,7 @@ typedef struct
    uint16_t tsmScale;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
    AcousticEnvironmentSequence aeSequence;
#else
    uint16_t acousticEnvironmentId;
#endif
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool dpidEnabled;
#else
@@ -451,7 +445,6 @@ int main(

    asked_frame_size = arg.renderFramesize;

#ifdef FIX_1053_REVERB_RECONFIGURATION
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain,
@@ -459,10 +452,6 @@ int main(
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -709,11 +698,7 @@ int main(

        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
@@ -723,11 +708,7 @@ int main(
            }
            else
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
#endif
                goto cleanup;
            }
#ifndef FIX_587_DEFAULT_REVERB
@@ -937,13 +918,11 @@ cleanup:

    free( pcmBuf );

#ifdef FIX_1053_REVERB_RECONFIGURATION
    if ( arg.aeSequence.count > 0 )
    {
        free( arg.aeSequence.pID );
        free( arg.aeSequence.pValidity );
    }
#endif

#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
@@ -1168,15 +1147,11 @@ static bool parseCmdlIVAS_dec(
    arg->tsmScaleFileName = NULL;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
    arg->aeSequence.count = 0;
    arg->aeSequence.pID = NULL;
    arg->aeSequence.pValidity = NULL;
    arg->aeSequence.selected = 0;
    arg->aeSequence.frameCounter = 0;
#else
    arg->acousticEnvironmentId = 65535;
#endif
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
        arg->directivityPatternId[i] = 65535;
@@ -1562,7 +1537,6 @@ static bool parseCmdlIVAS_dec(

            if ( !is_digits_only( argv[i] ) )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                uint16_t k;
                char *s = argv[i];
                char *token = argv[i];
@@ -1622,14 +1596,8 @@ static bool parseCmdlIVAS_dec(
                    usage_dec();
                    return false;
                }
#else
                fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] );
                usage_dec();
                return false;
#endif
            }

#ifdef FIX_1053_REVERB_RECONFIGURATION
            else
            {
                /* A single acoustic environment */
@@ -1644,9 +1612,6 @@ static bool parseCmdlIVAS_dec(
                arg->aeSequence.pID[0] = (int16_t) atoi( argv[i++] );
                arg->aeSequence.pValidity[0] = 0;
            }
#else
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
#endif
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
@@ -1898,15 +1863,11 @@ static void usage_dec( void )
    fprintf( stdout, "                      output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
    fprintf( stdout, "                      ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
    fprintf( stdout, "                      otherwise a default directivity pattern is used.\n" );
#ifdef FIX_1053_REVERB_RECONFIGURATION
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number > 0) or\n" );
    fprintf( stdout, "                      a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" );
    fprintf( stdout, "                      without braces and spaces, with ':' character separating ID from duration and ',' separating\n" );
    fprintf( stdout, "                      ID and duration pairs, where duration is specified in frames\n" );
    fprintf( stdout, "                      for BINAURAL_ROOM_REVERB output configuration.\n" );
#else
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
    fprintf( stdout, "-q                  : Quiet mode, no frame counter\n" );
@@ -2269,7 +2230,6 @@ static ivas_error decodeG192(
    int16_t vec_pos_update, vec_pos_len;
    SplitFileReadWrite *splitRendWriter = NULL;
    int16_t isSplitRend, isSplitCoded;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    IVAS_RENDER_CONFIG_DATA renderConfig;
    RenderConfigReader *renderConfigReader = NULL;

@@ -2305,7 +2265,6 @@ static ivas_error decodeG192(
            goto cleanup;
        }
    }
#endif

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
@@ -2507,7 +2466,6 @@ static ivas_error decodeG192(
        {
            if ( needNewFrame )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
                     arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 )
                {
@@ -2538,7 +2496,6 @@ static ivas_error decodeG192(
                        }
                    }
                }
#endif
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
                if ( arg.tsmScaleFileEnabled )
@@ -2964,9 +2921,7 @@ static ivas_error decodeG192(

cleanup:

#ifdef FIX_1053_REVERB_RECONFIGURATION
    RenderConfigReader_close( &renderConfigReader );
#endif
    split_rend_reader_writer_close( &splitRendWriter );
    AudioFileWriter_close( &afWriter );
    MasaFileWriter_close( &masaWriter );
+0 −39
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ typedef struct
    IVAS_CUSTOM_LS_DATA outSetupCustom;
} OutputConfig;

#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
    uint16_t *pID;
@@ -149,7 +148,6 @@ typedef struct
    uint16_t selected;
    uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif

typedef struct
{
@@ -190,11 +188,7 @@ typedef struct
    float syncMdDelay;
    IVAS_RENDER_FRAMESIZE render_framesize;
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
#ifdef FIX_1053_REVERB_RECONFIGURATION
    AcousticEnvironmentSequence aeSequence;
#else
    uint16_t acousticEnvironmentId;
#endif
} CmdlnArgs;

typedef enum
@@ -389,11 +383,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_acousticEnvironmentId,
        .match = "acoustic_environment_id",
        .matchShort = "aeid",
#ifdef FIX_1053_REVERB_RECONFIGURATION
        .description = "Acoustic environment ID( number > 0 ) or a sequence thereof in the format [ID1:duration1,ID2:duration2...] without braces and spaces, with ':' character separating ID from duration and ',' separating ID and duration pairs, where duration is specified in frames for BINAURAL_ROOM_REVERB output configuration.",
#else
        .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output.",
#endif
    },
};

@@ -713,9 +703,7 @@ int main(
    int16_t zeroPadToWrite = 0;
    int32_t delayTimeScale = 0;
    int16_t i, numChannels;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    uint16_t aeID;
#endif
    ivas_error error = IVAS_ERR_OK;

#ifdef WMOPS
@@ -1103,12 +1091,8 @@ int main(
#endif
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535;
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
@@ -1118,11 +1102,7 @@ int main(
            }
            else
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", aeID );
#else
                fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
#endif
                goto cleanup;
            }
#ifndef FIX_587_DEFAULT_REVERB
@@ -1511,7 +1491,6 @@ int main(
        num_in_channels = inBuffer.config.numChannels;
        const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0;

#ifdef FIX_1053_REVERB_RECONFIGURATION
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
             args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 )
        {
@@ -1544,7 +1523,6 @@ int main(
                }
            }
        }
#endif
        numSamplesRead = 0;
        /* Read the input data */
        if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK )
@@ -2015,13 +1993,11 @@ cleanup:
    {
        free( bitsBufferData );
    }
#ifdef FIX_1053_REVERB_RECONFIGURATION
    if ( args.aeSequence.count > 0 )
    {
        free( args.aeSequence.pID );
        free( args.aeSequence.pValidity );
    }
#endif
    for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
    {
        MasaFileReader_close( &masaReaders[i] );
@@ -2493,7 +2469,6 @@ static bool parseLfePositionConfig(
}


#ifdef FIX_1053_REVERB_RECONFIGURATION
static bool parseAcousticEnvironmentIds(
    const char *value,
    AcousticEnvironmentSequence *aeSequence )
@@ -2578,7 +2553,6 @@ static bool parseAcousticEnvironmentIds(

    return true;
}
#endif

static bool checkRequiredArgs(
    CmdlnArgs args )
@@ -2692,15 +2666,11 @@ static CmdlnArgs defaultArgs(
        args.directivityPatternId[i] = 65535;
    }

#ifdef FIX_1053_REVERB_RECONFIGURATION
    args.aeSequence.count = 0;
    args.aeSequence.pID = NULL;
    args.aeSequence.pValidity = NULL;
    args.aeSequence.selected = 0;
    args.aeSequence.frameCounter = 0;
#else
    args.acousticEnvironmentId = 65535;
#endif

    return args;
}
@@ -2876,19 +2846,10 @@ static void parseOption(
            break;
        case CmdLnOptionId_acousticEnvironmentId:
            assert( numOptionValues == 1 );
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( !parseAcousticEnvironmentIds( optionValues[0], &args->aeSequence ) )
            {
                fprintf( stderr, "Invalid acoustic environment ID specified: %s\n", optionValues[0] );
            }
#else
            if ( !is_digits_only( optionValues[0] ) )
            {
                fprintf( stderr, "Invalid acousting environment ID specified: %s\n", optionValues[0] );
                exit( -1 );
            }
            args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
#endif
            break;
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
+0 −1
Original line number Diff line number Diff line
@@ -156,7 +156,6 @@

/* #################### Start BASOP porting switches ############################ */

#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
#define NONBE_FIX_ISM_XOVER_BR                          /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */
#define NONBE_FIX_984_OMASA_EXT_OUTPUT                  /* Nok: issue 1497 - porting OMASA EXT MR   */
#define FIX_1161_REDUCE_OMASA_HEAP                      /* VA: reduction of OMASA heap memory */
+0 −33
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@
#endif
#include "wmc_auto.h"

#ifdef FIX_1053_REVERB_RECONFIGURATION

/*-------------------------------------------------------------------------
 * Local constants
@@ -59,7 +58,6 @@ const float dmxmtx_table[BINAURAL_CHANNELS][REVERB_INPUT_DOWNMIX_CHANNELS] = {
    { 1.0f, 0.0f, 0.70709997f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f },
    { 0.0f, 1.0f, 0.70709997f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f },
};
#endif

/*-------------------------------------------------------------------------
 * ivas_binRenderer_filterModule()
@@ -837,11 +835,7 @@ static void ivas_binaural_obtain_DMX(

            for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                float dmxConst = dmxmtx_table[chOutIdx][chIdx];
#else
                float dmxConst = hBinRenderer->hReverb->dmxmtx[chOutIdx][chIdx];
#endif
                for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
                {
                    for ( k = 0; k < numTimeSlots; k++ )
@@ -1050,11 +1044,7 @@ ivas_error ivas_binRenderer_open(
)
{
    BINAURAL_RENDERER_HANDLE hBinRenderer;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    int16_t convBand, k;
#else
    int16_t convBand, chIdx, k;
#endif
    ivas_error error;
#ifdef FIX_587_DEFAULT_REVERB
    const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics;
@@ -1220,29 +1210,6 @@ ivas_error ivas_binRenderer_open(
            return error;
        }

#ifndef FIX_1053_REVERB_RECONFIGURATION
        /* initialize the dmx matrix */
        if ( hBinRenderer->nInChannels != HOA3_CHANNELS )
        {
            for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
            {
                for ( k = 0; k < hBinRenderer->nInChannels; k++ )
                {
                    hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k];
                }
            }
        }
        if ( hBinRenderer->nInChannels != HOA3_CHANNELS )
        {
            for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
            {
                for ( k = 0; k < hBinRenderer->nInChannels; k++ )
                {
                    hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k];
                }
            }
        }
#endif
    }
    else
    {
+0 −11
Original line number Diff line number Diff line
@@ -390,17 +390,6 @@ const float dirac_dithering_ele_scale[DIRAC_DIFFUSE_LEVELS] =
    6.716062e-01f, 1.011804e+00f, 1.796875e+00f, 2.804382e+00f, 4.623130e+00f, 7.802667e+00f, 1.045446e+01f, 1.379538e+01f
};

#ifndef FIX_1053_REVERB_RECONFIGURATION
/*----------------------------------------------------------------------------------*
 * FASTCONV and PARAMETRIC binaural renderer ROM tables
 *----------------------------------------------------------------------------------*/

const float dmxmtx_table[BINAURAL_CHANNELS][11] =
{
    { 1.0f, 0.0f, 0.70709997f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f },
    { 0.0f, 1.0f, 0.70709997f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f },
};
#endif

/*----------------------------------------------------------------------*
 * MC ParamUpmix ROM tables
Loading