Commit b698ebfe authored by vaclav's avatar vaclav
Browse files

acceptance of switches, step 2

parent d8642314
Loading
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -150,9 +150,7 @@ typedef struct
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
    bool objEditEnabled;
    char *objEditFileName;
#ifdef FIX_1419_MONO_STEREO_UMX
    bool evsMode;
#endif
    IVAS_ROOM_SIZE_T roomSize;

} DecArguments;
@@ -1010,9 +1008,7 @@ static bool parseCmdlIVAS_dec(
    arg->output_Fs = IVAS_MAX_SAMPLING_RATE;
    arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
    arg->decMode = IVAS_DEC_MODE_IVAS;
#ifdef FIX_1419_MONO_STEREO_UMX
    arg->evsMode = false;
#endif
    arg->quietModeEnabled = false;
    arg->delayCompensationEnabled = true;
    arg->voipMode = false;
@@ -1564,14 +1560,12 @@ static bool parseCmdlIVAS_dec(
            }
            i++;
        }
#ifdef FIX_1419_MONO_STEREO_UMX
        else if ( strcmp( argv_to_upper, "-EVS" ) == 0 )
        {
            arg->evsMode = true;
            arg->decMode = IVAS_DEC_MODE_EVS;
            i++;
        }
#endif
        else if ( strcmp( argv_to_upper, "-ROOM_SIZE" ) == 0 )
        {
            i++;
@@ -1659,14 +1653,12 @@ static bool parseCmdlIVAS_dec(
            usage_dec();
            return false;
        }
#ifdef FIX_1419_MONO_STEREO_UMX
        else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode )
        {
            fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" );
            usage_dec();
            return false;
        }
#endif

        if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
@@ -1759,9 +1751,7 @@ static bool parseCmdlIVAS_dec(
static void usage_dec( void )
{
    fprintf( stdout, "Usage for EVS:   IVAS_dec.exe [Options] Fs bitstream_file output_file\n" );
#ifdef FIX_1419_MONO_STEREO_UMX
    fprintf( stdout, "                 OR usage for IVAS (below) with -evs option and OutputConf\n" );
#endif
    fprintf( stdout, "Usage for IVAS:  IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file\n\n" );

    fprintf( stdout, "Mandatory parameters:\n" );
@@ -1778,9 +1768,7 @@ static void usage_dec( void )

    fprintf( stdout, "Options:\n" );
    fprintf( stdout, "--------\n" );
#ifdef FIX_1419_MONO_STEREO_UMX
    fprintf( stdout, "-evs                : Specify that the supplied bitstream is an EVS bitstream\n" );
#endif
    fprintf( stdout, "-VOIP               : VoIP mode: RTP in G192\n" );
    fprintf( stdout, "-VOIP_hf_only=0     : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" );
    fprintf( stdout, "-VOIP_hf_only=1     : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump\n" );
+1 −20
Original line number Diff line number Diff line
@@ -33,9 +33,7 @@
#include "lib_rend.h"
#include <assert.h>
#include <math.h>
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
#include <stdint.h>
#endif
#include <string.h>
#include "audio_file_reader.h"
#include "audio_file_writer.h"
@@ -192,11 +190,7 @@ typedef struct
    float lfeConfigElevation;
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    int16_t syncMdDelay;
#else
    float syncMdDelay;
#endif
    IVAS_RENDER_FRAMESIZE render_framesize;
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
    AcousticEnvironmentSequence aeSequence;
@@ -1439,16 +1433,7 @@ int main(
            audioWriter = NULL;
        }

#ifdef FIX_1437_LC3PLUS_EXTREND_HIRES
        if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend,
                                                              &bitsBuffer.config.codec,
                                                              &bitsBuffer.config.poseCorrection,
                                                              &bitsBuffer.config.codec_frame_size_ms,
                                                              &bitsBuffer.config.isar_frame_size_ms,
                                                              &bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK )
#endif
        if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms, &bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader()!\n" );
            goto cleanup;
@@ -2911,11 +2896,7 @@ static void parseOption(
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
            /* Metadata Delay to sync with audio delay in ms */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
            args->syncMdDelay = (int16_t) strtol( optionValues[0], NULL, 10 );
#else
            args->syncMdDelay = strtof( optionValues[0], NULL );
#endif
            break;
        case CmdLnOptionId_roomSize:
            assert( numOptionValues == 1 );
+0 −4
Original line number Diff line number Diff line
@@ -1250,11 +1250,7 @@ typedef enum
 *----------------------------------------------------------------------------------*/

#define MC_LS_SETUP_BITS                        3                           /* number of bits for writing the MC LS configuration */
#ifdef FIX_1419_MONO_STEREO_UMX
#define LS_SETUP_CONVERSION_NUM_MAPPINGS        41                          /* number of mappings for LS setup conversion         */
#else
#define LS_SETUP_CONVERSION_NUM_MAPPINGS        35                          /* number of mappings for LS setup conversion         */
#endif

typedef enum
{
+3 −12
Original line number Diff line number Diff line
@@ -156,30 +156,21 @@
#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
/*#define DISABLE_LIMITER */                            /* test switch for testing BE between 5ms and 20ms rendering                                                  */ 

/* ################## Start DEVELOPMENT switches ######################### */

/* ################## Start MAINTENANCE switches ######################### */

/* ################### Start BE switches ################################# */
/* only BE switches wrt selection floating point code */
/* only BE switches wrt wrt. TS 26.258 V3.0 */

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */



#define RENDERER_MD_SYNC_DELAY_TO_INTEGER               /* FhG: change data type of metadata sync delay in ext renderer to int16_t for better BASOP portability (and nicer code) */
#define FIX_1419_MONO_STEREO_UMX                        /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */
#define FIX_1437_LC3PLUS_EXTREND_HIRES                  /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */


/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.258 V3.0 */

/* any switch which is non-be wrt last submitted floating point code */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ 


/* ##################### End NON-BE switches ########################### */
+7 −35
Original line number Diff line number Diff line
@@ -1388,15 +1388,11 @@ ivas_error ivas_init_decoder(

    if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
    {
#ifdef FIX_1419_MONO_STEREO_UMX
        if ( st_ivas->ivas_format == MONO_FORMAT )
        {
            hDecoderConfig->nchan_out = 1;
        }
        else if ( st_ivas->ivas_format == STEREO_FORMAT )
#else
        if ( st_ivas->ivas_format == STEREO_FORMAT )
#endif
        {
            hDecoderConfig->nchan_out = CPE_CHANNELS;
        }
@@ -1449,13 +1445,11 @@ ivas_error ivas_init_decoder(
        st_ivas->hOutSetup.output_config = st_ivas->intern_config;
        st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config );
    }
#ifdef FIX_1419_MONO_STEREO_UMX

    if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT )
    {
        st_ivas->transport_config = ( st_ivas->ivas_format == MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO;
    }
#endif

    /* Only initialize transport setup if it is used */
    if ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_INVALID )
@@ -1587,10 +1581,6 @@ ivas_error ivas_init_decoder(
    else if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
        st_ivas->nchan_transport = CPE_CHANNELS;
#ifndef FIX_1419_MONO_STEREO_UMX /* already set now by renderer_select() */
        st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO;
#endif

        st_ivas->nSCE = 0;
        st_ivas->nCPE = 1; /* in stereo, there is always only one CPE */
        cpe_id = 0;
@@ -3321,20 +3311,6 @@ static ivas_error doSanityChecks_IVAS(
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Non-diegetic panning not supported in this IVAS format" );
    }

#ifndef FIX_1419_MONO_STEREO_UMX /* we now support basically everything for stereo */
    /* Verify stereo output configuration */
    if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
        if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" );
        }
    }
    /* Verify output configuration for other formats */
    else
    {
        if ( output_config == IVAS_AUDIO_CONFIG_INVALID )
#else /* exclude invalid configs instead of matching valid ones */
    if ( output_config == IVAS_AUDIO_CONFIG_INVALID ||
         output_config == IVAS_AUDIO_CONFIG_ISM1 ||
         output_config == IVAS_AUDIO_CONFIG_ISM2 ||
@@ -3342,7 +3318,6 @@ static ivas_error doSanityChecks_IVAS(
         output_config == IVAS_AUDIO_CONFIG_ISM4 ||
         output_config == IVAS_AUDIO_CONFIG_MASA1 ||
         output_config == IVAS_AUDIO_CONFIG_MASA2 )
#endif
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" );
    }
@@ -3351,9 +3326,6 @@ static ivas_error doSanityChecks_IVAS(
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" );
    }
#ifndef FIX_1419_MONO_STEREO_UMX
    }
#endif

    if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 )
    {
Loading