Commit 1d895339 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1053_REVERB_RECONFIGURATION

parent e400e6cd
Loading
Loading
Loading
Loading
+0 −45
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ static
 * Local structure for storing cmdln arguments
 *------------------------------------------------------------------------------------------*/

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


typedef struct
@@ -135,11 +133,7 @@ typedef struct
    IVAS_DEC_COMPLEXITY_LEVEL complexityLevel;
    bool tsmEnabled;
    IVAS_RENDER_FRAMESIZE renderFramesize;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    AcousticEnvironmentSequence aeSequence;
#else
    uint16_t acousticEnvironmentId;
#endif
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool dpidEnabled;
#else
@@ -417,7 +411,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_fx,
@@ -425,10 +418,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_fx,
                                       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_fx,
                                       arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -586,11 +575,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 )
                {
@@ -600,11 +585,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
@@ -805,13 +786,11 @@ cleanup:

    free( pcmBuf );

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

    if ( arg.hrtfReaderEnabled )
    {
@@ -1010,15 +989,11 @@ static bool parseCmdlIVAS_dec(
    arg->non_diegetic_pan_gain = 0.f;
    arg->tsmEnabled = false;
    arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
#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;
@@ -1344,7 +1319,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];
@@ -1404,13 +1378,7 @@ 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 */
@@ -1425,9 +1393,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 )
        {
@@ -1665,15 +1630,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" );
@@ -2002,7 +1963,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;

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

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
@@ -2205,7 +2164,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 )
                {
@@ -2236,7 +2194,6 @@ static ivas_error decodeG192(
                        }
                    }
                }
#endif
                if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK )
                {
                    if ( error == IVAS_ERR_END_OF_FILE )
@@ -2612,9 +2569,7 @@ static ivas_error decodeG192(

cleanup:

#ifdef FIX_1053_REVERB_RECONFIGURATION
    RenderConfigReader_close( &renderConfigReader );
#endif

    split_rend_reader_writer_close( &splitRendWriter );
    AudioFileWriter_close( &afWriter );
+0 −39
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@ typedef struct
    IVAS_CUSTOM_LS_DATA outSetupCustom;
} OutputConfig;

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

typedef struct
{
@@ -194,11 +192,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
@@ -393,11 +387,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 configuration",
#endif
    },
};

@@ -794,9 +784,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
@@ -1190,12 +1178,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 )
                {
@@ -1205,11 +1189,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, "\nFailed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
#endif
                goto cleanup;
            }
#ifndef FIX_587_DEFAULT_REVERB
@@ -1634,7 +1614,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 )
        {
@@ -1667,7 +1646,6 @@ int main(
                }
            }
        }
#endif

        numSamplesRead = 0;

@@ -2131,13 +2109,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 )
    {
@@ -2605,7 +2581,6 @@ static bool parseLfePositionConfig(
    return true;
}

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

    return true;
}
#endif


static bool checkRequiredArgs(
@@ -2805,15 +2779,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;
}
@@ -2989,19 +2959,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
@@ -86,7 +86,6 @@

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

#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */
#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR          /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/
#define NONBE_FIX_1052_SBA_EXT                          /* Dlb: SBA external output support */
+0 −24
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@
#define NUM_TAPS_F0_4 ( Word16 )( 39 ) // (Word16) ceil( 0.4f * hBinRenConvModule->numTaps )
#define NUM_TAPS_F0_3 ( Word16 )( 29 ) // (Word16) ceil( 0.3f * hBinRenConvModule->numTaps )

#ifdef FIX_1053_REVERB_RECONFIGURATION
/*----------------------------------------------------------------------------------*
 * Local constants
 *----------------------------------------------------------------------------------*/
@@ -62,7 +61,6 @@ const Word32 dmxmtx_table_fx[BINAURAL_CHANNELS][REVERB_INPUT_DOWNMIX_CHANNELS] =
    { 0x7fffffff, 0, 1518485623, 0x7fffffff, 0, 0x7fffffff, 0, 0x7fffffff, 0, 0x7fffffff, 0 },
    { 0, 0x7fffffff, 1518485623, 0, 0x7fffffff, 0, 0x7fffffff, 0, 0x7fffffff, 0, 0x7fffffff },
};
#endif

/*-------------------------------------------------------------------------
 * ivas_binRenderer_filterModule_fx()
@@ -937,12 +935,7 @@ static void ivas_binaural_obtain_DMX_fx(

            FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                Word32 dmxConst = dmxmtx_table_fx[chOutIdx][chIdx];
#else
                Word32 dmxConst = hBinRenderer->hReverb->dmxmtx_fx[chOutIdx][chIdx];
                move32();
#endif

                FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
                {
@@ -1192,11 +1185,7 @@ ivas_error ivas_binRenderer_open_fx(
)
{
    BINAURAL_RENDERER_HANDLE hBinRenderer;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    Word16 convBand, k;
#else
    Word16 convBand, chIdx, k;
#endif
    ivas_error error;
#ifdef FIX_587_DEFAULT_REVERB
    const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics;
@@ -1379,19 +1368,6 @@ ivas_error ivas_binRenderer_open_fx(
        }

/* initialize the dmx matrix */
#ifndef FIX_1053_REVERB_RECONFIGURATION
        IF( NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) )
        {
            FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
            {
                FOR( k = 0; k < hBinRenderer->nInChannels; k++ )
                {
                    hBinRenderer->hReverb->dmxmtx_fx[chIdx][k] = dmxmtx_table_fx[chIdx][k];
                    move32();
                }
            }
        }
#endif
    }
    ELSE
    {
+0 −6
Original line number Diff line number Diff line
@@ -90,12 +90,6 @@ extern const UWord16 *const sym_freq_ECSQ_tab_abs_lsbs[1 + 4];
extern const Word16 dirac_dithering_azi_scale_fx[DIRAC_DIFFUSE_LEVELS];
extern const Word16 dirac_dithering_ele_scale_fx[DIRAC_DIFFUSE_LEVELS];

#ifndef FIX_1053_REVERB_RECONFIGURATION
/*----------------------------------------------------------------------------------*
 * FASTCONV and PARAMETRIC binaural renderer ROM tables
 *----------------------------------------------------------------------------------*/
extern const Word32 dmxmtx_table_fx[BINAURAL_CHANNELS][11];
#endif

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