Commit 961a6031 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_745_FIX_DATA_TYPE_CONVERSION

parent 09be4a2c
Loading
Loading
Loading
Loading
+0 −41
Original line number Diff line number Diff line
@@ -120,11 +120,7 @@ typedef struct
    bool customLsOutputEnabled;
    char *customLsSetupFilename;
    int16_t orientation_tracking;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool non_diegetic_pan_enabled;
#else
    int16_t Opt_non_diegetic_pan;
#endif
    float non_diegetic_pan_gain;
    Word16 non_diegetic_pan_gain_fx; /* Q15 */
    bool renderConfigEnabled;
@@ -134,11 +130,7 @@ typedef struct
    bool tsmEnabled;
    IVAS_RENDER_FRAMESIZE renderFramesize;
    AcousticEnvironmentSequence aeSequence;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool dpidEnabled;
#else
    int16_t Opt_dpid_on;
#endif
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

} DecArguments;
@@ -386,13 +378,8 @@ int main(

    asked_frame_size = arg.renderFramesize;
    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,
                                       arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#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
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -468,11 +455,7 @@ int main(
        /* sanity check */
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
             arg.non_diegetic_pan_enabled == false )
#else
             arg.Opt_non_diegetic_pan == 0 )
#endif
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            goto cleanup;
@@ -930,20 +913,12 @@ static bool parseCmdlIVAS_dec(

    arg->renderConfigEnabled = false;
    arg->renderConfigFilename = NULL;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    arg->dpidEnabled = false;
#else
    arg->Opt_dpid_on = 0;
#endif

    arg->outputMdFilename = NULL;

    arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    arg->non_diegetic_pan_enabled = false;
#else
    arg->Opt_non_diegetic_pan = 0;
#endif
    arg->non_diegetic_pan_gain = 0.f;
    arg->tsmEnabled = false;
    arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
@@ -1206,11 +1181,7 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 )
        {
            i++;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
            arg->non_diegetic_pan_enabled = true;
#else
            arg->Opt_non_diegetic_pan = 1;
#endif
            strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 );
            argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
            to_upper( argv_to_upper );
@@ -1356,11 +1327,7 @@ static bool parseCmdlIVAS_dec(
        {
            int16_t id, tmp;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
            arg->dpidEnabled = true;
#else
            arg->Opt_dpid_on = 1;
#endif
            ++i;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
@@ -1441,11 +1408,7 @@ static bool parseCmdlIVAS_dec(
        }
        i++;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg->non_diegetic_pan_enabled && arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO )
#else
        if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) )
#endif
        {
            fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" );
            usage_dec();
@@ -1463,11 +1426,7 @@ static bool parseCmdlIVAS_dec(
        arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
        arg->decMode = IVAS_DEC_MODE_EVS;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg->non_diegetic_pan_enabled )
#else
        if ( ( arg->Opt_non_diegetic_pan ) )
#endif
        {
            arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO;
        }
+0 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@
/* #################### Start BASOP porting switches ############################ */

#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 */
#define FIX_745_FIX_DATA_TYPE_CONVERSION                /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */
#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART       /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define FIX_587_DEFAULT_REVERB                          /* Philips: issue 587: inconsistent default reverb parameters across renderers */
+0 −19
Original line number Diff line number Diff line
@@ -102,7 +102,6 @@ ivas_error IVAS_DEC_Open(

/*! r: error code */
ivas_error IVAS_DEC_Configure(
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
    const UWord32 sampleRate,                               /* i  : output sampling frequency                                               */
    const IVAS_AUDIO_CONFIG outputConfig,                   /* i  : output configuration                                                    */
@@ -119,24 +118,6 @@ ivas_error IVAS_DEC_Configure(
    const bool dpidEnabled,                                 /* i  : enable directivity pattern option                                       */
    const UWord16 acousticEnvironmentId,                    /* i  : Acoustic environment ID                                                 */
    const bool delayCompensationEnabled                     /* i  : enable delay compensation                                               */
#else
  IVAS_DEC_HANDLE hIvasDec,                                 /* i/o: IVAS decoder handle                                                     */
  const UWord32 sampleRate,                                 /* i  : output sampling frequency                                               */
  const IVAS_AUDIO_CONFIG outputConfig,                     /* i  : audio configuration                                                     */
  const Word16 tsmEnabled,                                  /* i  : enable TSM                                                              */
  const IVAS_RENDER_FRAMESIZE renderFramesize,              /* i  : rendering frame size                                                    */
  const Word16 customLsOutputEnabled,                       /* i  : enable custom loudspeaker setup handle                                  */
  const Word16 hrtfReaderEnabled,                           /* i  : enable HRTF binary file input                                           */
  const Word16 enableHeadRotation,                          /* i  : enable head rotation for binaural output                                */
  const Word16 enableExternalOrientation,                   /* i  : enable external orientations                                            */
  const IVAS_HEAD_ORIENT_TRK_T orientation_tracking,        /* i  : head orientation tracking type                                          */
  const Word16 renderConfigEnabled,                         /* i  : enable Renderer config. file for binaural output                        */
  const Word16 Opt_non_diegetic_pan,                        /* i  : diegetic or not                                                         */
  const Word16 non_diegetic_pan_gain_fx,                    /* i  : non diegetic panning gain Q15                                           */
  const Word16 Opt_dpid_on,                                 /* i  : enable directivity pattern option                                       */
  const UWord16 acousticEnvironmentId,                      /* i  : Acoustic environment ID                                                 */
  const Word16 delayCompensationEnabled                     /* i  : enable delay compensation                                               */
#endif
);

void IVAS_DEC_Close(
+0 −44
Original line number Diff line number Diff line
@@ -455,7 +455,6 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat(
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_Configure(
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    IVAS_DEC_HANDLE hIvasDec,                          /* i/o: IVAS decoder handle                                 */
    const UWord32 sampleRate,                          /* i  : output sampling frequency                           */
    const IVAS_AUDIO_CONFIG outputConfig,              /* i  : output configuration                                */
@@ -472,24 +471,6 @@ ivas_error IVAS_DEC_Configure(
    const bool dpidEnabled,                            /* i  : enable directivity pattern option                   */
    const UWord16 acousticEnvironmentId,               /* i  : Acoustic environment ID                             */
    const bool delayCompensationEnabled                /* i  : enable delay compensation                           */
#else
    IVAS_DEC_HANDLE hIvasDec,                          /* i/o: IVAS decoder handle                        */
    const UWord32 sampleRate,                          /* i  : output sampling frequency                  */
    const AUDIO_CONFIG outputConfig,                   /* i  : output configuration                       */
    const Word16 tsmEnabled,                           /* i  : enable time scale modification             */
    const IVAS_RENDER_FRAMESIZE renderFramesize,       /* i  : rendering frame size                       */
    const Word16 customLsOutputEnabled,                /* i  : enable custom loudspeaker setup handle     */
    const Word16 hrtfReaderEnabled,                    /* i  : enable HRTF binary file input              */
    const Word16 enableHeadRotation,                   /* i  : enable head rotation for binaural output   */
    const Word16 enableExternalOrientation,            /* i  : enable external orientations               */
    const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i  : head orientation tracking type             */
    const Word16 renderConfigEnabled,                  /* i  : enable Renderer config. file for binaural output */
    const Word16 Opt_non_diegetic_pan,                 /* i  : diegetic or not                                  */
    const Word16 non_diegetic_pan_gain_fx,             /* i  : non diegetic panning gain Q15                    */
    const Word16 Opt_dpid_on,                          /* i  : enable directivity pattern option                */
    const UWord16 acousticEnvironmentId,               /* i  : Acoustic environment ID                          */
    const Word16 delayCompensationEnabled              /* i  : enable delay compensation                        */
#endif
)
{
    Decoder_Struct *st_ivas;
@@ -514,13 +495,8 @@ ivas_error IVAS_DEC_Configure(
    test();
    test();
    test();
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && !( ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MONO ) && non_diegetic_pan_enabled == false ) ||
                                                         ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_STEREO ) && non_diegetic_pan_enabled ) ) )
#else
    IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && !( ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MONO ) && Opt_non_diegetic_pan == 0 ) ||
                                                         ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_STEREO ) && EQ_16( Opt_non_diegetic_pan, 1 ) ) ) )
#endif
    {
        return IVAS_ERR_WRONG_MODE;
    }
@@ -552,37 +528,17 @@ ivas_error IVAS_DEC_Configure(
        move16();
    }

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    hDecoderConfig->Opt_tsm = (Word16) tsmEnabled;
    hDecoderConfig->Opt_LsCustom = (Word16) customLsOutputEnabled;
    hDecoderConfig->Opt_Headrotation = (Word16) enableHeadRotation;
#else
    hDecoderConfig->Opt_tsm = tsmEnabled;
    hDecoderConfig->Opt_LsCustom = customLsOutputEnabled;
    hDecoderConfig->Opt_Headrotation = enableHeadRotation;
#endif
    hDecoderConfig->orientation_tracking = orientation_tracking;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    hDecoderConfig->Opt_HRTF_binary = (Word16) hrtfReaderEnabled;
    hDecoderConfig->Opt_RendConfigCustom = (Word16) renderConfigEnabled;
    hDecoderConfig->Opt_non_diegetic_pan = (Word16) non_diegetic_pan_enabled;
#else
    hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled;
    hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled;
    hDecoderConfig->Opt_non_diegetic_pan = Opt_non_diegetic_pan;
#endif
    hDecoderConfig->non_diegetic_pan_gain_fx = non_diegetic_pan_gain_fx; // Q15
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    hDecoderConfig->Opt_delay_comp = (Word16) delayCompensationEnabled;
#else
    hDecoderConfig->Opt_delay_comp = delayCompensationEnabled;
#endif
    hDecoderConfig->Opt_ExternalOrientation = enableExternalOrientation;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    hDecoderConfig->Opt_dpid_on = (Word16) dpidEnabled;
#else
    hDecoderConfig->Opt_dpid_on = Opt_dpid_on;
#endif
    IF( NE_32( (Word32) acousticEnvironmentId, 65535 ) )
    {
        hDecoderConfig->Opt_aeid_on = TRUE;